dashboard events: unified coord channel + /dashboard/{stream,history}; broker forwards

This commit is contained in:
müde 2026-05-17 12:39:48 +02:00
parent d48cee7c2d
commit a478792914
6 changed files with 205 additions and 66 deletions

View file

@ -1,6 +1,6 @@
// Dashboard SPA. Renders containers + approvals from `/api/state`, wires
// up async-form submission (URL-encoded POST + spinner + state refresh),
// and tails the broker over `/messages/stream` SSE.
// and tails the unified dashboard event channel over `/dashboard/stream`.
(() => {
// ─── helpers ────────────────────────────────────────────────────────────
@ -600,7 +600,7 @@
// ─── operator inbox (derived from the broker message stream) ───────────
// No longer shipped on `/api/state.operator_inbox`. The dashboard
// terminal's HiveTerminal feeds this via `onAnyEvent` — backfill from
// `/messages/history` populates on load, live SSE keeps it current.
// `/dashboard/history` populates on load, live SSE keeps it current.
// Newest-first to match the previous behaviour.
const INBOX_LIMIT = 50;
const operatorInbox = [];
@ -1009,8 +1009,8 @@
}
HiveTerminal.create({
logEl: flow,
historyUrl: '/messages/history',
streamUrl: '/messages/stream',
historyUrl: '/dashboard/history',
streamUrl: '/dashboard/stream',
renderers: {
sent: (ev, api) => renderMsg(ev, api, '→'),
delivered: (ev, api) => renderMsg(ev, api, '✓'),