From e5d94e24ecf676afc5bca7810459f8d1ebda4642 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Wed, 17 Jun 2020 16:38:25 +0000 Subject: [PATCH] mgr/dashboard: Re-enable OSD's table autoReload Fixes: https://tracker.ceph.com/issues/45303 Signed-off-by: Tiago Melo --- .../osd-details/osd-details.component.html | 26 +++++++++---------- .../osd/osd-details/osd-details.component.ts | 10 +++---- .../osd/osd-list/osd-list.component.html | 3 +-- .../device-list/device-list.component.ts | 19 ++++++++------ 4 files changed, 28 insertions(+), 30 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 569062d66ff..68225e2e467 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 @@ -7,16 +7,14 @@ Devices - +
  • Attributes (OSD map) - +
  • @@ -24,9 +22,9 @@ Metadata - + [data]="osd?.details?.osd_metadata"> Device health - +
  • Performance counter - + [serviceId]="osd?.id">
  • @@ -55,20 +53,20 @@ Histogram - Histogram not available: {{ osd.histogram_failed }} + i18n>Histogram not available: {{ osd?.histogram_failed }}
    + *ngIf="osd?.details?.histogram">

    Writes

    - +

    Reads

    - +
    diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts index 9cac703d262..2ed5e0fe1f7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts @@ -17,7 +17,6 @@ export class OsdDetailsComponent implements OnChanges { osd: { id?: number; - loaded?: boolean; details?: any; histogram_failed?: string; tree?: any; @@ -29,11 +28,11 @@ export class OsdDetailsComponent implements OnChanges { } ngOnChanges() { - this.osd = { - loaded: false - }; - if (this.selection) { + if (this.osd?.id !== this.selection?.id) { this.osd = this.selection; + } + + if (_.isNumber(this.osd?.id)) { this.refresh(); } } @@ -46,7 +45,6 @@ export class OsdDetailsComponent implements OnChanges { this.osd.histogram_failed = data.histogram; this.osd.details.histogram = undefined; } - this.osd.loaded = true; }); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html index 91ddad6ae66..bd687a9daae 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html @@ -5,8 +5,7 @@ OSDs List - (this.devices = devices); - if (this.hostname) { - this.hostService.getDevices(this.hostname).subscribe(updateDevicesFn); - } else if (this.osdId !== null) { - this.osdService.getDevices(this.osdId).subscribe(updateDevicesFn); - } this.columns = [ { prop: 'devid', name: this.i18n('Device ID'), minWidth: 200 }, { @@ -81,4 +75,13 @@ export class DeviceListComponent implements OnInit { { prop: 'readableDaemons', name: this.i18n('Daemons') } ]; } + + ngOnChanges() { + const updateDevicesFn = (devices: CdDevice[]) => (this.devices = devices); + if (this.hostname) { + this.hostService.getDevices(this.hostname).subscribe(updateDevicesFn); + } else if (this.osdId !== null) { + this.osdService.getDevices(this.osdId).subscribe(updateDevicesFn); + } + } } -- 2.47.3