From 48d1517b417ae2b21ca2e7fac9e76afc394659dc Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Tue, 24 Sep 2024 16:43:41 +0530 Subject: [PATCH] mgr/dashboard: Fix `null` gateway group - when no group is set a bad request is made `?gw_group=null` - this causes a dashboard exception to be raised as well - avoiding sending any request when no group is present - fixes casing of "hostname" in gateway column Fixes https://tracker.ceph.com/issues/68230 Signed-off-by: Afreen Misbah --- .../nvmeof-gateway.component.ts | 2 +- .../nvmeof-subsystems.component.ts | 37 ++++++------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts index c966da9b9c2..0ddb8e2f611 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts @@ -52,7 +52,7 @@ export class NvmeofGatewayComponent { prop: 'id' }, { - name: $localize`Host name`, + name: $localize`Hostname`, prop: 'hostname' }, { 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 61e28274048..269e427be50 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 @@ -79,25 +79,8 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit this.router.navigate([BASE_URL, { outlets: { modal: [URLVerbs.CREATE] } }], { queryParams: { group: this.group } }), - canBePrimary: (selection: CdTableSelection) => !selection.hasSelection - }, - { - name: this.actionLabels.EDIT, - permission: 'update', - icon: Icons.edit, - click: () => - this.router.navigate([ - BASE_URL, - { - outlets: { - modal: [ - URLVerbs.EDIT, - this.selection.first().nqn, - this.selection.first().max_namespaces - ] - } - } - ]) + canBePrimary: (selection: CdTableSelection) => !selection.hasSelection, + disable: () => !this.group }, { name: this.actionLabels.DELETE, @@ -114,12 +97,16 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit } getSubsystems() { - this.nvmeofService - .listSubsystems(this.group) - .subscribe((subsystems: NvmeofSubsystem[] | NvmeofSubsystem) => { - if (Array.isArray(subsystems)) this.subsystems = subsystems; - else this.subsystems = [subsystems]; - }); + if (this.group) { + this.nvmeofService + .listSubsystems(this.group) + .subscribe((subsystems: NvmeofSubsystem[] | NvmeofSubsystem) => { + if (Array.isArray(subsystems)) this.subsystems = subsystems; + else this.subsystems = [subsystems]; + }); + } else { + this.subsystems = []; + } } deleteSubsystemModal() { -- 2.39.5