From 3ec27ce4dca3603e8239eff1c3f42cb77d52302e Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Mon, 9 Feb 2026 18:32:18 +0530 Subject: [PATCH] mgr/dashboard: use gray10 theme colors - sidenav, header , table - white - background - gray Signed-off-by: Afreen Misbah --- .../src/app/ceph/block/block.module.ts | 3 +- ...meof-gateway-node-add-modal.component.html | 2 +- .../nvmeof-gateway-node.component.ts | 11 ++++--- .../nvmeof-gateway-subsystem.component.ts | 29 ++--------------- .../nvmeof-subsystems.component.html | 11 ++----- .../nvmeof-subsystems.component.spec.ts | 1 + .../nvmeof-subsystems.component.ts | 13 ++++++-- .../sidebar-layout.component.html | 4 ++- .../sidebar-layout.component.scss | 19 ++++++++++- .../frontend/src/app/shared/models/nvmeof.ts | 32 +++++++++++++++++++ 10 files changed, 77 insertions(+), 48 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts index 9d90cba8636..ed0583ef9b4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts @@ -75,8 +75,7 @@ import { LayoutModule, ContainedListModule, LayerModule, - ThemeModule, - LayoutModule + ThemeModule } from 'carbon-components-angular'; // Icons diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node-add-modal/nvmeof-gateway-node-add-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node-add-modal/nvmeof-gateway-node-add-modal.component.html index 7e88c892b8d..497c5797454 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node-add-modal/nvmeof-gateway-node-add-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node-add-modal/nvmeof-gateway-node-add-modal.component.html @@ -29,7 +29,7 @@
- Nodes to run NVMe-oF target pods/services + Nodes to run NVMe-oF target service
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts index 42f50767e75..da53841521e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts @@ -15,6 +15,7 @@ import { finalize } from 'rxjs/operators'; import { TableComponent } from '~/app/shared/datatable/table/table.component'; import { HostStatus } from '~/app/shared/enum/host-status.enum'; import { Icons } from '~/app/shared/enum/icons.enum'; +import { NvmeofGatewayNodeMode } from '~/app/shared/enum/nvmeof.enum'; import { CdTableAction } from '~/app/shared/models/cd-table-action'; import { CdTableColumn } from '~/app/shared/models/cd-table-column'; import { CdTableFetchDataContext } from '~/app/shared/models/cd-table-fetch-data-context'; @@ -55,7 +56,7 @@ export class NvmeofGatewayNodeComponent implements OnInit, OnDestroy { @Output() hostsLoaded = new EventEmitter(); @Input() groupName: string | undefined; - @Input() mode: 'selector' | 'details' = 'selector'; + @Input() mode: 'selector' | 'details' = NvmeofGatewayNodeMode.SELECTOR; usedHostnames: Set = new Set(); serviceSpec: CephServiceSpec | undefined; @@ -92,9 +93,9 @@ export class NvmeofGatewayNodeComponent implements OnInit, OnDestroy { this.mode = routeData['mode']; } - this.selectionType = this.mode === 'selector' ? 'multiClick' : 'single'; + this.selectionType = this.mode === NvmeofGatewayNodeMode.SELECTOR ? 'multiClick' : 'single'; - if (this.mode === 'details') { + if (this.mode === NvmeofGatewayNodeMode.DETAILS) { this.route.parent?.params.subscribe((params: any) => { this.groupName = params.group; }); @@ -195,7 +196,7 @@ export class NvmeofGatewayNodeComponent implements OnInit, OnDestroy { } const fetchData$: Observable = - this.mode === 'details' + this.mode === NvmeofGatewayNodeMode.DETAILS ? this.nvmeofService.fetchHostsAndGroups() : this.nvmeofService.getAvailableHosts(this.tableContext?.toParams()); @@ -207,7 +208,7 @@ export class NvmeofGatewayNodeComponent implements OnInit, OnDestroy { ) .subscribe({ next: (result: any) => { - if (this.mode === 'details') { + if (this.mode === NvmeofGatewayNodeMode.DETAILS) { this.processDetailsData(result.groups, result.hosts); } else { this.hosts = result; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts index aa46f503b5a..890f5b951c3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts @@ -6,7 +6,8 @@ import { NvmeofService } from '~/app/shared/api/nvmeof.service'; import { NvmeofSubsystem, NvmeofSubsystemData, - NvmeofSubsystemInitiator + NvmeofSubsystemInitiator, + getSubsystemAuthStatus } from '~/app/shared/models/nvmeof'; import { CdTableColumn } from '~/app/shared/models/cd-table-column'; import { CdTableSelection } from '~/app/shared/models/cd-table-selection'; @@ -86,33 +87,9 @@ export class NvmeofGatewaySubsystemComponent implements OnInit { count = initiators.hosts.length; } - let authStatus = NvmeofSubsystemAuthType.NO_AUTH; - if (sub.psk) { - authStatus = NvmeofSubsystemAuthType.BIDIRECTIONAL; - } else if ( - initiators && - 'hosts' in initiators && - Array.isArray(initiators.hosts) - ) { - const hasDhchapKey = initiators.hosts.some( - (host: NvmeofSubsystemInitiator) => !!host.dhchap_key - ); - if (hasDhchapKey) { - authStatus = NvmeofSubsystemAuthType.UNIDIRECTIONAL; - } - } else if (Array.isArray(initiators)) { - // Fallback for unexpected structure, though getInitiators usually returns {hosts: []} - const hasDhchapKey = (initiators as NvmeofSubsystemInitiator[]).some( - (host: NvmeofSubsystemInitiator) => !!host.dhchap_key - ); - if (hasDhchapKey) { - authStatus = NvmeofSubsystemAuthType.UNIDIRECTIONAL; - } - } - return { ...sub, - auth: authStatus, + auth: getSubsystemAuthStatus(sub, initiators), hosts: count }; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html index 4a794e11a9f..f06bec2543f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html @@ -46,19 +46,12 @@ let-row="data.row">
- @if (row.enable_ha === false) { + @if (row.auth === authType.NO_AUTH) { - No authentication - } @else if (row.allow_any_host) { - - Unidirectional } @else { - Bidirectional } + {{ row.auth }}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts index d2de1c40905..bc3edd51522 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts @@ -118,6 +118,7 @@ describe('NvmeofSubsystemsComponent', () => { const expected = mockSubsystems.map((s) => ({ ...s, gw_group: component.group, + auth: 'No authentication', initiator_count: 0 })); expect(component.subsystems).toEqual(expected); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts index d7a3f3f2c5b..d2207c2f577 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts @@ -2,7 +2,11 @@ import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/c import { ActivatedRoute, Router } from '@angular/router'; import { ActionLabelsI18n, URLVerbs } from '~/app/shared/constants/app.constants'; import { CdTableSelection } from '~/app/shared/models/cd-table-selection'; -import { NvmeofSubsystem, NvmeofSubsystemInitiator } from '~/app/shared/models/nvmeof'; +import { + NvmeofSubsystem, + NvmeofSubsystemInitiator, + getSubsystemAuthStatus +} from '~/app/shared/models/nvmeof'; import { Permissions } from '~/app/shared/models/permissions'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; import { ListWithDetails } from '~/app/shared/classes/list-with-details.class'; @@ -10,6 +14,7 @@ import { CdTableFetchDataContext } from '~/app/shared/models/cd-table-fetch-data import { CdTableAction } from '~/app/shared/models/cd-table-action'; import { Icons } from '~/app/shared/enum/icons.enum'; +import { NvmeofSubsystemAuthType } from '~/app/shared/enum/nvmeof.enum'; import { DeleteConfirmationModalComponent } from '~/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; @@ -52,6 +57,7 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit group: string = null; gwGroupsEmpty: boolean = false; gwGroupPlaceholder: string = DEFAULT_PLACEHOLDER; + authType = NvmeofSubsystemAuthType; private destroy$ = new Subject(); @@ -249,8 +255,9 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit return { ...sub, gw_group: this.group, - initiator_count: count - } as NvmeofSubsystem & { initiator_count?: number }; + initiator_count: count, + auth: getSubsystemAuthStatus(sub, initiators) + } as NvmeofSubsystem & { initiator_count?: number; auth?: string }; }) ); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.html index 00389576dab..6824aa2c16b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.html @@ -5,7 +5,9 @@ }