]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Css fixes for health card and alerts card
authorAfreen Misbah <afreen@ibm.com>
Mon, 23 Feb 2026 19:33:15 +0000 (01:03 +0530)
committerAfreen Misbah <afreen@ibm.com>
Mon, 23 Feb 2026 19:40:14 +0000 (01:10 +0530)
Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.scss
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/alerts-card/overview-alerts-card.component.ts
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.scss
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.ts

index 58d0451d12b78403ceb3b8741e59c4b126b9803d..f500e96e45ab86cb12562166b592f87378a7102f 100644 (file)
@@ -1,4 +1,4 @@
-<cd-productive-card>
+<cd-productive-card class="overview-alerts-card">
 @if (vm$ | async; as vm) {
   <ng-template #header>
     <h2 class="cds--type-heading-compact-02"
index 2eee4ca88cd0973489a876a12b4b31e8d8a46fef..62b4b62aaeeb41ae794317efb3d0e5f589130ac2 100644 (file)
@@ -1,4 +1,5 @@
 .overview-alerts-card {
+  // height: 100%;
   &-badges {
     display: flex;
     align-items: center;
@@ -19,4 +20,9 @@
     margin-top: var(--cds-spacing-02);
     color: var(--cds-text-secondary);
   }
+
+  .cds--tile {
+    min-block-size: 0;
+    height: 100%;
+  }
 }
index 07cf4614e573b221b677f0aab1ea8396790c648f..78c6e2d19398e073247f9188d85ae2215e014422 100644 (file)
@@ -1,4 +1,10 @@
-import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core';
+import {
+  ChangeDetectionStrategy,
+  Component,
+  OnInit,
+  ViewEncapsulation,
+  inject
+} from '@angular/core';
 import { CommonModule } from '@angular/common';
 import { combineLatest } from 'rxjs';
 
@@ -30,7 +36,8 @@ const AlertIcon = {
   ],
   templateUrl: './overview-alerts-card.component.html',
   styleUrl: './overview-alerts-card.component.scss',
-  changeDetection: ChangeDetectionStrategy.OnPush
+  changeDetection: ChangeDetectionStrategy.OnPush,
+  encapsulation: ViewEncapsulation.None
 })
 export class OverviewAlertsCardComponent implements OnInit {
   private readonly prometheusAlertService = inject(PrometheusAlertService);
index df65726d9df6e2f0b4091d5912274588c0b1829c..876e1f436f8916c1968a1f802eda1b7014d3c2ae 100644 (file)
   <!-- SYSTEM TAB -->
   @if(vm?.overallSystemSev) {
     <div class="overview-health-card-tab"
-         [ngClass]="{'overview-health-card-tab-selected': activeSection === 'system'}">
+         [class.overview-health-card-tab-selected]="activeSection === 'system'">
       <div class="cds-mb-1"><cd-icon
         [type]="vm?.overallSystemSev"></cd-icon></div>
       <cds-tooltip-definition
         i18n-description>
         <span
           class="cds-mr-1"
-          [ngClass]="{'cds--type-heading-compact-01': activeSection === 'system'}"
+          [class.cds--type-heading-compact-01]="activeSection === 'system'"
           i18n>
           Systems
         </span>
            i18n>Some cluster components are degraded and may require attention.</p>
         <div cdsStack="horizontal"
              [gap]="8">
-          <div class="overview-health-card-tab-content-item cds-pr-8">
-            <span>
-              <cd-icon [type]="vm?.mon?.severity"></cd-icon>
-              <span class="cds--type-body-compact-01 cds-ml-3">Monitor</span>
+          @for (item of healthItems; track item.key; let isLast = $last) {
+          <div class="cds-pr-8"
+               [class.overview-health-card-tab-content-item]="!isLast">
+            <span class="overview-health-card-icon-and-text">
+              <cd-icon [type]="vm?.[item.key]?.severity"></cd-icon>
+              <span class="cds--type-body-compact-01">
+                {{ item.label }}
+              </span>
             </span>
-            <p class="cds--type-label-01 cds-mt-3 cds-mb-0 overview-health-card-secondary-text">Quorum: {{vm?.mon?.value}}</p>
-          </div>
-          <div class="overview-health-card-tab-content-item cds-pr-8">
-            <span>
-              <cd-icon [type]="vm?.mgr?.severity"></cd-icon>
-              <span class="cds--type-body-compact-01 cds-ml-3">Manager</span>
-            </span>
-            <p class="cds--type-label-01 cds-mt-3 cds-mb-0 overview-health-card-secondary-text">{{vm?.mgr?.value}}</p>
-          </div>
-          <div class="overview-health-card-tab-content-item cds-pr-8">
-            <span>
-              <cd-icon [type]="vm?.osd?.severity"></cd-icon>
-              <span class="cds--type-body-compact-01 cds-ml-3"
-                    i18n>OSD</span>
-            </span>
-            <p class="cds--type-label-01 cds-mt-3 cds-mb-0 overview-health-card-secondary-text">{{vm?.osd?.value}}</p>
-          </div>
-          <div>
-            <span>
-              <cd-icon [type]="vm?.hosts?.severity"></cd-icon>
-              <span class="cds--type-body-compact-01 cds-ml-3">Nodes</span>
-            </span>
-            <p class="cds--type-label-01 cds-mt-3 cds-mb-0 overview-health-card-secondary-text">{{vm?.hosts?.value}}</p>
+            <p class="cds--type-label-01 cds-mt-3 cds-mb-0 overview-health-card-secondary-text">
+              {{ vm?.[item.key]?.value }}
+            </p>
           </div>
+          }
         </div>
       </div>
     </ng-container>
index 2357bba13b14bfa8a0a41fcaa5c5c7afc03d6907..2d6309aeaeb9c7444dd92ddfe4a6cd0b893a3147 100644 (file)
     max-block-size: fit-content;
   }
 
+  &-icon-and-text {
+    display: inline-flex;
+    align-items: center;
+    gap: var(--cds-spacing-03);
+  }
+
   // Overrides
   .clipboard-btn {
     padding: var(--cds-spacing-02);
@@ -63,4 +69,8 @@
     color: var(--cds-link-primary);
     border-block-end: 1px dotted var(--cds-link-primary);
   }
+
+  &-icon-and-text cd-icon svg {
+    display: block;
+  }
 }
