swarm-ui: show, sort and filter the hive domain by one value, say when the roster is empty, keep the schedule agent picker current
The domain column showed a dash unless a hive had a dashboard but sorted and filtered on the domain alone, so rows looked mis-sorted. It now shows the domain as text when there is no dashboard to link. An empty hive roster says so. The schedule form's agent names reload with the schedules and the form says when that load failed.
This commit is contained in:
parent
885c051b33
commit
8c67ac01fe
1 changed files with 140 additions and 32 deletions
|
|
@ -23,6 +23,7 @@ import {
|
|||
} from "../ui/refresh-interval/RefreshInterval.js";
|
||||
import { fetchJson, usePolled } from "../ui/polled/usePolled.js";
|
||||
import { Table, type TableColumn } from "../ui/table/Table.js";
|
||||
import { domainCell } from "./hive-domain.js";
|
||||
|
||||
type Freshness = "fresh" | "stale" | "never_reported" | "unknown";
|
||||
|
||||
|
|
@ -59,16 +60,19 @@ const COLUMNS: TableColumn<HiveStatus>[] = [
|
|||
{
|
||||
key: "domain",
|
||||
header: "domain",
|
||||
render: (h) =>
|
||||
h.domain && h.dashboard ? (
|
||||
<a href={`https://${h.dashboard}/`} target="_blank" rel="noreferrer">
|
||||
{h.domain}
|
||||
render: (h) => {
|
||||
const { text, href } = domainCell(h);
|
||||
if (!text) return "—";
|
||||
return href ? (
|
||||
<a href={href} target="_blank" rel="noreferrer">
|
||||
{text}
|
||||
</a>
|
||||
) : (
|
||||
"—"
|
||||
),
|
||||
sortBy: (h) => h.domain ?? "",
|
||||
filterValue: (h) => h.domain ?? "",
|
||||
text
|
||||
);
|
||||
},
|
||||
sortBy: (h) => domainCell(h).text,
|
||||
filterValue: (h) => domainCell(h).text,
|
||||
},
|
||||
{
|
||||
key: "status",
|
||||
|
|
@ -137,6 +141,7 @@ export function HivesPage() {
|
|||
columns={COLUMNS}
|
||||
rows={hives}
|
||||
rowKey={(h) => h.name}
|
||||
emptyMessage="no hives in the roster yet"
|
||||
storageKey="swarm-ui:hives:table-filters"
|
||||
/>
|
||||
) : null}
|
||||
|
|
|
|||
Loading…
Reference in a new issue