dashboard(matrix-accounts): populate agent picker from state containers
The agent dropdown read a non-existent `agents` field on /api/state, so
it always rendered empty ("— no agents —"). The endpoint exposes the
live roster under `containers` (each entry an object with `.name`).
Read that instead; the existing string-or-object map keeps it robust.
This commit is contained in:
parent
3b8e77c1c1
commit
d8d589ccb2
1 changed files with 4 additions and 1 deletions
|
|
@ -31,7 +31,10 @@ async function loadState() {
|
|||
if (!resp.ok) return;
|
||||
const s = await resp.json();
|
||||
renderServerWarnings(s.server_warnings);
|
||||
agents = (s.agents || [])
|
||||
// `/api/state` exposes the live roster under `containers` (each entry an
|
||||
// object carrying `.name`); there is no top-level `agents` field, so the
|
||||
// picker stays compatible with both string + object shapes defensively.
|
||||
agents = (s.containers || [])
|
||||
.map((a) => (typeof a === 'string' ? a : a && a.name))
|
||||
.filter(Boolean)
|
||||
.sort();
|
||||
|
|
|
|||
Loading…
Reference in a new issue