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.
18 lines
657 B
TypeScript
18 lines
657 B
TypeScript
// The agent names a schedule form offers.
|
|
|
|
/** Sorted names from the agent roster; none while it has not loaded. */
|
|
export function agentNamesFrom(
|
|
rows: readonly { name: string }[] | null,
|
|
): string[] {
|
|
return (rows ?? []).map((a) => a.name).sort();
|
|
}
|
|
|
|
/** The roster names plus the schedule's own agents, sorted without repeats. A
|
|
* schedule can still target an agent that has since left the roster, so an
|
|
* edit keeps those pickable and can drop them. */
|
|
export function agentOptionsFor(
|
|
names: readonly string[],
|
|
schedule?: { agents: readonly string[] },
|
|
): string[] {
|
|
return [...new Set([...names, ...(schedule?.agents ?? [])])].sort();
|
|
}
|