Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: drop a doubled line from the agents page docs; keep + agent while the roster loads or fails

The buttons sat in the filter card, which only shows once the roster
has loaded, so a failed load left no way to create an agent.
This commit is contained in:
iris 2026-11-01 13:04:47 +01:00 • committed by mara
commit 696c199621
2 changed files with 21 additions and 13 deletions

View file

@ -55,7 +55,6 @@ works too.
### The agents page ### The agents page
`/agents` is a column of separate cards: the hives card, a filter card, then one
`/agents` is a column of separate cards: the hives card, a filter card, then one `/agents` is a column of separate cards: the hives card, a filter card, then one
card per agent, none of them inside a bigger card. A card's card per agent, none of them inside a bigger card. A card's
header shows its icon, name, freshness, the status message, a **terminal** header shows its icon, name, freshness, the status message, a **terminal**

View file

@ -124,11 +124,31 @@ export function AgentsPage() {
}); });
}); });
const barActions = (
<>
<Button variant="primary" onClick={() => setCreateOpen(true)}>
+ agent
</Button>
<RefreshIntervalPicker
id="agents-refresh"
value={intervalMs}
onChange={setIntervalMs}
/>
</>
);
return ( return (
<> <>
<div class="ui-agents-hives"> <div class="ui-agents-hives">
<HivesCard /> <HivesCard />
</div> </div>
{/* Until the roster loads (or when it fails) there are no filters, but the
buttons stay, so an agent can still be created. */}
{rows === null ? (
<div class="ui-filterable-view-filter-bar ui-filterable-view-filter-card">
<div class="ui-filterable-view-actions">{barActions}</div>
</div>
) : null}
{error ? ( {error ? (
<ApiErrorPanel <ApiErrorPanel
context="failed to load the agent roster" context="failed to load the agent roster"
@ -140,18 +160,7 @@ export function AgentsPage() {
<FilterableView <FilterableView
view="cards" view="cards"
standalone standalone
barActions={ barActions={barActions}
<>
<Button variant="primary" onClick={() => setCreateOpen(true)}>
+ agent
</Button>
<RefreshIntervalPicker
id="agents-refresh"
value={intervalMs}
onChange={setIntervalMs}
/>
</>
}
columns={FIELDS} columns={FIELDS}
rows={rows} rows={rows}
rowKey={(a) => a.name} rowKey={(a) => a.name}