From 2e2ecde82f58f26e1f83e329b254ef97fa989506 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Mon, 10 Oct 2022 11:11:18 +0530 Subject: [PATCH] mgr/dashboard: fix weird data in osd details The devices section in the OSD Details and Host Details shows more than one daemon and device path in the column when you view the details of a single osd details/host details. This is because more than one osd is created on a device with same `deviceid`. I am not sure if this will happen in the real environment but its mostly reproducible in environments with QEMU emulated devices. Fixes: https://tracker.ceph.com/issues/57803 Signed-off-by: Nizamudeen A --- .../osd-details/osd-details.component.html | 4 ++- .../device-list/device-list.component.html | 29 ++++++++++++++++++- .../device-list/device-list.component.ts | 13 ++++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html index d7ac9e40ba5..2b73a710ac3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html @@ -8,7 +8,9 @@ Devices - + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.html index 56fbb965a65..bee1495931c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/device-list/device-list.component.html @@ -8,9 +8,36 @@ - {{location.dev}} + + + + + + + + + + + + + + + + + + + + + ; + @ViewChild('daemonName', { static: true }) + daemonNameTemplate: TemplateRef; @ViewChild('lifeExpectancy', { static: true }) lifeExpectancyTemplate: TemplateRef; @ViewChild('lifeExpectancyTimestamp', { static: true }) @@ -69,16 +74,16 @@ export class DeviceListComponent implements OnChanges, OnInit { isHidden: true }, { prop: 'location', name: $localize`Device Name`, cellTemplate: this.locationTemplate }, - { prop: 'readableDaemons', name: $localize`Daemons` } + { prop: 'daemons', name: $localize`Daemons`, cellTemplate: this.daemonNameTemplate } ]; } ngOnChanges() { const updateDevicesFn = (devices: CdDevice[]) => (this.devices = devices); - if (this.hostname) { - this.hostService.getDevices(this.hostname).subscribe(updateDevicesFn); - } else if (this.osdId !== null) { + if (this.osdList && this.osdId !== null) { this.osdService.getDevices(this.osdId).subscribe(updateDevicesFn); + } else if (this.hostname) { + this.hostService.getDevices(this.hostname).subscribe(updateDevicesFn); } } } -- 2.47.3