Skip to content

Commit 258a455

Browse files
committed
mgr/dashboard: add nvmeof performance and overview grafana dashboards to Block -> Nvme/TCP tab in dashboard
Fixes: https://tracker.ceph.com/issues/70793 Signed-off-by: Aashish Sharma <[email protected]>
1 parent 7a4d7c5 commit 258a455

File tree

8 files changed

+109
-20
lines changed

8 files changed

+109
-20
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ import {
6363
RadioModule,
6464
SelectModule,
6565
UIShellModule,
66-
TreeviewModule
66+
TreeviewModule,
67+
TabsModule
6768
} from 'carbon-components-angular';
6869

6970
// Icons
@@ -97,7 +98,8 @@ import Reset from '@carbon/icons/es/reset/32';
9798
NumberModule,
9899
ModalModule,
99100
DatePickerModule,
100-
ComboBoxModule
101+
ComboBoxModule,
102+
TabsModule
101103
],
102104
declarations: [
103105
RbdListComponent,

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

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,71 @@
1515
</cds-combo-box>
1616
</div>
1717

18-
<legend i18n>
19-
Gateways
20-
<cd-help-text>
21-
Ceph NVMe-oF gateways provide Ceph Block Device storage through NVMe/TCP. For VMware clients the NVMe/TCP volumes display as VMFS Datastores. For Linux clients the NVMe/TCP volumes display as as block devices.</cd-help-text>
22-
</legend>
23-
<div>
24-
<cd-table [data]="gateways"
25-
(fetchData)="getGateways()"
26-
[columns]="gatewayColumns">
27-
</cd-table>
28-
</div>
29-
3018
<ng-template #statusTpl
3119
let-row="data.row">
3220
<span class="badge"
3321
[ngClass]="row | pipeFunction:getStatusClass">
3422
{{ row.status_desc }}
3523
</span>
3624
</ng-template>
25+
26+
<cds-tabs
27+
type="contained"
28+
followFocus="true"
29+
isNavigation="true"
30+
[cacheActive]="false">
31+
<cds-tab
32+
heading="Gateways"
33+
[tabContent]="gateways_content"
34+
i18n-heading
35+
(selected)="onSelected(Tabs.gateways)">
36+
</cds-tab>
37+
<cds-tab
38+
heading="Overview"
39+
[tabContent]="overview_content"
40+
i18n-heading
41+
(selected)="onSelected(Tabs.overview)">
42+
</cds-tab>
43+
<cds-tab
44+
heading="Performance"
45+
[tabContent]="performance_content"
46+
i18n-heading
47+
(selected)="onSelected(Tabs.overview)">
48+
</cds-tab>
49+
</cds-tabs>
50+
51+
<ng-template #gateways_content>
52+
<legend *ngIf="selectedTab === Tabs.gateways"
53+
i18n>
54+
Gateways
55+
<cd-help-text>
56+
Ceph NVMe-oF gateways provide Ceph Block Device storage through NVMe/TCP. For VMware clients the NVMe/TCP volumes display as VMFS Datastores. For Linux clients the NVMe/TCP volumes display as as block devices.
57+
</cd-help-text>
58+
</legend>
59+
<div>
60+
<cd-table [data]="gateways"
61+
(fetchData)="getGateways()"
62+
[columns]="gatewayColumns">
63+
</cd-table>
64+
</div>
65+
</ng-template>
66+
67+
<ng-template #overview_content>
68+
<cd-grafana i18n-title
69+
title="Gateway overview"
70+
grafanaPath="ceph-nvme-of-gateways-overview?var-group={{selectedGatewayGroup}}&var-gateway=All"
71+
[type]="'metrics'"
72+
uid="feeuv1dno43r4ddjhjssdd"
73+
grafanaStyle="three">
74+
</cd-grafana>
75+
</ng-template>
76+
77+
<ng-template #performance_content>
78+
<cd-grafana i18n-title
79+
title="Gateway performance"
80+
grafanaPath="ceph-nvme-of-gateways-performance?var-group={{selectedGatewayGroup}}"
81+
[type]="'metrics'"
82+
uid="feeuv1dno43r4deed"
83+
grafanaStyle="three">
84+
</cd-grafana>
85+
</ng-template>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,28 @@ type Gateway = {
2323
status_desc: string;
2424
};
2525

26+
enum TABS {
27+
'gateways',
28+
'overview'
29+
}
30+
2631
@Component({
2732
selector: 'cd-nvmeof-gateway',
2833
templateUrl: './nvmeof-gateway.component.html',
2934
styleUrls: ['./nvmeof-gateway.component.scss']
3035
})
3136
export class NvmeofGatewayComponent implements OnInit {
37+
selectedTab: TABS;
38+
selectedGatewayGroup: string = null;
39+
40+
onSelected(tab: TABS) {
41+
this.selectedTab = tab;
42+
}
43+
44+
public get Tabs(): typeof TABS {
45+
return TABS;
46+
}
47+
3248
@ViewChild('statusTpl', { static: true })
3349
statusTpl: TemplateRef<any>;
3450

@@ -96,6 +112,7 @@ export class NvmeofGatewayComponent implements OnInit {
96112
onGroupSelection(selected: ComboBoxItem) {
97113
selected.selected = true;
98114
this.groupService = selected.serviceName;
115+
this.selectedGatewayGroup = selected.content;
99116
this.getGateways();
100117
}
101118

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@
3838
</cd-nvmeof-initiators-list>
3939
</ng-template>
4040
</ng-container>
41+
<ng-container ngbNavItem="performance-details"
42+
*ngIf="permissions.grafana.read">
43+
<a ngbNavLink
44+
i18n>Performance Details</a>
45+
<ng-template ngbNavContent>
46+
<cd-grafana i18n-title
47+
title="Subsystem details"
48+
grafanaPath="ceph-nvme-of-gateways-performance?var-group={{group}}&var-subsystem={{subsystemNQN}}"
49+
[type]="'metrics'"
50+
uid="feeuv1dno43r4deed"
51+
grafanaStyle="three">
52+
</cd-grafana>
53+
</ng-template>
54+
</ng-container>
4155
</nav>
4256

4357
<div [ngbNavOutlet]="nav"></div>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
33
import { ComponentFixture, TestBed } from '@angular/core/testing';
44

55
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
6-
6+
import { Permissions } from '~/app/shared/models/permissions';
77
import { SharedModule } from '~/app/shared/shared.module';
88
import { NvmeofSubsystemsDetailsComponent } from './nvmeof-subsystems-details.component';
99

@@ -29,6 +29,9 @@ describe('NvmeofSubsystemsDetailsComponent', () => {
2929
namespace_count: 1,
3030
max_namespaces: 256
3131
};
32+
component.permissions = new Permissions({
33+
grafana: ['read']
34+
});
3235
component.ngOnChanges();
3336
fixture.detectChanges();
3437
});

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, Input, OnChanges } from '@angular/core';
22
import { NvmeofSubsystem } from '~/app/shared/models/nvmeof';
3+
import { Permissions } from '~/app/shared/models/permissions';
34

45
@Component({
56
selector: 'cd-nvmeof-subsystems-details',
@@ -10,7 +11,9 @@ export class NvmeofSubsystemsDetailsComponent implements OnChanges {
1011
@Input()
1112
selection: NvmeofSubsystem;
1213
@Input()
13-
group: NvmeofSubsystem;
14+
group: string;
15+
@Input()
16+
permissions: Permissions;
1417

1518
selectedItem: any;
1619
data: any;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
(updateSelection)="updateSelection($event)">
3232

3333
<div class="table-actions">
34-
<cd-table-actions [permission]="permission"
34+
<cd-table-actions [permission]="permissions.nvmeof"
3535
[selection]="selection"
3636
class="btn-group"
3737
[tableActions]="tableActions">
@@ -40,6 +40,7 @@
4040

4141
<cd-nvmeof-subsystems-details *cdTableDetail
4242
[selection]="expandedRow"
43+
[permissions]="permissions"
4344
[group]="group">
4445
</cd-nvmeof-subsystems-details>
4546
</cd-table>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
44
import { ActionLabelsI18n, URLVerbs } from '~/app/shared/constants/app.constants';
55
import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
66
import { NvmeofSubsystem } from '~/app/shared/models/nvmeof';
7-
import { Permission } from '~/app/shared/models/permissions';
7+
import { Permissions } from '~/app/shared/models/permissions';
88
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
99
import { ListWithDetails } from '~/app/shared/classes/list-with-details.class';
1010
import { CdTableAction } from '~/app/shared/models/cd-table-action';
@@ -31,7 +31,7 @@ const BASE_URL = 'block/nvmeof/subsystems';
3131
export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit {
3232
subsystems: NvmeofSubsystem[] = [];
3333
subsystemsColumns: any;
34-
permission: Permission;
34+
permissions: Permissions;
3535
selection = new CdTableSelection();
3636
tableActions: CdTableAction[];
3737
subsystemDetails: any[];
@@ -48,7 +48,7 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit
4848
private route: ActivatedRoute
4949
) {
5050
super();
51-
this.permission = this.authStorageService.getPermissions().nvmeof;
51+
this.permissions = this.authStorageService.getPermissions();
5252
}
5353

5454
ngOnInit() {

0 commit comments

Comments
 (0)