From: Nizamudeen A Date: Mon, 10 Oct 2022 05:41:18 +0000 (+0530) Subject: mgr/dashboard: fix weird data in osd details X-Git-Tag: v18.1.0~1028^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2e2ecde82f58f26e1f83e329b254ef97fa989506;p=ceph.git 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 --- 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); } } }