From: Afreen Misbah Date: Wed, 25 Feb 2026 05:10:39 +0000 (+0530) Subject: mgr/dashboard: Add skeleton states for alerts card X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05bb1431df096e738b1962cc7645d18f1d239ba6;p=ceph.git mgr/dashboard: Add skeleton states for alerts card Fixes https://tracker.ceph.com/issues/75159 Signed-off-by: Afreen Misbah --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.html index 6b2e703292c..1c8cd405111 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.html @@ -16,6 +16,7 @@ + @if (vm?.total) {
{{ vm.total }} @@ -26,7 +27,6 @@ i18n> {{ vm.statusText }} -
@if (vm.badges.length) { @@ -53,5 +53,11 @@
}
+ }@else { + +
+ +
+ } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts index bfd11fb5add..4200b2f2b2e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts @@ -15,6 +15,7 @@ import { GridModule, LayoutModule, LinkModule, + SkeletonModule, TilesModule } from 'carbon-components-angular'; import { RouterModule } from '@angular/router'; @@ -42,7 +43,8 @@ const AlertIcon = { ButtonModule, LinkModule, LayoutModule, - PipesModule + PipesModule, + SkeletonModule ], templateUrl: './overview-alerts-card.component.html', styleUrl: './overview-alerts-card.component.scss', @@ -58,11 +60,11 @@ export class OverviewAlertsCardComponent implements OnInit { } readonly vm$ = combineLatest([ - this.prometheusAlertService.totalAlerts$.pipe(startWith(0)), this.prometheusAlertService.criticalAlerts$.pipe(startWith(0)), this.prometheusAlertService.warningAlerts$.pipe(startWith(0)) ]).pipe( - map(([total, critical, warning]) => { + map(([critical, warning]) => { + const total = (critical ?? 0) + (warning ?? 0); const hasAlerts = total > 0; const hasCritical = critical > 0; const hasWarning = warning > 0;