]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix image columns naming 53100/head
authorPedro Gonzalez Gomez <pegonzal@redhat.com>
Wed, 23 Aug 2023 16:34:55 +0000 (18:34 +0200)
committerPedro Gonzalez Gomez <pegonzal@redhat.com>
Wed, 30 Aug 2023 08:12:18 +0000 (10:12 +0200)
Fixes: https://tracker.ceph.com/issues/62551
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts

index b16fc4190d87f79ad9b41527d1466a37da11c375..1d41589e90d14519f0c8eb31ced1090740b1a741 100644 (file)
     </strong>
   </div>
 </ng-template>
+
+<ng-template #usedTmpl>
+  <span i18n
+        i18n-ngbTooltip
+        ngbTooltip="Stored data">Used</span>
+</ng-template>
+
+<ng-template #totalUsedTmpl>
+  <span i18n
+        i18n-ngbTooltip
+        ngbTooltip="Total space used by the image">Total Used</span>
+</ng-template>
index fa7a772f02239654f975a54bbb6330c6dc8a5bce..7490997ef1517863242542a90fc8cf11cff203a1 100644 (file)
@@ -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;
index 1c1d79eba0014cd30b64f9d4b74c70c25a3405e8..b132ef72965466ad9ebf2ab06467f6ed476923b2 100644 (file)
@@ -69,6 +69,10 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
   totalProvisionedNotAvailableTooltipTpl: TemplateRef<any>;
   @ViewChild('forcePromoteConfirmation', { static: true })
   forcePromoteConfirmation: TemplateRef<any>;
+  @ViewChild('usedTmpl', { static: true })
+  usedTmpl: TemplateRef<any>;
+  @ViewChild('totalUsedTmpl', { static: true })
+  totalUsedTmpl: TemplateRef<any>;
 
   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`,
index 579b687917389fa4697c061e88f959b5dbdfa1af..da8a185ea1cb7739358e2dbbe1265a678ad7b880 100644 (file)
@@ -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',