@scalio-cloud/ui 0.81.0 → 0.83.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,18 @@ 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.83.0 the update state of an agent names the build (`Aktualisiert auf 2.0.0rc6`), not the version of the
629
+ offer, and `AgentScriptsPanel` opens the editor of a script in its own dialog (`PanelDialog`, also exported; test IDs
630
+ `agent-script-detail` = the dialog, `agent-script-dialog-close`; Markus 2026-11-15).
631
+
632
+ Since 0.82.0 (layout A, Markus 2026-11-15) the block is one column over the whole width, without the label column of
633
+ `SettingsSection`: a head with title, hint, «Agent herunterladen (MSI)» and «Agent hinzufügen» (a dialog with roles,
634
+ note and the one-time code), the open codes and the update rule each in one line, the agents with roles and worker
635
+ states in one column, and the last tasks with the filter «nur Fehler». The update line names the build the app brings
636
+ (`2.0.0rc4`), not only the release. Put it straight into the page: do not wrap it in a section with its own label
637
+ column. The props stay the same. New test IDs: `agents-add`, `agents-add-dialog`, `agents-add-close`,
638
+ `agents-tasks-errors`, `agents-no-errors`.
639
+
628
640
  Since 0.64.0 (self-update U2, scalio-platform 0.39.0) the block also shows the agent version bundled in the app, the
