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
22
frontend/packages/swarm-ui/src/pages/hive-domain.ts
Normal file
22
frontend/packages/swarm-ui/src/pages/hive-domain.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// What the hives table shows in its domain column. The cell, the sort and the
|
||||
// text filter all read this one value, so a row sorts and filters under the
|
||||
// text it displays.
|
||||
|
||||
export interface HiveDomainFields {
|
||||
domain: string | null;
|
||||
dashboard: string | null;
|
||||
}
|
||||
|
||||
export interface DomainCell {
|
||||
/** The domain, or "" when the hive has none. */
|
||||
text: string;
|
||||
/** The dashboard URL, or null when the hive has no dashboard to open. */
|
||||
href: string | null;
|
||||
}
|
||||
|
||||
export function domainCell(h: HiveDomainFields): DomainCell {
|
||||
return {
|
||||
text: h.domain ?? "",
|
||||
href: h.domain && h.dashboard ? `https://${h.dashboard}/` : null,
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue