]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Hide ECP actions during ec pool edit
authorStephan Müller <smueller@suse.com>
Mon, 2 Mar 2020 10:48:17 +0000 (11:48 +0100)
committerStephan Müller <smueller@suse.com>
Mon, 9 Mar 2020 11:35:58 +0000 (12:35 +0100)
Hides erasure profile actions during erasure pool edit, as all
actions are disabled anyway as they can't be used in edit mode.

This commit makes also sure that the used crush rule will be shown
during edit of an erasure pool and no crush rule selection is shown
during creation of an erasure code pool, as in most cases a new crush
rule will be created for the ec pool.

Fixes: https://tracker.ceph.com/issues/44371
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html

index 61fc7f4d922191affff6aa5c1bb7e7c954cb0f69..7e87dc8576803eb79702a782590d2ded612c8800 100644 (file)
                   </button>
                   <button class="btn btn-light"
                           type="button"
-                          [disabled]="editing"
+                          *ngIf="!editing"
                           (click)="addErasureCodeProfile()">
                     <i [ngClass]="[icons.add]"
                        aria-hidden="true"></i>
                   </button>
                   <button class="btn btn-light"
                           type="button"
-                          (click)="deleteErasureCodeProfile()"
-                          [disabled]="editing || ecProfiles.length < 1">
+                          *ngIf="!editing"
+                          (click)="deleteErasureCodeProfile()">
                     <i [ngClass]="[icons.trash]"
                        aria-hidden="true"></i>
                   </button>
           </div>
 
           <!-- Crush ruleset selection -->
-          <div class="form-group row">
+          <div class="form-group row"
+               *ngIf="isErasure && !editing">
+            <label class="cd-col-form-label"
+                   for="crushRule"
+                   i18n>Crush ruleset</label>
+            <div class="cd-col-form-input">
+              <span class="form-text text-muted"
+                    i18n>A new crush ruleset will be implicitly created.</span>
+            </div>
+          </div>
+          <div class="form-group row"
+               *ngIf="isReplicated || editing">
             <label class="cd-col-form-label"
                    for="crushRule"
                    i18n>Crush ruleset</label>
               <ng-template #noRules>
                 <span class="form-text text-muted">
                   <span i18n>There are no rules.</span>&nbsp;
-                  <span *ngIf="form.getValue('poolType') === 'erasure'"
-                        i18n>A new crush ruleset will be implicitly created.</span>
                 </span>
               </ng-template>
               <div *ngIf="current.rules.length > 0; else noRules">