# All files / src/app/ceph/cluster/osd/osd-reweight-modal osd-reweight-modal.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    397x

     <cd-modal [modalRef]="bsModalRef">
      <ng-container class="modal-title"
                    i18n>Reweight OSD</ng-container>

      <ng-container class="modal-content">
        <form class="form-horizontal"
              [formGroup]="reweightForm">
          <div class="modal-body" [ngClass]="{'has-error': weight.errors}">
            <div class="row">
              <label for="weight" class="col-sm-2 control-label">Weight</label>
              <div class="col-sm-10">
                <input id="weight" class="form-control" type="number"
                       step="0.1" formControlName="weight" min="0" max="1"
                       [value]="currentWeight">
                <span class="help-block"
                      *ngIf="weight.errors">
                  <span *ngIf="weight.errors?.required"
                        i18n>This field is required.</span>
                  <span *ngIf="weight.errors?.max || weight.errors?.min"
                        i18n>The value needs to be between 0 and 1.</span>
                </span>
              </div>
            </div>
          </div>

          <div class="modal-footer">
            <cd-submit-button (submitAction)="reweight()"
                              [form]="reweightForm"
                              [disabled]="reweightForm.invalid"
                              i18n>Reweight</cd-submit-button>
            <cd-back-button [back]="bsModalRef.hide"
                            name="Cancel"
                            i18n-name>
            </cd-back-button>
          </div>
        </form>
      </ng-container>
    </cd-modal>