Warning: session_start(): open(/var/lib/php/sessions/sess_sggtlveo1pl9p7vtdnd09gb553, 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
!7
concept Rule > ConceptWithGlobalID {
S input;
S output;
LS variables;
sS _fieldOrder = "globalID input output variables";
}
p { dbIndexing(Rule, 'globalID); }
html {
uri = dropSlashPrefix(uri);
if (eqic(uri, "admin")) {
try object checkWebAuthed(params);
ret new HCRUD(rawLink("admin"), new HCRUD_Concepts(Rule)) {
S renderValue(S field, O value) {
S html = super.renderValue(field, value);
if (eq(field, 'globalID))
ret ahref(rawLink(str(value)), html);
if (eq(field, 'variables))
ret htmlEncode_nlToBr(lines_rtrim((LS) value));
ret html;
}
}.renderPage(params);
}
if (empty(uri))
ret htitle_h1("Rules")
+ (webAuthed(params) ? p(ahref(rawLink("admin"), "Admin")) : "")
+ ul_noEncode(map(list(Rule), r -> ahref(rawLink(r.globalIDStr()), htmlEncode2(r.input + " => " + r.output))));
if (possibleGlobalID(uri)) {
Rule r = conceptWhere(Rule, globalID := GlobalID(uri));
if (r == null) ret subBot_serve404("Rule not found");
ret htitle_h1("Rule " + r.globalID)
+ htmlTable2(litorderedmap("Input" := r.input, "Output" := r.output));
}
ret subBot_serve404();
}