swarm-ui: a header bell with the count of firing alerts opens a list of them and a link to Grafana
This commit is contained in:
parent
ffcba2b026
commit
70e5de5571
1 changed files with 218 additions and 5 deletions
|
|
@ -2,6 +2,15 @@
|
|||
// instance from swarm-controller's `GET /api/alerts` and which of them count
|
||||
// as firing.
|
||||
|
||||
// Grafana's own alert list, for what the swarm UI does not show.
|
||||
export const GRAFANA_ALERTS_URL =
|
||||
"https://grafana.constellation.darkest.space/alerting/groups";
|
||||
|
||||
// What the header's alert button is called for `count` firing alerts.
|
||||
export function alertsLabel(count: number): string {
|
||||
return count === 1 ? "1 alert firing" : `${count} alerts firing`;
|
||||
}
|
||||
|
||||
export interface Alert {
|
||||
name: string;
|
||||
// Grafana's state for the instance: `Alerting`, `Pending`, `NoData` or
|
||||
|
|
|
|||
Loading…
Reference in a new issue