]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: rbd image hide usage bar when disk usage is not provided 53809/head
authorPedro Gonzalez Gomez <pegonzal@redhat.com>
Mon, 2 Oct 2023 08:35:08 +0000 (10:35 +0200)
committerPedro Gonzalez Gomez <pegonzal@redhat.com>
Wed, 4 Oct 2023 09:10:20 +0000 (11:10 +0200)
Fixes: https://tracker.ceph.com/issues/63037
Signed-off-by: Pedro Gonzalez Gomez <pegonzal@redhat.com>
(cherry picked from commit 17d87af98a60471fc72cab4e6d5a53caf1847842)

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.ts

index 1d2a5441fcc084c3bd064aadb16ee6fdef658d06..bfd4f851b63c783f68584619894f08f3298e6f5e 100644 (file)
   </cd-rbd-details>
 </cd-table>
 
-<ng-template #scheduleStatus>
-  <div i18n
-       [innerHtml]="'Only available for RBD images with <strong>fast-diff</strong> enabled'"></div>
-</ng-template>
-
-<ng-template #provisionedNotAvailableTooltipTpl
-             let-row="row">
-  <span *ngIf="row.disk_usage === null && !row.features_name.includes('fast-diff'); else provisioned"
-        [ngbTooltip]="usageNotAvailableTooltipTpl"
-        placement="top"
-        i18n>N/A</span>
-  <ng-template #provisioned
-               i18n>{{row.disk_usage | dimlessBinary}}</ng-template>
-</ng-template>
-
-<ng-template #totalProvisionedNotAvailableTooltipTpl
-             let-row="row">
-  <span *ngIf="row.total_disk_usage === null && !row.features_name.includes('fast-diff'); else totalProvisioned"
-        [ngbTooltip]="usageNotAvailableTooltipTpl"
-        placement="top"
-        i18n>N/A</span>
-  <ng-template #totalProvisioned
-               i18n>{{row.total_disk_usage | dimlessBinary}}</ng-template>
-</ng-template>
-
 <ng-template #parentTpl
              let-value="value">
   <span *ngIf="value">{{ value.pool_name }}<span
 
 <ng-template #imageUsageTpl
              let-row="row">
-  <cd-usage-bar *ngIf="row"
-                [total]="row.size"
-                [used]="row.disk_usage"
-                [title]="row.name"
-                decimals="2">
+  <span *ngIf="row.features_name && (!row.features_name.includes('fast-diff') || row.mirror_mode === 'snapshot') ; else usageBar"
+        [ngbTooltip]="usageTooltip">
+    <span>-</span>
+  </span>
+  <ng-template #usageBar>
+    <cd-usage-bar *ngIf="row"
+                  [total]="row.size"
+                  [used]="row.disk_usage"
+                  [title]="row.name"
+                  decimals="2">
   </cd-usage-bar>
+  </ng-template>
+
+</ng-template>
+
+<ng-template #usageTooltip>
+  <div i18n
+       [innerHtml]="'Only available for RBD images with <strong>fast-diff</strong> enabled and without snapshot mirroring'"></div>
 </ng-template>
index 5cb9d1af9c76ad5d1ba5ce2b45b53c363974f7a2..37b9758ccc0bca568ba5bc50657cd7883cbc3b6f 100644 (file)
@@ -63,10 +63,6 @@ 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 })