dashboard: the SW4RM tab is the agents tab
The swarm lives in the swarm UI; this tab lists the hive's agents. The tab is 4G3NTS at #agents, its pane and count pill follow, and the module that renders the containers is agents.js. Comments and docs that named SW4RM or swarm.js follow.
This commit is contained in:
parent
ee5c057d8f
commit
e455964cb3
16 changed files with 70 additions and 69 deletions
|
|
@ -8,7 +8,7 @@
|
|||
// live in `./common.js`; the flow-page surface (broker
|
||||
// terminal, @-mention composer) lives in `./flow.js` — `flow.html` and
|
||||
// `dashboard.html` each load their own bundle.
|
||||
// SW4RM (containers) domain lives in `./swarm.js`.
|
||||
// 4G3NTS (containers) domain lives in `./agents.js`.
|
||||
|
||||
import { marked } from "marked";
|
||||
import { $, openStream, renderServerWarnings } from "./common.js";
|
||||
|
|
@ -33,7 +33,7 @@ import {
|
|||
applyTransientCleared,
|
||||
renderContainers,
|
||||
renderSelectionBar,
|
||||
} from "./swarm.js";
|
||||
} from "./agents.js";
|
||||
import {
|
||||
initBuilds,
|
||||
onBuildsTabShown,
|
||||
|
|
@ -126,7 +126,7 @@ window.marked = marked;
|
|||
window.__hyperhive_state = s;
|
||||
renderServerWarnings(s.server_warnings);
|
||||
// Hive identity: render the swarm/hive name as a headline at the
|
||||
// top of the SW4RM pane + update the page title once the
|
||||
// top of the 4G3NTS pane + update the page title once the
|
||||
// server-side display names are known. `hive_name` / `swarm_name`
|
||||
// come from HYPERHIVE_HIVE_NAME / HYPERHIVE_SWARM_NAME env vars
|
||||
// (set by services.hyperhive.{hiveName,swarmName} nix options).
|
||||
|
|
@ -148,8 +148,8 @@ window.marked = marked;
|
|||
// `transientsState` + `containersState`, not from `s.*`).
|
||||
syncTransientsFromSnapshot(s);
|
||||
syncContainersFromSnapshot(s);
|
||||
// Job-queue rollup feeds only the SW4RM queue-summary banner
|
||||
// (per-agent card badges are transient-only — see swarm.js). Its
|
||||
// Job-queue rollup feeds only the 4G3NTS queue-summary banner
|
||||
// (per-agent card badges are transient-only — see agents.js). Its
|
||||
// own `JobqRollup` mount self-fetches GET /api/jobq/rollup — not
|
||||
// read off `s` (this page's snapshot carries no jobq field).
|
||||
// initJobqRollup mounts once and is a no-op on later calls; the
|
||||
|
|
@ -182,7 +182,7 @@ window.marked = marked;
|
|||
|
||||
// ─── live updates: dashboard event stream ──────────────────────────────
|
||||
// The dashboard subscribes to /dashboard/stream for live mutation
|
||||
// events so the SW4RM / SYST3M panes update without an
|
||||
// events so the 4G3NTS / SYST3M panes update without an
|
||||
// operator action triggering a refreshState.
|
||||
//
|
||||
// Bare `EventSource` (no terminal infrastructure needed — the
|
||||
|
|
@ -202,7 +202,7 @@ window.marked = marked;
|
|||
container_state_changed: applyContainerStateChanged,
|
||||
container_removed: applyContainerRemoved,
|
||||
// rebuild_queue_changed: a payload-less push trigger. Refreshes the
|
||||
// SW4RM queue-summary banner (see swarm.js) and the R3BU1LD QU3U3
|
||||
// 4G3NTS queue-summary banner (see agents.js) and the R3BU1LD QU3U3
|
||||
// tab's JobqGraph (see builds.js).
|
||||
rebuild_queue_changed: () => {
|
||||
applyRebuildQueueChanged();
|
||||
|
|
@ -260,9 +260,9 @@ window.marked = marked;
|
|||
})();
|
||||
|
||||
// ─── tab routing ───────────────────────────────────────────────────────
|
||||
// Hash-based: `#swarm` / `#rebuild` / `#meta` / `#buildlogs` /
|
||||
// Hash-based: `#agents` / `#rebuild` / `#meta` / `#buildlogs` /
|
||||
// `#permissions` activate the matching pane on the dashboard. Empty
|
||||
// hash defaults to SW4RM. FL0W and ST4TS are NOT tabs —
|
||||
// hash defaults to 4G3NTS. FL0W and ST4TS are NOT tabs —
|
||||
// they're separate pages (`/flow.html`, `/stats.html`) reached from
|
||||
// the H0M3 hub. Tab routing only
|
||||
// applies when the tab DOM is present (e.g. not on the flow page
|
||||
|
|
@ -275,7 +275,7 @@ window.marked = marked;
|
|||
// to their own pages rather than hide them in a dropdown.
|
||||
function activateTab(target) {
|
||||
// Track active tab on the body so renderSelectionBar can gate
|
||||
// visibility (bar only belongs on SW4RM where agent cards live).
|
||||
// visibility (bar only belongs on 4G3NTS where agent cards live).
|
||||
document.body.dataset.activeTab = target;
|
||||
renderSelectionBar(Array.from(containersState.values()));
|
||||
// Permissions tables: SSE covers worker-applied changes
|
||||
|
|
@ -292,9 +292,9 @@ window.marked = marked;
|
|||
|
||||
// Wire the shared tab strip now that activateTab + the lazy-load fns it
|
||||
// calls are defined. The strip resolves the active tab from the hash
|
||||
// (default SW4RM), toggles the active tab/pane + aria-selected, and
|
||||
// (default 4G3NTS), toggles the active tab/pane + aria-selected, and
|
||||
// fires activateTab for the per-tab side-effects on every change.
|
||||
createTabStrip($("tabbar"), { defaultId: "swarm", onShow: activateTab });
|
||||
createTabStrip($("tabbar"), { defaultId: "agents", onShow: activateTab });
|
||||
// The rebuild queue mounts now, not on first show, so its tab's count pill
|
||||
// is live from the start.
|
||||
initBuilds();
|
||||
|
|
@ -313,14 +313,14 @@ window.marked = marked;
|
|||
/** Recompute every tab's count from the current state. Called on
|
||||
* every renderXxx that's tab-relevant. */
|
||||
function refreshTabCounts() {
|
||||
// SW4RM — flag any container that's stale (needs_update). Empty
|
||||
// 4G3NTS — flag any container that's stale (needs_update). Empty
|
||||
// when everyone's current. Container-row pulse signals state
|
||||
// transitions; the pill catches "deploy-pending" specifically.
|
||||
let swarm = 0;
|
||||
let stale = 0;
|
||||
for (const c of containersState.values()) {
|
||||
if (c.needs_update) swarm++;
|
||||
if (c.needs_update) stale++;
|
||||
}
|
||||
setTabCount("swarm", swarm);
|
||||
setTabCount("agents", stale);
|
||||
// R3BU1LD QU3U3 — rebuilds in flight.
|
||||
setTabCount("rebuild", rebuildCount());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue