From: Pedro Gonzalez Gomez Date: Mon, 23 Mar 2026 11:02:29 +0000 (+0100) Subject: mgr/dashboard: add telemetry status to overview-health-card X-Git-Tag: testing/wip-yuri10-testing-20260526.155424-main~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17dca0d8dd7d781c33740ef988486e9d0eece28b;p=ceph-ci.git mgr/dashboard: add telemetry status to overview-health-card Fixes: https://tracker.ceph.com/issues/75666 Signed-off-by: Pedro Gonzalez Gomez --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.html index a3ea1f11c9f..0ecd3b5eb51 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.html @@ -1,6 +1,7 @@ @let data=(data$ | async); @let hwEnabled = (enabled$ | async); @let hwSections = (sections$ | async); +@let telemetryEnabled = (telemetryEnabled$ | async); @let colorClass="overview-health-card-status--" + vm?.clusterHealth?.icon; @@ -24,15 +25,42 @@ source="fsid"> - - - + +
Support & diagnostics
+
+ Telemetry + + @if (telemetryEnabled) { +   + on + } @else { +   + off + } + +
+
+
+ + + + + + +
} @else { { getSummary: jest.fn(() => of(null)) }; + const mockHealthService = { + getTelemetryStatus: jest.fn(() => of(false)) + }; + beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ @@ -60,6 +65,7 @@ describe('OverviewStorageCardComponent (Jest)', () => { { provide: AuthStorageService, useValue: mockAuthStorageService }, { provide: MgrModuleService, useValue: mockMgrModuleService }, { provide: HardwareService, useValue: mockHardwareService }, + { provide: HealthService, useValue: mockHealthService }, provideRouter([]) ] }).compileComponents(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts index 644353a63a3..7d8855e204e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/health-card/overview-health-card.component.ts @@ -28,6 +28,7 @@ import { UpgradeService } from '~/app/shared/api/upgrade.service'; import { catchError, filter, map, shareReplay, startWith, switchMap } from 'rxjs/operators'; import { HealthCardTabSection, HealthCardVM } from '~/app/shared/models/overview'; import { HardwareService } from '~/app/shared/api/hardware.service'; +import { HealthService } from '~/app/shared/api/health.service'; import { MgrModuleService } from '~/app/shared/api/mgr-module.service'; import { RefreshIntervalService } from '~/app/shared/services/refresh-interval.service'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; @@ -80,6 +81,7 @@ type HwRowVM = { export class OverviewHealthCardComponent { private readonly summaryService = inject(SummaryService); private readonly upgradeService = inject(UpgradeService); + private readonly healthService = inject(HealthService); private readonly hardwareService = inject(HardwareService); private readonly mgrModuleService = inject(MgrModuleService); private readonly refreshIntervalService = inject(RefreshIntervalService); @@ -159,6 +161,12 @@ export class OverviewHealthCardComponent { shareReplay({ bufferSize: 1, refCount: true }) ); + readonly telemetryEnabled$: Observable = this.healthService.getTelemetryStatus().pipe( + map((enabled: any) => !!enabled), + catchError(() => of(false)), + shareReplay({ bufferSize: 1, refCount: true }) + ); + readonly sections$: Observable = this.hardwareRows$.pipe( map((rows) => { if (!rows) return null; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.spec.ts index 992f68855d7..e33fa066835 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/overview/overview.component.spec.ts @@ -25,7 +25,7 @@ describe('OverviewComponent', () => { let component: OverviewComponent; let fixture: ComponentFixture; - let mockHealthService: { getHealthSnapshot: jest.Mock }; + let mockHealthService: { getHealthSnapshot: jest.Mock; getTelemetryStatus: jest.Mock }; let mockRefreshIntervalService: { intervalData$: Subject }; let mockOverviewStorageService: { getTrendData: jest.Mock; @@ -61,7 +61,10 @@ describe('OverviewComponent', () => { refreshPrometheusUsable: jest.fn().mockReturnValue(of(true)) }; - mockHealthService = { getHealthSnapshot: jest.fn() }; + mockHealthService = { + getHealthSnapshot: jest.fn(), + getTelemetryStatus: jest.fn().mockReturnValue(of(false)) + }; mockRefreshIntervalService = { intervalData$: new Subject() }; mockOverviewStorageService = { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts index 899d85c667f..5fbd0930b45 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts @@ -131,6 +131,7 @@ import CaretRight16 from '@carbon/icons/es/caret--right/16'; import Locked16 from '@carbon/icons/es/locked/16'; import WebServicesCluster20 from '@carbon/icons/es/web-services--cluster/20'; import WebServicesCluster32 from '@carbon/icons/es/web-services--cluster/32'; +import CloudMonitoring16 from '@carbon/icons/es/cloud--monitoring/16'; import { TearsheetStepComponent } from './tearsheet-step/tearsheet-step.component'; import { PageHeaderComponent } from './page-header/page-header.component'; @@ -321,7 +322,8 @@ export class ComponentsModule { CaretRight16, Locked16, WebServicesCluster20, - WebServicesCluster32 + WebServicesCluster32, + CloudMonitoring16 ]); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts index d99e4664c9a..60de24cc8ed 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts @@ -123,7 +123,8 @@ export enum Icons { arrowUpRight = 'arrow--up-right', inProgress = 'in-progress', arrowDown = 'arrow--down', - locked = 'locked' // Access denied, locked state + locked = 'locked', // Access denied, locked state + cloudMonitoring = 'cloud--monitoring' } export enum IconSize { @@ -172,7 +173,8 @@ export const ICON_TYPE = { angleDoubleRight: 'chevron--right', leftArrow: 'caret--left', rightArrow: 'caret--right', - locked: 'locked' + locked: 'locked', + cloudMonitoring: 'cloud--monitoring' } as const; export const EMPTY_STATE_IMAGE = {