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:
parent
b39e095aa8
commit
f0a6d6c042
4 changed files with 64 additions and 22 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue