@scalio-cloud/ui 0.83.0 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -625,6 +625,12 @@ list. Test IDs: `agents-panel`, `agents-code-create`, `agents-code-value`, `agen
625
625
  `agent-role-<id>-<role>`, `agent-worker-state-<id>-<worker>`, `agent-worker-restart|stop|start-<id>-<worker>`,
626
626
  `agent-block-<id>`, `agent-remove-<id>`, `agents-tasks`.
627
627
 
628
+ Since 0.84.0 a saved agent setting stays in its field with the badge «gesendet, wird übernommen»
629
+ (`agent-setting-sent-<id>-<name>`) until the agent reports it in its next heartbeat; before, the field fell back to the
630
+ old value right after «Speichern» (Markus 2026-11-15). The script editor of `AgentScriptsPanel` is at least 60 % of the window high
631
+ (`scalio-textarea`; `.scalio-input` alone held it at one line). «Letzte Aufträge» of `AgentsPanel` is folded by
632
+ default (`agents-tasks-toggle`, the heading shows the number of tasks).
633
+
628
634
  Since 0.83.0 the update state of an agent names the build (`Aktualisiert auf 2.0.0rc6`), not the version of the
629
635
  offer, and `AgentScriptsPanel` opens the editor of a script in its own dialog (`PanelDialog`, also exported; test IDs
630
636
  `agent-script-detail` = the dialog, `agent-script-dialog-close`; Markus 2026-11-15).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.83.0",
3
+ "version": "0.84.0",
4
4
  "description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "private": false,
@@ -267,8 +267,8 @@ function AgentScriptsPanel(props) {
267
267
  h("input", { type: "radio", name: `agent-script-kind-${tid}`, checked: kind === k, disabled: busy || !canEdit, "data-testid": `agent-script-kind-${k}`,
268
268
  onChange: () => { setKind(k); fillEditor(d, k); } }),
269
269
  h("span", null, k === "hook" ? `${label}: ${d.hook}` : label)))));
270
- parts.push(h("textarea", { key: "text", className: "scalio-input", rows: 20, value: text, disabled: busy || !canEdit, spellCheck: false,
271
- "aria-label": L.content, "data-testid": "agent-script-content", style: { width: "100%", fontFamily: "var(--scalio-font-mono, monospace)" },
270
+ parts.push(h("textarea", { key: "text", className: "scalio-input scalio-textarea", rows: 20, value: text, disabled: busy || !canEdit, spellCheck: false,
271
+ "aria-label": L.content, "data-testid": "agent-script-content", style: { width: "100%", minHeight: "60vh", fontFamily: "var(--scalio-font-mono, monospace)" },
272
272
  onChange: (e) => setText(e.target.value) }));
273
273
  if (kind === "full") parts.push(h(DiffView, { key: "d", from: d.standard.content, to: text, testId: "agent-script-diff-edit" }));
274
274
  parts.push(h("div", { key: "save", style: { display: "flex", gap: "0.5rem", flexWrap: "wrap", alignItems: "center" } },
package/react/agents.js CHANGED
@@ -101,6 +101,7 @@ const LABELS = {
101
101
  setNoGate: "Schalter mit Schreibrechten (z. B. Ein/Aus, neue Desktops, GPOs) wirken erst, wenn ein Administrator auf dem Server die Freigabe gesetzt hat: Häkchen «Schreibrechte aus der App erlauben» bei der Installation oder RemoteWrite = 1 in HKLM\\SOFTWARE\\Scalio\\Agent.",
102
102
  setLocal: "lokal gesetzt, gilt vor der App",
103
103
  setPending: "wartet auf die Freigabe beim Kunden",
104
+ setSent: "gesendet, wird übernommen",
104
105
  setFromApp: "aus der App",
105
106
  setNotSet: "nicht gesetzt",
106
107
  setOn: "Ein",
@@ -202,6 +203,7 @@ const LABELS = {
202
203
  setNoGate: "Switches that allow writing (e.g. power, new desktops, GPOs) only take effect once an administrator has allowed it on the server: the checkbox «Allow write permissions from the app» at install, or RemoteWrite = 1 in HKLM\\SOFTWARE\\Scalio\\Agent.",
203
204
  setLocal: "set locally, wins over the app",
204
205
  setPending: "waits for the customer's approval",
206
+ setSent: "sent, being applied",
205
207
  setFromApp: "from the app",
206
208
  setNotSet: "not set",
207
209
  setOn: "On",
@@ -293,6 +295,7 @@ function AgentSettings(props) {
293
295
  const { agent: a, L, lang, busy } = props;
294
296
  const s = a.settings;
295
297
  const [edit, setEdit] = React.useState({});
298
+ const [sent, setSent] = React.useState({}); // saved values the agent has not reported yet (Markus 2026-11-15)
296
299
  const [secrets, setSecrets] = React.useState({});
297
300
  const [tab, setTab] = React.useState(null);
298
301
  if (!s) return h("p", { className: "scalio-settings-text", "data-testid": `agent-settings-none-${a.id}` }, L.setNone);
@@ -301,7 +304,11 @@ function AgentSettings(props) {
301
304
  const label = (d) => (d.label && (d.label[lang === "en" ? "en" : "de"] || d.label.de)) || d.name;
302
305
  const hasGate = (s.catalog || []).some((d) => d.gate);
303
306
  const current = (d) => (values[d.name] && values[d.name].source === "app" ? shownValue(d, values[d.name]) : "");
304
- const valueOf = (d) => (Object.prototype.hasOwnProperty.call(edit, d.name) ? edit[d.name] : (values[d.name] && values[d.name].source === "local" ? shownValue(d, values[d.name]) : current(d)));
307
+ const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
308
+ const waiting = (d) => has(sent, d.name) && sent[d.name] !== current(d) && !(values[d.name] && values[d.name].source === "local");
309
+ const valueOf = (d) => (has(edit, d.name) ? edit[d.name]
310
+ : values[d.name] && values[d.name].source === "local" ? shownValue(d, values[d.name])
311
+ : waiting(d) ? sent[d.name] : current(d));
305
312
  const set = (d, v) => setEdit(Object.assign({}, edit, { [d.name]: v }));
306
313
 
307
314
  const change = () => {
@@ -313,9 +320,9 @@ function AgentSettings(props) {
313
320
  else if (secrets[d.name]) sec[d.name] = secrets[d.name];
314
321
  return;
315
322
  }
316
- if (!Object.prototype.hasOwnProperty.call(edit, d.name)) return;
323
+ if (!has(edit, d.name)) return;
317
324
  const v = edit[d.name];
318
- if (v === current(d)) return;
325
+ if (v === (waiting(d) ? sent[d.name] : current(d))) return;
319
326
  if (v === "") out[d.name] = null;
320
327
  else if (d.kind === "bool") out[d.name] = v === "1";
321
328
  else if (d.kind === "number") out[d.name] = Number(v);
@@ -330,7 +337,14 @@ function AgentSettings(props) {
330
337
  const body = change();
331
338
  if (!body.values && !body.secrets) { if (props.notify) props.notify(L.setNothing, "info"); return; }
332
339
  const res = await props.run(() => props.client.setSettings(a.id, body), L.sent);
333
- if (res) { setEdit({}); setSecrets({}); }
340
+ if (res) {
341
+ const done = {};
342
+ Object.keys(sent).forEach((k) => { const d = (s.catalog || []).find((x) => x.name === k); if (d && waiting(d)) done[k] = sent[k]; });
343
+ Object.keys(body.values || {}).forEach((k) => { done[k] = edit[k]; });
344
+ setSent(done);
345
+ setEdit({});
346
+ setSecrets({});
347
+ }
334
348
  };
335
349
 
336
350
  const input = (d) => {
@@ -364,6 +378,7 @@ function AgentSettings(props) {
364
378
  const note = (d) => {
365
379
  const v = values[d.name] || {};
366
380
  if (v.source === "local") return h(StatusBadge, { tone: "neutral", testId: `agent-setting-local-${a.id}-${d.name}` }, L.setLocal);
381
+ if (waiting(d)) return h(StatusBadge, { tone: "running", testId: `agent-setting-sent-${a.id}-${d.name}` }, L.setSent);
367
382
  if (v.pending) return h(StatusBadge, { tone: "warn", testId: `agent-setting-pending-${a.id}-${d.name}` }, L.setPending);
368
383
  return null;
369
384
  };
@@ -435,6 +450,7 @@ function AgentsPanel(props) {
435
450
  const [open, setOpen] = React.useState(null); // agent whose settings are open
436
451
  const [adding, setAdding] = React.useState(false); // dialog «Agent hinzufügen»
437
452
  const [onlyErrors, setOnlyErrors] = React.useState(false);
453
+ const [tasksOpen, setTasksOpen] = React.useState(false); // «Letzte Aufträge» folded by default (Markus 2026-11-15)
438
454
 
439
455
  const load = React.useCallback(async () => {
440
456
  try {
@@ -694,11 +710,17 @@ function AgentsPanel(props) {
694
710
  const shownTasks = onlyErrors ? tasks.filter((t) => t.status === "error") : tasks;
695
711
  rows.push(h("div", { key: "tasks", className: "scalio-agents-block" },
696
712
  h("div", { style: { display: "flex", gap: "1rem", alignItems: "center", flexWrap: "wrap" } },
697
- label(L.tasks),
698
- tasks.length ? h("label", { className: "scalio-settings-check" },
713
+ h("button", { type: "button", className: "scalio-agents-fold", "aria-expanded": tasksOpen, "data-testid": "agents-tasks-toggle",
714
+ style: { display: "inline-flex", alignItems: "center", gap: "0.4rem", background: "none", border: 0, padding: 0, cursor: "pointer", color: "inherit" },
715
+ onClick: () => setTasksOpen(!tasksOpen) },
716
+ h(Icons.ChevronDown, { className: "scalio-icon", "aria-hidden": "true",
717
+ style: { transform: tasksOpen ? "none" : "rotate(-90deg)", transition: "transform 0.15s" } }),
718
+ label(tasks.length ? `${L.tasks} (${tasks.length})` : L.tasks)),
719
+ tasksOpen && tasks.length ? h("label", { className: "scalio-settings-check" },
699
720
  h("input", { type: "checkbox", checked: onlyErrors, "data-testid": "agents-tasks-errors", onChange: () => setOnlyErrors(!onlyErrors) }),
700
721
  h("span", null, L.onlyErrors)) : null),
701
- tasks.length === 0 ? h("p", { className: "scalio-settings-text", "data-testid": "agents-no-tasks" }, L.noTasks)
722
+ !tasksOpen ? null
723
+ : tasks.length === 0 ? h("p", { className: "scalio-settings-text", "data-testid": "agents-no-tasks" }, L.noTasks)
702
724
  : shownTasks.length === 0 ? h("p", { className: "scalio-settings-text", "data-testid": "agents-no-errors" }, L.noErrors)
703
725
  : h("div", { className: "scalio-agents-scroll" },
704
726
  h("table", { className: "scalio-users-table scalio-agents-table", "data-testid": "agents-tasks" },