Skip to content

Commit

Permalink
Merge pull request ceph#53817 from cloudbehl/active-alert-filter
Browse files Browse the repository at this point in the history
mgr/dashboard: Filter active alerts

Reviewed-by: Nizamudeen A <[email protected]>
  • Loading branch information
nizamial09 authored Oct 9, 2023
2 parents 03e43c5 + a40fd8c commit 6ed5a28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@
<ng-template #alertsCard>
<ng-container *ngFor="let alert of prometheusAlertService.alerts; let i = index; trackBy: trackByFn">
<div [ngClass]="['border-'+alertClass[alert.labels.severity]]"
*ngIf="alert.labels.severity === alertType || !alertType">
*ngIf="alert.status.state === 'active' &&
alert.labels.severity === alertType ||
!alertType">
<div class="card tc_alerts border-0 pt-3">
<div class="row no-gutters ps-2">
<div class="col-sm-1 text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6ed5a28

Please sign in to comment.