Warning: session_start(): open(/var/lib/php/sessions/sess_8suu8ph0g2nkvhkklgo1ufkj31, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
srecord noeq G22ProjectOverviewPanel(G22Utils g22utils) {
JSyntaxTextFileEditor storyView;
JLabel lblStats;
transient SingleComponentPanel scpShowCase;
transient ReliableSingleThread rstUpdateShowCase = rst(l0 updateShowCase);
void updateStats {
setText(lblStats, "Database core size: " + str_toKB(fileSize(g22utils.concepts().conceptsFile())));
}
void updateShowCase() {
if (!isShowing(scpShowCase)) ret;
var autoStarter = g22utils.autoStarter();
if (autoStarter.cancelled())
ret with scpShowCase.set(jcenteredlabel("Auto-start cancelled"));
if (!autoStarter.waitedAndDone()) ret;
var script = varShowCasedScript()!;
if (!script.isClearForAutoRun())
ret with scpShowCase.set(jcenteredlabel("Script not clear for auto-run"));
try {
O result = script.evaluateAutoRunWithoutTimeout();
var objVisualizer = G22JavaObjectVisualizer(g22utils, result).withType(false);
scpShowCase.set(objVisualizer);
} catch print e {
scpShowCase.set(jErrorView(e));
}
}
IVarWithNotify varShowCasedScript() {
ret g22utils.projectActions().varShowCasedScript();
}
cachedVisualize {
var conceptsFile = g22utils.concepts().conceptsFile();
lblStats = rightAlignedLabel();
IVF1 fileListener = file -> {
if (sameFile(file, conceptsFile))
updateStats();
};
bindToComponent(lblStats, -> {
g22utils.onProjectFileChanged(fileListener);
updateStats();
}, -> g22utils.removeProjectFileChangedListener(fileListener));
storyView = new JSyntaxTextFileEditor(g22utils.projectStoryTextFile())
.uneditable(true);
storyView.adaptSyntaxTextArea = textArea ->
g22_adaptSyntaxTextAreaForHashRefs(textArea, g22utils);
addInFront(storyView.buttons(),
jImageButtonScaledToWidth(16, #1103068, "Edit", rThread {
//g22utils.projectActions.editProjectStory();
storyView.uneditable(false);
}));
g22utils.autoStarter().onDone(rstUpdateShowCase);
scpShowCase = singleComponentPanel(
varShowCasedScript()! == null ? null : jcenteredlabel("Waiting for auto-start to finish..."));
onChange(varShowCasedScript(), rstUpdateShowCase);
bindToComponent(scpShowCase, rstUpdateShowCase);
// LAYOUT
S title = "Project " + quote(g22utils.projectName()) + " Overview";
var showCaseSection = jCenteredSection("Showcase",
northAndCenterWithMargin(
withSideMargins(withLabel("Script:", bindComboBoxToVar(varShowCasedScript(),
swing(-> centerComboBox(new ConceptsComboBox<>(g22utils.concepts(), G22LeftArrowScript)
.allowNull(true)
.itemFilter(script -> classIs(G22LeftArrowScript, script) && script.isClearForAutoRun())
))))),
scpShowCase
));
ret withTopAndBottomMargin(jRaisedCenteredSection(title,
jvsplit_minZero(
jhsplit(0.75,
jCenteredSection("Project Story",
centerAndSouthWithMargin(
storyView,
centerAndEastWithMargin(lblStats, jFilePathButton(conceptsFile))
)),
northAndCenterWithMargin(
new G22AutoStartPanel(g22utils),
new G22VariablesPanel(g22utils).compactView(false)
)),
showCaseSection
) // end of jvsplit
));
}
}