index 6f4c74fa652f9e4a1fb8f32f6244e507e23e9964..49372345ae1bf0dffb78e996258993da597caa23 100644 (file)
@@ -35,6 +35,13 @@ type OverviewHealthData = {
 
 type TabSection = 'system' | 'hardware' | 'resiliency';
 
+interface HealthItemConfig {
+  key: 'mon' | 'mgr' | 'osd' | 'hosts';
+  label: string;
+  prefix?: string;
+  i18n?: boolean;
+}
+
 @Component({
   selector: 'cd-overview-health-card',
   imports: [
@@ -64,6 +71,12 @@ export class OverviewHealthCardComponent {
   @Output() viewIncidents = new EventEmitter<void>();
 
   activeSection: TabSection | null = null;
+  healthItems: HealthItemConfig[] = [
+    { key: 'mon', label: $localize`Monitor` },
+    { key: 'mgr', label: $localize`Manager` },
+    { key: 'osd', label: $localize`OSD` },
+    { key: 'hosts', label: $localize`Nodes` }
+  ];
 
   toggleSection(section: TabSection) {
     this.activeSection = this.activeSection === section ? null : section;
index aa45167850843dd1ebb23c79e0c66a0191e75671..1e7f9864170e086709506206a0c85950d5fe2ff3 100644 (file)
@@ -2,6 +2,7 @@
 @let health = (healthCardVm$ | async);
 <div cdsGrid
      [fullWidth]="true"
+     [narrow]="true"
      class="cds-mt-5 cds-mb-5">
   <div cdsRow>
     <div cdsCol
index ba2612c64896f2f47055ce52b5c87ea4eee3cd82..1e7cb7da1d1d2eea3d3ef303a77302da6b0a782b 100644 (file)
@@ -100,11 +100,14 @@ export function buildHealthCardVM(d: HealthSnapshotMap): HealthCardVM {
 
     health: healthDisplay,
 
-    mon: { value: `${monQuorum}/${monTotal}`, severity: SeverityIconMap[monSev] },
-    mgr: { value: `${mgrActive} active, ${mgrStandby} standby`, severity: SeverityIconMap[mgrSev] },
-    osd: { value: `${osdUp}/${osdTotal} in/up`, severity: SeverityIconMap[osdSev] },
+    mon: { value: $localize`Quorum: ${monQuorum}/${monTotal}`, severity: SeverityIconMap[monSev] },
+    mgr: {
+      value: $localize`${mgrActive} active, ${mgrStandby} standby`,
+      severity: SeverityIconMap[mgrSev]
+    },
+    osd: { value: $localize`${osdUp}/${osdTotal} in/up`, severity: SeverityIconMap[osdSev] },
     hosts: {
-      value: `${hostsAvailable} / ${hostsTotal} available`,
+      value: $localize`${hostsAvailable} / ${hostsTotal} available`,
       severity: SeverityIconMap[hostsSev]
     }
   };