From 338bb5c8a46e2a84fd139c392302e7ff846d3ef8 Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Wed, 23 Aug 2023 18:34:55 +0200 Subject: [PATCH] mgr/dashboard: fix image columns naming Fixes: https://tracker.ceph.com/issues/62551 Signed-off-by: Pedro Gonzalez Gomez --- .../block/rbd-list/rbd-list.component.html | 12 ++++++ .../block/rbd-list/rbd-list.component.spec.ts | 2 +- .../ceph/block/rbd-list/rbd-list.component.ts | 42 +++++++++++-------- .../rbd-snapshot-list.component.ts | 2 +- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html index b16fc4190d87f..1d41589e90d14 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html @@ -142,3 +142,15 @@ + + + Used + + + + Total Used + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts index fa7a772f02239..7490997ef1517 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts @@ -127,7 +127,7 @@ describe('RbdListComponent', () => { '.datatable-body-cell-label span' ); // check image with disk usage = null & fast-diff disabled - expect(spanWithoutFastDiff[6].textContent).toBe('N/A'); + expect(spanWithoutFastDiff[4].textContent).toBe('N/A'); images[0]['features_name'] = ['layering', 'exclusive-lock', 'object-map', 'fast-diff']; component.images = images; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 1c1d79eba0014..b132ef7296546 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -69,6 +69,10 @@ export class RbdListComponent extends ListWithDetails implements OnInit { totalProvisionedNotAvailableTooltipTpl: TemplateRef; @ViewChild('forcePromoteConfirmation', { static: true }) forcePromoteConfirmation: TemplateRef; + @ViewChild('usedTmpl', { static: true }) + usedTmpl: TemplateRef; + @ViewChild('totalUsedTmpl', { static: true }) + totalUsedTmpl: TemplateRef; permission: Permission; tableActions: CdTableAction[]; @@ -272,38 +276,40 @@ export class RbdListComponent extends ListWithDetails implements OnInit { pipe: this.dimlessBinaryPipe }, { - name: $localize`Objects`, - prop: 'num_objs', - flexGrow: 1, + name: $localize`Used`, + prop: 'disk_usage', cellClass: 'text-right', + flexGrow: 1, + pipe: this.dimlessBinaryPipe, sortable: false, - pipe: this.dimlessPipe + headerTemplate: this.usedTmpl, + cellTemplate: this.provisionedNotAvailableTooltipTpl }, { - name: $localize`Object size`, - prop: 'obj_size', - flexGrow: 1, + name: $localize`Total used`, + prop: 'total_disk_usage', cellClass: 'text-right', + flexGrow: 1, + pipe: this.dimlessBinaryPipe, sortable: false, - pipe: this.dimlessBinaryPipe + headerTemplate: this.totalUsedTmpl, + cellTemplate: this.totalProvisionedNotAvailableTooltipTpl }, { - name: $localize`Provisioned`, - prop: 'disk_usage', - cellClass: 'text-center', + name: $localize`Objects`, + prop: 'num_objs', flexGrow: 1, - pipe: this.dimlessBinaryPipe, + cellClass: 'text-right', sortable: false, - cellTemplate: this.provisionedNotAvailableTooltipTpl + pipe: this.dimlessPipe }, { - name: $localize`Total provisioned`, - prop: 'total_disk_usage', - cellClass: 'text-center', + name: $localize`Object size`, + prop: 'obj_size', flexGrow: 1, - pipe: this.dimlessBinaryPipe, + cellClass: 'text-right', sortable: false, - cellTemplate: this.totalProvisionedNotAvailableTooltipTpl + pipe: this.dimlessBinaryPipe }, { name: $localize`Parent`, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index 579b687917389..da8a185ea1cb7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -118,7 +118,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges { pipe: this.dimlessBinaryPipe }, { - name: $localize`Provisioned`, + name: $localize`Used`, prop: 'disk_usage', flexGrow: 1, cellClass: 'text-right', -- 2.39.5