]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #34606 from rhcs-dashboard/wip-45011-bucket-usage-feature
authorLenz Grimmer <lgrimmer@suse.com>
Thu, 25 Jun 2020 12:49:01 +0000 (14:49 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2020 12:49:01 +0000 (14:49 +0200)
mgr/dashboard: Display users current bucket quota usage

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
1  2 
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/usage-bar/usage-bar.component.ts

index aee75c724f28497edcc441f817d408428bd07afb,727d44b35f2baf90956e12324915ba707ec165f3..91ddad6ae66884a1f99b641f1a1993c74c38dea9
  
  <ng-template #osdUsageTpl
               let-row="row">
-   <cd-usage-bar [totalBytes]="row.stats.stat_bytes"
-                 [usedBytes]="row.stats.stat_bytes_used">
+   <cd-usage-bar [total]="row.stats.stat_bytes"
+                 [used]="row.stats.stat_bytes_used">
    </cd-usage-bar>
  </ng-template>
 +
 +<ng-template #deleteOsdExtraTpl
 +             let-form="form">
 +  <ng-container [formGroup]="form">
 +    <ng-container formGroupName="child">
 +      <div class="form-group">
 +        <div class="custom-control custom-checkbox">
 +          <input type="checkbox"
 +                 class="custom-control-input"
 +                 name="preserve"
 +                 id="preserve"
 +                 formControlName="preserve"
 +                 autofocus>
 +          <label class="custom-control-label"
 +                 for="preserve"
 +                 i18n>Preserve OSD ID(s) for replacement.</label>
 +        </div>
 +      </div>
 +    </ng-container>
 +  </ng-container>
 +</ng-template>
index 789e41cb4d6a50b23a22d53e2d0858e9ed6bd0c1,40e110e3f27229a311319969d5e8b7e21bd98717..99b6aa60df69f1b2ca73c74df45696e17857beb2
@@@ -13,11 -15,11 +15,9 @@@ export class UsageBarComponent implemen
  
    usedPercentage: number;
    freePercentage: number;
-   freeBytes: number;
  
 -  constructor() {}
 -
    ngOnChanges() {
-     this.usedPercentage = Math.round((this.usedBytes / this.totalBytes) * 100);
+     this.usedPercentage = this.total > 0 ? Math.round((this.used / this.total) * 100) : 0;
      this.freePercentage = 100 - this.usedPercentage;
-     this.freeBytes = this.totalBytes - this.usedBytes;
    }
  }