629
641
  update rule of the instance (automatic, maintenance window with days and times, or only on request; `GET|PUT
630
642
  /update[/policy]`) and per agent the update state reported by the agent (updating, updated, rolled back with reason,
package/nav.css CHANGED
@@ -471,6 +471,16 @@
471
471
  .scalio-agent-worker { display: flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap; white-space: nowrap; }
472
472
  .scalio-agent-worker + .scalio-agent-worker { margin-top: 0.25rem; }
473
473
  .scalio-agent-roles { display: flex; flex-direction: column; gap: 0.125rem; white-space: nowrap; }
474
+ /* AgentsPanel layout A (0.82.0, Markus 2026-11-15): one column over the whole width, no label column */
475
+ .scalio-agents { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
476
+ .scalio-agents-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; }
477
+ .scalio-agents-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
478
+ .scalio-agents-strip { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.625rem 1rem;
479
+ background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border)); font-size: 0.875rem; }
480
+ .scalio-agents-codes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
481
+ .scalio-agents-block { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
482
+ .scalio-agents-scroll { overflow-x: auto; border: 1px solid hsl(var(--border)); }
483
+ .scalio-agents-scroll .scalio-users-table { width: 100%; }
474
484
  .scalio-users-table tr.is-pending { background: rgb(217 119 6 / 0.05); }
475
485
  .scalio-users-table tr.is-locked .scalio-users-who { opacity: 0.6; }
476
486
  .scalio-users-hide-sm, .scalio-users-hide-md { display: none; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.81.0",
3
+ "version": "0.83.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,
@@ -12,6 +12,7 @@ const Icons = require("./icons");
12
12
  const { StatusBadge } = require("./blocks");
13
13
  const { SettingsSection, SettingsField: Field } = require("./settings");
14
14
  const { askConfirm } = require("./dialog");
15
+ const { PanelDialog } = require("./agents");
15
16
 
16
17
  const LABELS = {
17
18
  de: {
@@ -266,7 +267,7 @@ function AgentScriptsPanel(props) {
266
267
  h("input", { type: "radio", name: `agent-script-kind-${tid}`, checked: kind === k, disabled: busy || !canEdit, "data-testid": `agent-script-kind-${k}`,
267
268
  onChange: () => { setKind(k); fillEditor(d, k); } }),
268
269
  h("span", null, k === "hook" ? `${label}: ${d.hook}` : label)))));
269
- parts.push(h("textarea", { key: "text", className: "scalio-input", rows: 16, value: text, disabled: busy || !canEdit, spellCheck: false,
270
+ parts.push(h("textarea", { key: "text", className: "scalio-input", rows: 20, value: text, disabled: busy || !canEdit, spellCheck: false,
270
271
  "aria-label": L.content, "data-testid": "agent-script-content", style: { width: "100%", fontFamily: "var(--scalio-font-mono, monospace)" },
271
272
  onChange: (e) => setText(e.target.value) }));
272
273
  if (kind === "full") parts.push(h(DiffView, { key: "d", from: d.standard.content, to: text, testId: "agent-script-diff-edit" }));
@@ -284,7 +285,9 @@ function AgentScriptsPanel(props) {
284
285
  (d.versions || []).length === 0 ? h("p", { className: "scalio-settings-text" }, L.noHistory)
285
286
  : h("ul", { className: "scalio-settings-text" }, d.versions.map((v) => h("li", { key: v.number },
286
287
  `${v.number} · ${v.kind === "hook" ? "Hook" : "Script"} · ${fill(L.by, { by: v.by })} · ${v.reason || ""}${v.status === "pending" ? ` · ${L.states.pending}` : ""}`)))));
287
- rows.push(h(Field, { key: "detail", label: `${d.worker} / ${d.name}`, testId: "agent-script-detail" },
288
+ // Markus 2026-11-15: the editor opens in its own dialog, not below the table
289
+ rows.push(h(PanelDialog, { key: "detail", title: `${d.worker} / ${d.name}`, L: { setClose: L.close }, onClose: () => setOpen(null),
290
+ testId: "agent-script-detail", closeTestId: "agent-script-dialog-close", maxWidth: "64rem" },
288
291
  h("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" } }, parts)));
289
292
  }
290
293
 
package/react/agents.js CHANGED
@@ -16,7 +16,6 @@ function shortVersion(v) {
16
16
  return String(v || "").split("+")[0];
17
17
  }
18
18
  const { StatusBadge } = require("./blocks");
19
- const { SettingsSection, SettingsField: Field } = require("./settings");
20
19
  const { askConfirm } = require("./dialog");
21
20
 
22
21
  const LABELS = {
@@ -25,6 +24,12 @@ const LABELS = {
25
24
  hint: "Der Scalio Agent läuft als Windows-Dienst in Ihrem Netz und erledigt Aufgaben, die nur dort gehen (z. B. Active Directory). Er baut nur ausgehende Verbindungen auf. Sie können ihn auf mehreren Servern installieren und pro Server die Rollen wählen.",
26
25
  download: "Agent herunterladen (MSI)",
27
26
  newCode: "Registrierungscode erzeugen",
27
+ add: "Agent hinzufügen",
28
+ addHint: "Erzeugen Sie einen Einmal-Code und installieren Sie damit das MSI auf dem Server. Der Code gilt einmal und ist nur jetzt sichtbar.",
29
+ rolesWorkers: "Rollen und Worker",
30
+ onlyErrors: "nur Fehler",
31
+ noErrors: "Keine Fehler.",
32
+ updShort: "Updates",
28
33
  codeRoles: "Rollen für den neuen Agent",
29
34
  codeNote: "Notiz (z. B. Servername)",
30
35
  codeTitle: "Registrierungscode",
@@ -120,6 +125,12 @@ const LABELS = {
120
125
  hint: "The Scalio Agent runs as a Windows service in your network and does work that is only possible there (e.g. Active Directory). It only opens outgoing connections. You can install it on several servers and choose the roles per server.",
121
126
  download: "Download the agent (MSI)",
122
127
  newCode: "Create enrollment code",
128
+ add: "Add agent",
129
+ addHint: "Create a one-time code and install the MSI with it on the server. The code works once and is only shown now.",
130
+ rolesWorkers: "Roles and workers",
131
+ onlyErrors: "errors only",
132
+ noErrors: "No errors.",
133
+ updShort: "Updates",
123
134
  codeRoles: "Roles of the new agent",
124
135
  codeNote: "Note (e.g. server name)",
125
136
  codeTitle: "Enrollment code",
@@ -385,23 +396,23 @@ function AgentSettings(props) {
385
396
  a.settings_sent_at ? h("span", { className: "scalio-settings-text" }, fill(L.setSentAt, { at: when(a.settings_sent_at, lang) })) : null));
386
397
  }
387
398
 
388
- // The settings of one agent as a dialog (Markus 2026-11-14): closes with its button, the backdrop and Escape.
389
- function SettingsDialog(props) {
390
- const { agent: a, L, onClose } = props;
399
+ // A dialog of the panel (settings of one agent, Markus 2026-11-14; «Agent hinzufügen», layout A 2026-11-15):
400
+ // closes with its button, the backdrop and Escape.
401
+ function PanelDialog(props) {
402
+ const { title, onClose, L } = props;
391
403
  React.useEffect(() => {
392
404
  const key = (e) => { if (e.key === "Escape") onClose(); };
393
405
  document.addEventListener("keydown", key);
394
406
  return () => document.removeEventListener("keydown", key);
395
407
  }, [onClose]);
396
- const title = fill(L.setTitle, { name: a.name || a.hostname || a.id });
397
408
  return h("div", { className: "scalio-dialog-root" },
398
409
  h("div", { className: "scalio-dialog-backdrop", onClick: onClose }),
399
- h("div", { className: "scalio-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, style: { maxWidth: "52rem" },
400
- "data-testid": `agent-settings-dialog-${a.id}` },
410
+ h("div", { className: "scalio-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, style: { maxWidth: props.maxWidth || "52rem" },
411
+ "data-testid": props.testId },
401
412
  h("div", { className: "scalio-dialog-head" },
402
413
  h("div", { className: "scalio-dialog-title" }, title),
403
414
  h("button", { type: "button", className: "scalio-btn is-ghost scalio-btn-icon", onClick: onClose, "aria-label": L.setClose,
404
- title: L.setClose, "data-testid": `agent-settings-close-${a.id}` }, h(Icons.X, { className: "scalio-icon" }))),
415
+ title: L.setClose, "data-testid": props.closeTestId }, h(Icons.X, { className: "scalio-icon" }))),
405
416
  h("div", { className: "scalio-dialog-body" }, props.children)));
406
417
  }
407
418
 
@@ -422,6 +433,8 @@ function AgentsPanel(props) {
422
433
  const [upd, setUpd] = React.useState(null); // GET /update; stays null with an older backend
423
434
  const [policy, setPolicy] = React.useState(null); // the rule being edited
424
435
  const [open, setOpen] = React.useState(null); // agent whose settings are open
436
+ const [adding, setAdding] = React.useState(false); // dialog «Agent hinzufügen»
437
+ const [onlyErrors, setOnlyErrors] = React.useState(false);
425
438
 
426
439
  const load = React.useCallback(async () => {
427
440
  try {
@@ -487,63 +500,78 @@ function AgentsPanel(props) {
487
500
  };
488
501
  const appUrl = props.appUrl || (typeof window !== "undefined" ? window.location.origin : "");
489
502
 
503
+ // Layout A (Markus 2026-11-15): one column over the whole width, no label column. Head with the buttons, the update
504
+ // rule in one line, the agents, the last tasks; enrollment codes in the dialog «Agent hinzufügen».
490
505
  const rows = [];
491
- rows.push(h("div", { key: "acts", className: "scalio-settings-section-footer", style: { justifyContent: "flex-start", flexWrap: "wrap", gap: "0.5rem" } },
492
- props.downloadUrl ? h("a", { className: "scalio-btn", href: props.downloadUrl, "data-testid": "agents-download" },
493
- h(Icons.Download, { className: "scalio-icon" }), L.download) : null));
494
-
495
- // new code
496
- rows.push(h(Field, { key: "code", label: L.newCode, testId: "agents-new-code" },
497
- offered.length > 1 ? h("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.75rem" } },
498
- h("span", { className: "scalio-settings-text" }, `${L.codeRoles}:`),
499
- offered.map((r) => h("label", { key: r.name, className: "scalio-settings-check" },
500
- h("input", { type: "checkbox", checked: selectedRoles.includes(r.name), disabled: busy, "data-testid": `agents-code-role-${r.name}`,
501
- onChange: () => setCodeRoles(selectedRoles.includes(r.name) ? selectedRoles.filter((x) => x !== r.name) : selectedRoles.concat([r.name])) }),
502
- h("span", null, r.label || r.name)))) : null,
503
- h("div", { style: { display: "flex", gap: "0.5rem", marginTop: "0.5rem", flexWrap: "wrap" } },
504
- h("input", { className: "scalio-input", placeholder: L.codeNote, "aria-label": L.codeNote, value: note, maxLength: 200, disabled: busy,
505
- "data-testid": "agents-code-note", onChange: (e) => setNote(e.target.value) }),
506
- h("button", { type: "button", className: "scalio-btn is-solid", disabled: busy, "data-testid": "agents-code-create", onClick: createCode },
507
- h(Icons.KeyRound, { className: "scalio-icon" }), L.newCode))));
508
-
509
- if (shown) {
510
- const cmd = installCommand(appUrl, shown.code);
511
- rows.push(h("div", { key: "shown", className: "scalio-notice is-info", role: "status", "data-testid": "agents-code-shown" },
512
- h("div", { className: "scalio-notice-body" },
513
- h("div", { className: "scalio-notice-title" }, L.codeTitle),
514
- h("div", { className: "scalio-notice-text" },
515
- h("code", { "data-testid": "agents-code-value", style: { fontSize: "1.1em" } }, shown.code), " ",
516
- h("button", { type: "button", className: "scalio-btn is-ghost", "data-testid": "agents-code-copy", onClick: () => copy(shown.code) },
517
- h(Icons.Copy, { className: "scalio-icon" }), L.copy),
518
- h("div", null, L.codeOnce),
519
- h("div", { style: { marginTop: "0.5rem" } }, `${L.codeCommand}:`),
520
- h("pre", { style: { whiteSpace: "pre-wrap", wordBreak: "break-all" }, "data-testid": "agents-code-command" }, cmd),
521
- h("button", { type: "button", className: "scalio-btn is-ghost", "data-testid": "agents-code-command-copy", onClick: () => copy(cmd) },
522
- h(Icons.Copy, { className: "scalio-icon" }), L.copy),
523
- h("button", { type: "button", className: "scalio-btn", "data-testid": "agents-code-close", onClick: () => setShown(null) }, L.close)))));
524
- }
506
+ const label = (text) => h("h3", { className: "scalio-field-label", style: { margin: 0 } }, text);
507
+ rows.push(h("div", { key: "head", className: "scalio-agents-head" },
508
+ h("div", { style: { minWidth: 0, flex: "1 1 20rem" } },
509
+ h("h2", { className: "scalio-profile-section-title", style: { margin: 0 } }, L.title),
510
+ h("p", { className: "scalio-profile-section-desc" }, L.hint)),
511
+ h("div", { className: "scalio-agents-buttons" },
512
+ props.downloadUrl ? h("a", { className: "scalio-btn", href: props.downloadUrl, "data-testid": "agents-download" },
513
+ h(Icons.Download, { className: "scalio-icon" }), L.download) : null,
514
+ h("button", { type: "button", className: "scalio-btn is-solid", disabled: busy, "data-testid": "agents-add", onClick: () => setAdding(true) },
515
+ h(Icons.Plus, { className: "scalio-icon" }), L.add))));
525
516
 
526
517
  if (codes.length) {
527
- rows.push(h(Field, { key: "codes", label: L.openCodes },
528
- h("ul", { className: "scalio-settings-text", "data-testid": "agents-codes" },
518
+ rows.push(h("div", { key: "codes", className: "scalio-agents-strip" },
519
+ h("span", { style: { fontWeight: 600 } }, L.openCodes),
520
+ h("ul", { className: "scalio-settings-text scalio-agents-codes", "data-testid": "agents-codes" },
529
521
  codes.map((c) => h("li", { key: c.id, "data-testid": `agents-code-${c.id}` },
530
522
  [c.note, (c.roles || []).join(", "), fill(L.codeExpires, { at: when(c.expires_at, props.lang) })].filter(Boolean).join(" · "), " ",
531
523
  h("button", { type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agents-code-revoke-${c.id}`,
532
524
  onClick: () => run(() => props.client.revokeCode(c.id)) }, L.revoke))))));
533
525
  }
534
526
 
535
- // self-update rule (U2)
527
+ // «Agent hinzufügen»: roles, note, code; the code and the install command appear once in the same dialog
528
+ if (adding) {
529
+ const closeAdd = () => { setAdding(false); setShown(null); };
530
+ const cmd = shown ? installCommand(appUrl, shown.code) : "";
531
+ rows.push(h(PanelDialog, { key: "add", title: L.add, L, onClose: closeAdd, testId: "agents-add-dialog", closeTestId: "agents-add-close", maxWidth: "40rem" },
532
+ h("div", { style: { display: "grid", gap: "0.75rem" }, "data-testid": "agents-new-code" },
533
+ h("p", { className: "scalio-settings-text", style: { margin: 0 } }, L.addHint),
534
+ props.downloadUrl ? h("a", { className: "scalio-btn", href: props.downloadUrl, style: { justifySelf: "start" } },
535
+ h(Icons.Download, { className: "scalio-icon" }), L.download) : null,
536
+ offered.length > 1 ? h("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.75rem" } },
537
+ h("span", { className: "scalio-settings-text" }, `${L.codeRoles}:`),
538
+ offered.map((r) => h("label", { key: r.name, className: "scalio-settings-check" },
539
+ h("input", { type: "checkbox", checked: selectedRoles.includes(r.name), disabled: busy || !!shown, "data-testid": `agents-code-role-${r.name}`,
540
+ onChange: () => setCodeRoles(selectedRoles.includes(r.name) ? selectedRoles.filter((x) => x !== r.name) : selectedRoles.concat([r.name])) }),
541
+ h("span", null, r.label || r.name)))) : null,
542
+ shown ? null : h("div", { style: { display: "flex", gap: "0.5rem", flexWrap: "wrap" } },
543
+ h("input", { className: "scalio-input", placeholder: L.codeNote, "aria-label": L.codeNote, value: note, maxLength: 200, disabled: busy,
544
+ style: { flex: "1 1 14rem" }, "data-testid": "agents-code-note", onChange: (e) => setNote(e.target.value) }),
545
+ h("button", { type: "button", className: "scalio-btn is-solid", disabled: busy, "data-testid": "agents-code-create", onClick: createCode },
546
+ h(Icons.KeyRound, { className: "scalio-icon" }), L.newCode)),
547
+ shown ? h("div", { className: "scalio-notice is-info", role: "status", "data-testid": "agents-code-shown" },
548
+ h("div", { className: "scalio-notice-body" },
549
+ h("div", { className: "scalio-notice-title" }, L.codeTitle),
550
+ h("div", { className: "scalio-notice-text" },
551
+ h("code", { "data-testid": "agents-code-value", style: { fontSize: "1.1em" } }, shown.code), " ",
552
+ h("button", { type: "button", className: "scalio-btn is-ghost", "data-testid": "agents-code-copy", onClick: () => copy(shown.code) },
553
+ h(Icons.Copy, { className: "scalio-icon" }), L.copy),
554
+ h("div", null, L.codeOnce),
555
+ h("div", { style: { marginTop: "0.5rem" } }, `${L.codeCommand}:`),
556
+ h("pre", { style: { whiteSpace: "pre-wrap", wordBreak: "break-all" }, "data-testid": "agents-code-command" }, cmd),
557
+ h("button", { type: "button", className: "scalio-btn is-ghost", "data-testid": "agents-code-command-copy", onClick: () => copy(cmd) },
558
+ h(Icons.Copy, { className: "scalio-icon" }), L.copy),
559
+ h("button", { type: "button", className: "scalio-btn", "data-testid": "agents-code-close", onClick: closeAdd }, L.close)))) : null)));
560
+ }
561
+
562
+ // self-update rule (U2): one line
536
563
  if (upd && policy) {
537
564
  const win = policy.window || { days: [], start: "22:00", end: "04:00" };
538
565
  const setWin = (k, v) => setPolicy(Object.assign({}, policy, { window: Object.assign({}, win, { [k]: v }) }));
539
566
  const days = win.days || [];
540
- rows.push(h(Field, { key: "update", label: L.updTitle, testId: "agents-update" },
541
- h("p", { className: "scalio-settings-text", "data-testid": "agents-update-available" },
542
- upd.available ? fill(L.updAvailable, { version: upd.available.version }) : L.updNone),
543
- upd.minimum_version ? h("p", { className: "scalio-settings-text", "data-testid": "agents-update-minimum" }, fill(L.updMinimum, { version: upd.minimum_version })) : null,
544
- h("div", { style: { display: "flex", gap: "0.5rem", flexWrap: "wrap", alignItems: "center", marginTop: "0.5rem" } },
567
+ rows.push(h("div", { key: "update", className: "scalio-agents-strip", "data-testid": "agents-update" },
568
+ h("span", { style: { fontWeight: 600 } }, L.updShort),
569
+ h("span", { className: "scalio-settings-text", "data-testid": "agents-update-available" },
570
+ upd.available ? fill(L.updAvailable, { version: upd.available.build || upd.available.version }) : L.updNone),
571
+ upd.minimum_version ? h("span", { className: "scalio-settings-text", "data-testid": "agents-update-minimum" }, fill(L.updMinimum, { version: upd.minimum_version })) : null,
572
+ h("span", { style: { display: "flex", gap: "0.5rem", flexWrap: "wrap", alignItems: "center", marginLeft: "auto" } },
545
573
  h("select", { className: "scalio-input", value: policy.mode, "aria-label": L.updMode, disabled: busy, "data-testid": "agents-update-mode",
546
- onChange: (e) => setPolicy(Object.assign({}, policy, { mode: e.target.value })) },
574
+ style: { width: "auto" }, onChange: (e) => setPolicy(Object.assign({}, policy, { mode: e.target.value })) },
547
575
  ["auto", "window", "manual"].map((m) => h("option", { key: m, value: m }, L.updModes[m]))),
548
576
  policy.mode === "window" ? [
549
577
  h("span", { key: "d", style: { display: "flex", gap: "0.5rem", flexWrap: "wrap" } }, `${L.updDays}:`,
@@ -552,9 +580,9 @@ function AgentsPanel(props) {
552
580
  onChange: () => setWin("days", days.includes(i) ? days.filter((x) => x !== i) : days.concat([i]).sort()) }),
553
581
  h("span", null, d)))),
554
582
  h("label", { key: "s" }, L.updFrom, " ", h("input", { type: "time", className: "scalio-input", value: win.start, disabled: busy,
555
- "data-testid": "agents-update-start", onChange: (e) => setWin("start", e.target.value) })),
583
+ style: { width: "auto" }, "data-testid": "agents-update-start", onChange: (e) => setWin("start", e.target.value) })),
556
584
  h("label", { key: "e" }, L.updTo, " ", h("input", { type: "time", className: "scalio-input", value: win.end, disabled: busy,
557
- "data-testid": "agents-update-end", onChange: (e) => setWin("end", e.target.value) })),
585
+ style: { width: "auto" }, "data-testid": "agents-update-end", onChange: (e) => setWin("end", e.target.value) })),
558
586
  ] : null,
559
587
  h("button", { type: "button", className: "scalio-btn", disabled: busy, "data-testid": "agents-update-save",
560
588
  onClick: async () => { const res = await run(() => props.client.setPolicy(policy), L.saved); if (res) setPolicy(res); } }, L.updSave))));
@@ -568,7 +596,12 @@ function AgentsPanel(props) {
568
596
  const u = a.update;
569
597
  const out = [];
570
598
  if (u && u.state) {
571
- const text = fill((L.updStates || {})[u.state] || u.state, { version: u.version, from: u.from_version || a.version, reason: u.reason || "–" });
599
+ // The agent reports the version of the offer (2.0.0); show the build (2.0.0rc6): the running one after
600
+ // «installed», else the build of the bundle with that version (live test 2026-11-15).
601
+ const running = String(a.version || "").split("+")[0];
602
+ const bundled = upd && upd.available && upd.available.version === u.version && upd.available.build;
603
+ const shown = u.state === "installed" && running.startsWith(u.version || "\u0000") ? running : (bundled || u.version);
604
+ const text = fill((L.updStates || {})[u.state] || u.state, { version: shown, from: String(u.from_version || a.version || "").split("+")[0], reason: u.reason || "–" });
572
605
  out.push(h("div", { key: "s" }, h(StatusBadge, { tone: UPDATE_TONE[u.state] || "neutral", testId: `agent-update-state-${a.id}` }, text)));
573
606
  }
574
607
  if (a.scripts) {
@@ -602,31 +635,35 @@ function AgentsPanel(props) {
602
635
  h("td", null, h("div", { className: "font-medium" }, a.name || a.hostname),
603
636
  host ? h("div", { className: "scalio-settings-text" }, host) : null,
604
637
  a.os ? h("div", { className: "scalio-settings-text" }, a.os) : null),
605
- h("td", null, h("span", { title: a.version || "", "data-testid": `agent-version-${a.id}` }, shortVersion(a.version) || "–"), updateCell(a)),
606
638
  h("td", null, h(StatusBadge, { tone: st === "online" ? "ok" : st === "blocked" ? "error" : "warn", testId: `agent-status-${a.id}` }, L[st]),
607
639
  h("div", { className: "scalio-settings-text" }, a.last_seen ? when(a.last_seen, props.lang) : L.never)),
608
- h("td", null, h("div", { className: "scalio-agent-roles" }, offered.map((r) => h("label", { key: r.name, className: "scalio-settings-check", title: can.has(r.name) ? "" : L.notOnHost },
609
- h("input", { type: "checkbox", checked: (a.roles || []).includes(r.name), disabled: busy || a.blocked, "data-testid": `agent-role-${a.id}-${r.name}`,
610
- onChange: () => setRoles(a, (a.roles || []).includes(r.name) ? a.roles.filter((x) => x !== r.name) : (a.roles || []).concat([r.name])) }),
611
- h("span", null, r.label || r.name, can.has(r.name) ? "" : " ⚠"))))),
612
- h("td", null, (a.roles || []).map((name) => {
613
- const w = states[name] || { name, state: can.has(name) ? "starting" : "unavailable" };
614
- const stopped = w.state === "stopped" || w.state === "disabled";
615
- return h("div", { key: name, className: "scalio-agent-worker", "data-testid": `agent-worker-${a.id}-${name}` },
616
- h("span", null, roleLabel(name)),
617
- h(StatusBadge, { tone: STATE_TONE[w.state] || "neutral", testId: `agent-worker-state-${a.id}-${name}` }, (L.states || {})[w.state] || w.state),
618
- w.restarts ? h("span", { className: "scalio-settings-text" }, fill(L.restarts, { n: w.restarts })) : null,
619
- w.last_error ? h("span", { className: "scalio-settings-text", title: w.last_error }, h(Icons.Alert, { className: "scalio-icon" })) : null,
620
- a.online && can.has(name) ? [
621
- iconBtn(Icons.RotateCcw, L.restart, { key: "r", disabled: busy, "data-testid": `agent-worker-restart-${a.id}-${name}`,
622
- onClick: () => run(() => props.client.control(a.id, name, "restart"), L.sent) }),
623
- stopped
624
- ? iconBtn(Icons.Play, L.start, { key: "s", disabled: busy, "data-testid": `agent-worker-start-${a.id}-${name}`,
625
- onClick: () => run(() => props.client.control(a.id, name, "start"), L.sent) })
626
- : iconBtn(Icons.Square, L.stop, { key: "s", disabled: busy, "data-testid": `agent-worker-stop-${a.id}-${name}`,
627
- onClick: () => confirmThen(fill(L.stopConfirm, { worker: roleLabel(name), name: a.name }), L.stop, () => props.client.control(a.id, name, "stop"), L.sent) }),
628
- ] : null);
629
- })),
640
+ h("td", null, h("span", { title: a.version || "", "data-testid": `agent-version-${a.id}` }, shortVersion(a.version) || "–"), updateCell(a)),
641
+ // roles and workers in one column (layout A): one line per role the app offers, the worker state next to it
642
+ h("td", null, h("div", { className: "scalio-agent-roles" }, offered.concat((a.roles || []).filter((n) => !offered.some((r) => r.name === n)).map((n) => ({ name: n })))
643
+ .map((r) => {
644
+ const on = (a.roles || []).includes(r.name);
645
+ const w = on ? (states[r.name] || { name: r.name, state: can.has(r.name) ? "starting" : "unavailable" }) : null;
646
+ const stopped = w && (w.state === "stopped" || w.state === "disabled");
647
+ return h("div", { key: r.name, className: "scalio-agent-worker", "data-testid": on ? `agent-worker-${a.id}-${r.name}` : undefined },
648
+ h("label", { className: "scalio-settings-check", title: can.has(r.name) ? "" : L.notOnHost },
649
+ h("input", { type: "checkbox", checked: on, disabled: busy || a.blocked, "data-testid": `agent-role-${a.id}-${r.name}`,
650
+ onChange: () => setRoles(a, on ? a.roles.filter((x) => x !== r.name) : (a.roles || []).concat([r.name])) }),
651
+ h("span", null, r.label || roleLabel(r.name), can.has(r.name) ? "" : " ⚠")),
652
+ w ? [
653
+ h(StatusBadge, { key: "st", tone: STATE_TONE[w.state] || "neutral", testId: `agent-worker-state-${a.id}-${r.name}` }, (L.states || {})[w.state] || w.state),
654
+ w.restarts ? h("span", { key: "n", className: "scalio-settings-text" }, fill(L.restarts, { n: w.restarts })) : null,
655
+ w.last_error ? h("span", { key: "e", className: "scalio-settings-text", title: w.last_error }, h(Icons.Alert, { className: "scalio-icon" })) : null,
656
+ a.online && can.has(r.name) ? [
657
+ iconBtn(Icons.RotateCcw, L.restart, { key: "r", disabled: busy, "data-testid": `agent-worker-restart-${a.id}-${r.name}`,
658
+ onClick: () => run(() => props.client.control(a.id, r.name, "restart"), L.sent) }),
659
+ stopped
660
+ ? iconBtn(Icons.Play, L.start, { key: "s", disabled: busy, "data-testid": `agent-worker-start-${a.id}-${r.name}`,
661
+ onClick: () => run(() => props.client.control(a.id, r.name, "start"), L.sent) })
662
+ : iconBtn(Icons.Square, L.stop, { key: "s", disabled: busy, "data-testid": `agent-worker-stop-${a.id}-${r.name}`,
663
+ onClick: () => confirmThen(fill(L.stopConfirm, { worker: roleLabel(r.name), name: a.name }), L.stop, () => props.client.control(a.id, r.name, "stop"), L.sent) }),
664
+ ] : null,
665
+ ] : null);
666
+ }))),
630
667
  h("td", null, h("div", { className: "scalio-agent-actions" },
631
668
  iconBtn(Icons.Settings, L.settings, { "aria-expanded": open === a.id, "data-testid": `agent-settings-open-${a.id}`,
632
669
  onClick: () => setOpen(open === a.id ? null : a.id) }),
@@ -637,34 +674,44 @@ function AgentsPanel(props) {
637
674
  iconBtn(Icons.Trash, L.remove, { disabled: busy, "data-testid": `agent-remove-${a.id}`,
638
675
  onClick: () => confirmThen(fill(L.removeConfirm, { name: a.name }), L.remove, () => props.client.remove(a.id), L.saved) }))));
639
676
  };
640
- rows.push(h(Field, { key: "agents", label: L.agents },
677
+ rows.push(h("div", { key: "agents", className: "scalio-agents-block" },
678
+ label(agents.length ? `${L.agents} (${agents.length})` : L.agents),
641
679
  !data ? null : agents.length === 0
642
680
  ? h("p", { className: "scalio-settings-text", "data-testid": "agents-none" }, L.none)
643
- : h("div", { style: { overflowX: "auto" } },
681
+ : h("div", { className: "scalio-agents-scroll" },
644
682
  h("table", { className: "scalio-users-table scalio-agents-table", "data-testid": "agents-table" },
645
- h("thead", null, h("tr", null, [L.name, L.version, L.status, L.roles, L.workers, ""].map((t, i) => h("th", { key: i }, t)))),
683
+ h("thead", null, h("tr", null, [L.name, L.status, L.version, L.rolesWorkers, ""].map((t, i) => h("th", { key: i }, t)))),
646
684
  h("tbody", null, agents.map((a) => agentRow(a)))))));
647
685
  const openAgent = agents.find((a) => a.id === open);
648
- if (openAgent) rows.push(h(SettingsDialog, { key: "settings-dialog", agent: openAgent, L, onClose: () => setOpen(null) },
686
+ if (openAgent) rows.push(h(PanelDialog, { key: "settings-dialog", L, onClose: () => setOpen(null),
687
+ title: fill(L.setTitle, { name: openAgent.name || openAgent.hostname || openAgent.id }),
688
+ testId: `agent-settings-dialog-${openAgent.id}`, closeTestId: `agent-settings-close-${openAgent.id}` },
649
689
  h(AgentSettings, { agent: openAgent, L, lang: props.lang, busy, client: props.client, run, notify: props.notify,
650
690
  suggest: props.suggest, roleLabel })));
651
691
 
652
- // tasks
692
+ // tasks, newest first, with the filter «nur Fehler»
653
693
  const nameOf = (id) => (agents.find((a) => a.id === id) || {}).name || "";
654
- rows.push(h(Field, { key: "tasks", label: L.tasks },
694
+ const shownTasks = onlyErrors ? tasks.filter((t) => t.status === "error") : tasks;
695
+ rows.push(h("div", { key: "tasks", className: "scalio-agents-block" },
696
+ h("div", { style: { display: "flex", gap: "1rem", alignItems: "center", flexWrap: "wrap" } },
697
+ label(L.tasks),
698
+ tasks.length ? h("label", { className: "scalio-settings-check" },
699
+ h("input", { type: "checkbox", checked: onlyErrors, "data-testid": "agents-tasks-errors", onChange: () => setOnlyErrors(!onlyErrors) }),
700
+ h("span", null, L.onlyErrors)) : null),
655
701
  tasks.length === 0 ? h("p", { className: "scalio-settings-text", "data-testid": "agents-no-tasks" }, L.noTasks)
656
- : h("div", { style: { overflowX: "auto" } },
657
- h("table", { className: "scalio-users-table", "data-testid": "agents-tasks" },
658
- h("thead", null, h("tr", null, [L.task, L.agent, L.status, L.created, L.message].map((t, i) => h("th", { key: i }, t)))),
659
- h("tbody", null, tasks.map((t) => h("tr", { key: t.id, "data-testid": `agents-task-${t.id}` },
702
+ : shownTasks.length === 0 ? h("p", { className: "scalio-settings-text", "data-testid": "agents-no-errors" }, L.noErrors)
703
+ : h("div", { className: "scalio-agents-scroll" },
704
+ h("table", { className: "scalio-users-table scalio-agents-table", "data-testid": "agents-tasks" },
705
+ h("thead", null, h("tr", null, [L.created, L.task, L.agent, L.status, L.message].map((t, i) => h("th", { key: i }, t)))),
706
+ h("tbody", null, shownTasks.map((t) => h("tr", { key: t.id, "data-testid": `agents-task-${t.id}` },
707
+ h("td", { style: { whiteSpace: "nowrap" } }, when(t.created_at, props.lang)),
660
708
  h("td", null, `${t.worker ? `${t.worker} · ` : ""}${t.action || ""}`),
661
709
  h("td", null, nameOf(t.agent_id)),
662
710
  h("td", null, h(StatusBadge, { tone: TASK_TONE[t.status] || "neutral" }, (L.taskStates || {})[t.status] || t.status || "")),
663
- h("td", null, when(t.created_at, props.lang)),
664
711
  h("td", null, t.message || ""))))))));
665
712
 
666
713
  if (error) rows.push(h("div", { key: "err", className: "scalio-notice is-error", role: "alert", "data-testid": "agents-error" }, error));
667
- return h(SettingsSection, { id: "agent", title: L.title, description: L.hint, testId: "agents-panel" }, rows);
714
+ return h("section", { className: "scalio-agents", id: "settings-agent", "data-testid": "agents-panel" }, rows);
668
715
  }
669
716
 
670
- module.exports = { AgentsPanel, agentsApi, agentInstallCommand: installCommand, AGENT_LABELS: LABELS };
717
+ module.exports = { AgentsPanel, PanelDialog, agentsApi, agentInstallCommand: installCommand, AGENT_LABELS: LABELS };