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: v17.2.6~451^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3e6ec3881c8657f4decabe9fe5fce4a0c1e81e5;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 (cherry picked from commit 2e2ecde82f58f26e1f83e329b254ef97fa989506) --- 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 56eee8c8b9c4..f250279f8783 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 56fbb965a659..bee1495931c9 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); } } }