]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix hardware health card icon rendering
authorAfreen Misbah <afreen@ibm.com>
Thu, 25 Jun 2026 18:59:11 +0000 (00:29 +0530)
committerAfreen Misbah <afreen@ibm.com>
Wed, 15 Jul 2026 11:25:38 +0000 (16:55 +0530)
Hardware category icons  were rendering as empty SVGs because of wrong reference

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts

index bdb7045b7ecbde78bb5d64263833985ca97a2852..3e4bf0f5783dd5f0e56352bc9137f19534152866 100644 (file)
 
         @if (hwEnabled && hwSections) {
           <div class="overview-health-card-hardware-sections">
-            @for (section of sections; track $index; let isLast = $last) {
-              <div
-                class="overview-health-card-hardware-section"
-                [class.border-subtle-right]="!isLast"
-              >
-                @for (row of section; track row.key) {
-                  <div class="overview-health-card-hardware-row">
-                    <span class="overview-health-card-icon-and-text">
-                      <cd-icon [type]="row.key"></cd-icon>
-                      <span class="cds--type-body-compact-01">
-                        {{ row.label }}
-                      </span>
-                    </span>
+          @for (section of hwSections; track $index; let isLast = $last) {
+            <div class="overview-health-card-hardware-section"
+                 [class.border-subtle-right]="!isLast">
+            @for (row of section; track row.key) {
+            <div class="overview-health-card-hardware-row">
+              <span class="overview-health-card-icon-and-text">
+                <cd-icon [type]="row.icon"></cd-icon>
+                <span class="cds--type-body-compact-01">
+                  {{ row.label }}
+                </span>
+              </span>
 
                     <span class="overview-health-card-hardware-status">
                       @if (row.error > 0) {
index 7d8855e204e322a1a91aacbe34885572fa3ae795..f3ff1cac477b449090aa193c841d30619853efc8 100644 (file)
@@ -52,10 +52,20 @@ type HwKey = keyof typeof HardwareNameMapping;
 type HwRowVM = {
   key: HwKey;
   label: string;
+  icon: string;
   ok: number;
   error: number;
 };
 
+const HW_ICON_MAP: Record<HwKey, string> = {
+  memory: 'dataEnrichment',
+  storage: 'vmdkDisk',
+  processors: 'chip',
+  network: 'network1',
+  power: 'plug',
+  fans: 'ibmStreamSets',
+};
+
 @Component({
   selector: 'cd-overview-health-card',
   imports: [
@@ -154,6 +164,7 @@ export class OverviewHealthCardComponent {
       return (Object.keys(HardwareNameMapping) as HwKey[]).map((key) => ({
         key,
         label: HardwareNameMapping[key],
+        icon: HW_ICON_MAP[key],
         ok: Number(category?.[key]?.ok ?? 0),
         error: Number(category?.[key]?.error ?? 0)
       }));