swarm-ui: egress card lists the allowed domains as plain rows with real buttons, not badges
This commit is contained in:
parent
7122a3a36d
commit
b64ad47817
2 changed files with 13 additions and 15 deletions
|
|
@ -10,7 +10,6 @@
|
||||||
// are the agent card's own: `AddForm` without an agent, `useAllowedDomains`.
|
// are the agent card's own: `AddForm` without an agent, `useAllowedDomains`.
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
|
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
|
||||||
import { Badge } from "@hive/shared/badge.js";
|
|
||||||
import { AddForm } from "../../agent/detail/AllowedDomains.js";
|
import { AddForm } from "../../agent/detail/AllowedDomains.js";
|
||||||
import { swarmWideEntries } from "../../agent/detail/allowed-domains.js";
|
import { swarmWideEntries } from "../../agent/detail/allowed-domains.js";
|
||||||
import { useAllowedDomains } from "../../agent/detail/useAllowedDomains.js";
|
import { useAllowedDomains } from "../../agent/detail/useAllowedDomains.js";
|
||||||
|
|
@ -61,24 +60,15 @@ function EgressBody() {
|
||||||
<ul class="ui-swarm-egress-list">
|
<ul class="ui-swarm-egress-list">
|
||||||
{swarmWide.map((e) => (
|
{swarmWide.map((e) => (
|
||||||
<li key={e.domain}>
|
<li key={e.domain}>
|
||||||
<Badge value={e.domain} />{" "}
|
<code>{e.domain}</code>
|
||||||
<Badge
|
<Button disabled={busy} onClick={() => void remove(e)}>
|
||||||
variant="quiet"
|
remove
|
||||||
value="remove"
|
</Button>
|
||||||
title={`stop allowing ${e.domain} for every agent`}
|
|
||||||
disabled={busy}
|
|
||||||
onClick={() => void remove(e)}
|
|
||||||
/>
|
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
)}
|
)}
|
||||||
<Badge
|
<Button onClick={() => setAdding(true)}>add a domain</Button>
|
||||||
variant="quiet"
|
|
||||||
value="add"
|
|
||||||
title="allow a domain for every agent"
|
|
||||||
onClick={() => setAdding(true)}
|
|
||||||
/>
|
|
||||||
<Dialog
|
<Dialog
|
||||||
open={adding}
|
open={adding}
|
||||||
onClose={() => setAdding(false)}
|
onClose={() => setAdding(false)}
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,11 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.3em;
|
gap: 0.3em;
|
||||||
}
|
}
|
||||||
|
.ui-swarm-egress-list li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 1em;
|
||||||
|
padding: 0.25em 0;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue