From a40fd8ca92ad2ad0890cbab0cde1f17417b718ca Mon Sep 17 00:00:00 2001 From: cloudbehl Date: Wed, 4 Oct 2023 16:35:26 +0530 Subject: [PATCH] mgr/dashboard: Filter active alerts - List alerts which are not suppressed fixes: https://tracker.ceph.com/issues/62990 Signed-off-by: cloudbehl --- .../ceph/dashboard-v3/dashboard/dashboard-v3.component.html | 4 +++- .../src/app/shared/services/prometheus-alert.service.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html index 8faa23a5b2d..5da863e2970 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard-v3/dashboard/dashboard-v3.component.html @@ -299,7 +299,9 @@
+ *ngIf="alert.status.state === 'active' && + alert.labels.severity === alertType || + !alertType">
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts index be6c27da6e2..2830fd00c24 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts @@ -80,9 +80,9 @@ export class PrometheusAlertService { alert.status.state === 'active' && alert.labels.severity === 'warning' ? ++result : result, 0 ); - this.alerts = alerts.reverse().sort((a, b) => { - return a.labels.severity.localeCompare(b.labels.severity); - }); + this.alerts = alerts + .reverse() + .sort((a, b) => a.labels.severity.localeCompare(b.labels.severity)); this.canAlertsBeNotified = true; } -- 2.47.3