]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: monitoring menu entry should indicate firing alerts
authorVolker Theile <vtheile@suse.com>
Fri, 24 Apr 2020 10:18:25 +0000 (12:18 +0200)
committerVolker Theile <vtheile@suse.com>
Wed, 13 May 2020 06:00:55 +0000 (08:00 +0200)
Fixes: https://tracker.ceph.com/issues/43081
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit f88fb46d680127963c0d04b797b5742ada6024b4)

Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.scss
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.spec.ts

src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts

index 562e75355f4a0d5537e7560c9bb63a917b2b838e..a61b0581ddee39cb37ef935143a85676a45baa5b 100644 (file)
               class="tc_submenuitem tc_submenuitem_monitoring"
               *ngIf="(isAlertmanagerConfigured || isPrometheusConfigured) && permissions.prometheus.read">
             <a i18n
-               routerLink="/monitoring">Monitoring</a>
+               routerLink="/monitoring">
+              <ng-container i18n>Monitoring</ng-container>
+              <small *ngIf="prometheusAlertService.alerts.length > 0"
+                     class="badge badge-danger">{{ prometheusAlertService.alerts.length }}</small>
+            </a>
           </li>
         </ul>
       </li>
index 0fc85e8da7587d152b52d1cf572cb6399c8e6131..efd87da15aff5b182b2010f5d2f4720ab00f530f 100644 (file)
@@ -7,6 +7,7 @@ import {
   FeatureTogglesMap$,
   FeatureTogglesService
 } from '../../../shared/services/feature-toggles.service';
+import { PrometheusAlertService } from '../../../shared/services/prometheus-alert.service';
 import { SummaryService } from '../../../shared/services/summary.service';
 
 @Component({
@@ -27,7 +28,8 @@ export class NavigationComponent implements OnInit {
     private authStorageService: AuthStorageService,
     private prometheusService: PrometheusService,
     private summaryService: SummaryService,
-    private featureToggles: FeatureTogglesService
+    private featureToggles: FeatureTogglesService,
+    public prometheusAlertService: PrometheusAlertService
   ) {
     this.permissions = this.authStorageService.getPermissions();
     this.enabledFeature$ = this.featureToggles.get();