]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: use gray10 theme colors
authorAfreen Misbah <afreen@ibm.com>
Mon, 9 Feb 2026 13:02:18 +0000 (18:32 +0530)
committerSagar Gopale <sagar.gopale@ibm.com>
Thu, 12 Feb 2026 06:03:41 +0000 (11:33 +0530)
- sidenav, header , table - white
- background - gray

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node-add-modal/nvmeof-gateway-node-add-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-subsystem/nvmeof-gateway-subsystem.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/sidebar-layout/sidebar-layout.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts

index 9d90cba86369cd8e32f7efa77ef890118b6bf589..ed0583ef9b463253a8ec6e4740869234b3cd6699 100644 (file)
@@ -75,8 +75,7 @@ import {
   LayoutModule,
   ContainedListModule,
   LayerModule,
-  ThemeModule,
-  LayoutModule
+  ThemeModule
 } from 'carbon-components-angular';
 
 // Icons
index 7e88c892b8d1b5fb0d5a0db3cbd248f68fa12b46..497c57974541dbd8156b46018ab05f36b8e3e658 100644 (file)
@@ -29,7 +29,7 @@
         <div
           class="cds--type-label-01"
           i18n>
-          Nodes to run NVMe-oF target pods/services
+          Nodes to run NVMe-oF target service
         </div>
       </div>
 
index 42f50767e755154a76c192929417cbe222c3b32d..da53841521efa92cdeb6bb6d61f6e67f257e12af 100644 (file)
@@ -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<number>();
 
   @Input() groupName: string | undefined;
-  @Input() mode: 'selector' | 'details' = 'selector';
+  @Input() mode: 'selector' | 'details' = NvmeofGatewayNodeMode.SELECTOR;
 
   usedHostnames: Set<string> = 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<any> =
-      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;
index aa46f503b5a501e9024fa3100854186e0ef08b9d..890f5b951c3a920ffad6e54132b28d907396195b 100644 (file)
@@ -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
                     };
                   }
index 4a794e11a9f6e075cf5a89199b6ae540f80046c7..f06bec2543f7e5176690e0a8d265ab58f8fe3184 100644 (file)
              let-row="data.row">
   <div [cdsStack]="'horizontal'"
        gap="4">
-  @if (row.enable_ha === false) {
+  @if (row.auth === authType.NO_AUTH) {
     <cd-icon type="warning"></cd-icon>
-    <span class="cds-ml-3"
-          i18n>No authentication</span>
-  } @else if (row.allow_any_host) {
-    <cd-icon type="success"></cd-icon>
-    <span class="cds-ml-3"
-          i18n>Unidirectional</span>
   } @else {
     <cd-icon type="success"></cd-icon>
-    <span class="cds-ml-3"
-          i18n>Bidirectional</span>
   }
+  <span class="cds-ml-3">{{ row.auth }}</span>
   </div>
 </ng-template>
 
index d2de1c4090577437aed50a308d298cedd96f6dd3..bc3edd515229687d6f89853aad8653dfc54c79ad 100644 (file)
@@ -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);
index d7a3f3f2c5b3009c50a8f6ce094f1e98994f6e5c..d2207c2f57750131e67fbb197feb698ccd535684 100644 (file)
@@ -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<void>();
 
@@ -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 };
       })
     );
   }
index 00389576dabff7093b783ee300db3f3241538d3b..6824aa2c16bfb4760c18108b0ac6b32bf0a56470 100644 (file)
@@ -5,7 +5,9 @@
 }
 <div class="sidebar-layout-container">
   <div class="sidebar-layout-shell">
-    <cds-sidenav [expanded]="true">
+    <cds-sidenav
+      [expanded]="true"
+      class="sidebar-layout-nav">
       @for (item of items; track item.label) {
       <cds-sidenav-item
         [route]="item.route"
index 92b594efd0406fd9ce962033b37766757a85ccd7..9393ba965372d3a6f3db85cc1cf305f51f3e4020 100644 (file)
@@ -4,17 +4,34 @@
 
 .sidebar-layout-container {
   min-height: calc(100vh - (vv.$navbar-height + layout.rem(55px)));
-  background-color: var(--cds-background);
   padding-right: var(--cds-spacing-07);
+  background-color: var(--cds-background);
 }
 
 .sidebar-layout-shell {
   transform: translate(0);
   position: relative;
+  height: 100vh;
+}
+
+.sidebar-layout-nav {
+  background-color: var(--cds-layer-03);
 }
 
 .sidebar-layout-main {
   margin-left: layout.rem(272px);
+
+  .cds--table-toolbar {
+    background-color: var(--cds-layer-03);
+  }
+
+  .cds--data-table tbody {
+    background-color: var(--cds-layer-03);
+  }
+
+  .cds--pagination {
+    background-color: var(--cds-layer-03);
+  }
 }
 
 .sidebar-header {
index 59bd8c1c72531d882ef9421faa0f18db45b68066..159708f31901f3b30652e4feec606e2bd5634212 100644 (file)
@@ -80,3 +80,35 @@ export const HOST_TYPE = {
   ALL: 'all',
   SPECIFIC: 'specific'
 };
+
+/**
+ * Determines the authentication status of a subsystem based on PSK and initiators.
+ * Can be reused across subsystem pages.
+ */
+export function getSubsystemAuthStatus(
+  subsystem: NvmeofSubsystem,
+  _initiators: NvmeofSubsystemInitiator[] | { hosts?: NvmeofSubsystemInitiator[] }
+): string {
+  // Import enum value strings to avoid circular dependency
+  const NO_AUTH = 'No authentication';
+  const UNIDIRECTIONAL = 'Unidirectional';
+  const BIDIRECTIONAL = 'Bi-directional';
+
+  if (subsystem.psk) {
+    return BIDIRECTIONAL;
+  }
+
+  let hostsList: NvmeofSubsystemInitiator[] = [];
+  if (_initiators && 'hosts' in _initiators && Array.isArray(_initiators.hosts)) {
+    hostsList = _initiators.hosts;
+  } else if (Array.isArray(_initiators)) {
+    hostsList = _initiators as NvmeofSubsystemInitiator[];
+  }
+
+  const hasDhchapKey = hostsList.some((host) => !!host.dhchap_key);
+  if (hasDhchapKey) {
+    return UNIDIRECTIONAL;
+  }
+
+  return NO_AUTH;
+}