Skip to content

Commit 48d1517

Browse files
committed
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 <[email protected]>
1 parent 16f3dad commit 48d1517

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class NvmeofGatewayComponent {
5252
prop: 'id'
5353
},
5454
{
55-
name: $localize`Host name`,
55+
name: $localize`Hostname`,
5656
prop: 'hostname'
5757
},
5858
{

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,8 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit
7979
this.router.navigate([BASE_URL, { outlets: { modal: [URLVerbs.CREATE] } }], {
8080
queryParams: { group: this.group }
8181
}),
82-
canBePrimary: (selection: CdTableSelection) => !selection.hasSelection
83-
},
84-
{
85-
name: this.actionLabels.EDIT,
86-
permission: 'update',
87-
icon: Icons.edit,
88-
click: () =>
89-
this.router.navigate([
90-
BASE_URL,
91-
{
92-
outlets: {
93-
modal: [
94-
URLVerbs.EDIT,
95-
this.selection.first().nqn,
96-
this.selection.first().max_namespaces
97-
]
98-
}
99-
}
100-
])
82+
canBePrimary: (selection: CdTableSelection) => !selection.hasSelection,
83+
disable: () => !this.group
10184
},
10285
{
10386
name: this.actionLabels.DELETE,
@@ -114,12 +97,16 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit
11497
}
11598

11699
getSubsystems() {
117-
this.nvmeofService
118-
.listSubsystems(this.group)
119-
.subscribe((subsystems: NvmeofSubsystem[] | NvmeofSubsystem) => {
120-
if (Array.isArray(subsystems)) this.subsystems = subsystems;
121-
else this.subsystems = [subsystems];
122-
});
100+
if (this.group) {
101+
this.nvmeofService
102+
.listSubsystems(this.group)
103+
.subscribe((subsystems: NvmeofSubsystem[] | NvmeofSubsystem) => {
104+
if (Array.isArray(subsystems)) this.subsystems = subsystems;
105+
else this.subsystems = [subsystems];
106+
});
107+
} else {
108+
this.subsystems = [];
109+
}
123110
}
124111

125112
deleteSubsystemModal() {

0 commit comments

Comments
 (0)