From 258223cabcd666ce5ffafe8bf3b6828fc22a7438 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Mon, 5 Nov 2018 16:39:13 +0100 Subject: [PATCH] mgr/dashboard: Improve CRUSH map viewer Display the OSD state using a label. Signed-off-by: Volker Theile --- .../app/ceph/cluster/crushmap/crushmap.component.html | 11 +++++++++-- .../ceph/cluster/crushmap/crushmap.component.spec.ts | 6 +++--- .../app/ceph/cluster/crushmap/crushmap.component.ts | 10 ++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html index d55b2270c294..3b54a12242a9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html @@ -9,7 +9,14 @@
+ (nodeSelected)="onNodeSelected($event)"> + + +   + {{ node.status }} + +
- \ No newline at end of file + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts index 74dac5b774d0..04b0c0d4f75a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.spec.ts @@ -79,9 +79,9 @@ describe('CrushmapComponent', () => { }); it('should have 3 osds in orderd', () => { - expect(component.tree.children[0].children[0].value).toBe('osd.0 (osd)--up'); - expect(component.tree.children[0].children[1].value).toBe('osd.1 (osd)--down'); - expect(component.tree.children[0].children[2].value).toBe('osd.2 (osd)--up'); + expect(component.tree.children[0].children[0].value).toBe('osd.0 (osd)'); + expect(component.tree.children[0].children[1].value).toBe('osd.1 (osd)'); + expect(component.tree.children[0].children[2].value).toBe('osd.2 (osd)'); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts index 9b6290f42429..66b2932b2619 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.ts @@ -49,10 +49,8 @@ export class CrushmapComponent implements OnInit { this.metadataKeyMap[id] = node; const settings = { static: true }; - let value: string = node.name + ' (' + node.type + ')'; - if (node.status) { - value += '--' + node.status; - } + const value: string = node.name + ' (' + node.type + ')'; + const status: string = node.status; const children: any[] = []; if (node.children) { @@ -60,10 +58,10 @@ export class CrushmapComponent implements OnInit { children.push(treeNodeMap[childId]); }); - return { value, settings, id, children }; + return { value, status, settings, id, children }; } - return { value, settings, id }; + return { value, status, settings, id }; } onNodeSelected(e: NodeEvent) { -- 2.47.3