]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / rbd-list / rbd-list.component.ts
index 10230035d29887709f4fffd7e0f7eeec28fb0d93..8fc36a4cb479d64fb3680f4fb5815fb1c9f90038 100644 (file)
@@ -63,12 +63,14 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
   deleteTpl: TemplateRef<any>;
   @ViewChild('removingStatTpl', { static: true })
   removingStatTpl: TemplateRef<any>;
-  @ViewChild('provisionedNotAvailableTooltipTpl', { static: true })
-  provisionedNotAvailableTooltipTpl: TemplateRef<any>;
-  @ViewChild('totalProvisionedNotAvailableTooltipTpl', { static: true })
-  totalProvisionedNotAvailableTooltipTpl: TemplateRef<any>;
   @ViewChild('forcePromoteConfirmation', { static: true })
   forcePromoteConfirmation: TemplateRef<any>;
+  @ViewChild('usedTmpl', { static: true })
+  usedTmpl: TemplateRef<any>;
+  @ViewChild('totalUsedTmpl', { static: true })
+  totalUsedTmpl: TemplateRef<any>;
+  @ViewChild('imageUsageTpl', { static: true })
+  imageUsageTpl: TemplateRef<any>;
 
   permission: Permission;
   tableActions: CdTableAction[];
@@ -214,14 +216,22 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
       icon: Icons.edit,
       click: () => this.actionPrimary(true),
       name: this.actionLabels.PROMOTE,
-      visible: () => this.selection.first() != null && !this.selection.first().primary
+      visible: () => this.selection.first() != null && !this.selection.first().primary,
+      disable: () =>
+        this.selection.first().mirror_mode === 'Disabled'
+          ? 'Mirroring needs to be enabled on the image to perform this action'
+          : ''
     };
     const demoteAction: CdTableAction = {
       permission: 'update',
       icon: Icons.edit,
       click: () => this.actionPrimary(false),
       name: this.actionLabels.DEMOTE,
-      visible: () => this.selection.first() != null && this.selection.first().primary
+      visible: () => this.selection.first() != null && this.selection.first().primary,
+      disable: () =>
+        this.selection.first().mirror_mode === 'Disabled'
+          ? 'Mirroring needs to be enabled on the image to perform this action'
+          : ''
     };
     this.tableActions = [
       addAction,
@@ -263,6 +273,12 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
         sortable: false,
         pipe: this.dimlessBinaryPipe
       },
+      {
+        name: $localize`Usage`,
+        prop: 'usage',
+        cellTemplate: this.imageUsageTpl,
+        flexGrow: 1.5
+      },
       {
         name: $localize`Objects`,
         prop: 'num_objs',
@@ -279,24 +295,6 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
         sortable: false,
         pipe: this.dimlessBinaryPipe
       },
-      {
-        name: $localize`Provisioned`,
-        prop: 'disk_usage',
-        cellClass: 'text-center',
-        flexGrow: 1,
-        pipe: this.dimlessBinaryPipe,
-        sortable: false,
-        cellTemplate: this.provisionedNotAvailableTooltipTpl
-      },
-      {
-        name: $localize`Total provisioned`,
-        prop: 'total_disk_usage',
-        cellClass: 'text-center',
-        flexGrow: 1,
-        pipe: this.dimlessBinaryPipe,
-        sortable: false,
-        cellTemplate: this.totalProvisionedNotAvailableTooltipTpl
-      },
       {
         name: $localize`Parent`,
         prop: 'parent',