Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: add a button to the alerts page that shows the pending, no-data and error instances

The page opens on the firing ones. The button lists every instance again,
with the state filter and the tones back, so the table's filtering is
visible. The saved-filters key goes back to its original name, since the
state column is a filter again.
This commit is contained in:
iris 2026-10-18 13:17:35 +02:00 • committed by mara
commit f0a6d6c042
4 changed files with 64 additions and 22 deletions

View file

@ -20,6 +20,12 @@ export function firingAlerts(alerts: Alert[]): Alert[] {
return alerts.filter((a) => a.state === FIRING);
}
// What the page lists: the firing ones, or every instance once the operator
// asks for the rest.
export function listedAlerts(alerts: Alert[], showAll: boolean): Alert[] {
return showAll ? alerts : firingAlerts(alerts);
}
// Grafana reports an instance that never became active with the zero time,
// which `Date.parse` reads as year 1.
export function activeSinceMs(a: Alert): number | null {