]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix `null` gateway group
authorAfreen Misbah <afreen23.git@gmail.com>
Tue, 24 Sep 2024 11:13:41 +0000 (16:43 +0530)
committerAfreen Misbah <afreen23.git@gmail.com>
Mon, 30 Sep 2024 14:48:29 +0000 (20:18 +0530)
- 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 <afreen23.git@gmail.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts

index c966da9b9c27f98d231595f8a2c06b2391582dea..0ddb8e2f611f6b0d037d58914f5560acc3c3e891 100644 (file)
@@ -52,7 +52,7 @@ export class NvmeofGatewayComponent {
         prop: 'id'
       },
       {
-        name: $localize`Host name`,
+        name: $localize`Hostname`,
         prop: 'hostname'
       },
       {
index 61e28274048f0d29629af87825e9a57b04a71ffb..269e427be50814ad17a020c9505d85d4e1df84ed 100644 (file)
@@ -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() {