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:
parent
e5fb4bbe6c
commit
696c199621
1 changed files with 21 additions and 13 deletions
|
|
@ -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 (
|
||||
<>
|
||||
<div class="ui-agents-hives">
|
||||
<HivesCard />
|
||||
</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 ? (
|
||||
<ApiErrorPanel
|
||||
context="failed to load the agent roster"
|
||||
|
|
@ -140,18 +160,7 @@ export function AgentsPage() {
|
|||
<FilterableView
|
||||
view="cards"
|
||||
standalone
|
||||
barActions={
|
||||
<>
|
||||
<Button variant="primary" onClick={() => setCreateOpen(true)}>
|
||||
+ agent
|
||||
</Button>
|
||||
<RefreshIntervalPicker
|
||||
id="agents-refresh"
|
||||
value={intervalMs}
|
||||
onChange={setIntervalMs}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
barActions={barActions}
|
||||
columns={FIELDS}
|
||||
rows={rows}
|
||||
rowKey={(a) => a.name}
|
||||
|
|
|
|||
Loading…
Reference in a new issue