From: Tiago Melo Date: Wed, 17 Jun 2020 16:38:25 +0000 (+0000) Subject: mgr/dashboard: Re-enable OSD's table autoReload X-Git-Tag: v16.1.0~1856^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5d94e24ecf676afc5bca7810459f8d1ebda4642;p=ceph.git mgr/dashboard: Re-enable OSD's table autoReload Fixes: https://tracker.ceph.com/issues/45303 Signed-off-by: Tiago Melo --- 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 569062d66ffc..68225e2e4674 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 9cac703d2622..2ed5e0fe1f76 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 91ddad6ae668..bd687a9daae6 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); + } + } }