# All files / src/app/ceph/cluster/osd/osd-recv-speed-modal osd-recv-speed-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
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    977x

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

      <ng-container class="modal-content">
        <form class="form-horizontal"
              #formDir="ngForm"
              [formGroup]="osdRecvSpeedForm"
              novalidate>
          <div class="modal-body">
            <!-- Priority -->
            <div class="form-group"
                 [ngClass]="{'has-error': osdRecvSpeedForm.showError('priority', formDir)}">
              <label class="control-label col-sm-6"
                     for="priority">
                <ng-container i18n>Priority</ng-container>
                <span class="required"></span>
              </label>
              <div class="col-sm-6">
                <select class="form-control"
                        formControlName="priority"
                        id="priority"
                        (change)="onPriorityChange($event.target.value)">
                  <option *ngFor="let priority of priorities"
                          [value]="priority.name">
                    {{ priority.text }}
                  </option>
                </select>
                <span class="help-block"
                      *ngIf="osdRecvSpeedForm.showError('priority', formDir, 'required')"
                      i18n>This field is required.</span>
              </div>
            </div>

            <!-- Customize priority -->
            <div class="form-group">
              <div class="col-sm-offset-6 col-sm-6">
                <div class="checkbox checkbox-primary">
                  <input formControlName="customizePriority"
                         id="customizePriority"
                         type="checkbox"
                         (change)="onCustomizePriorityChange()">
                  <label i18n
                         for="customizePriority">Customize priority values</label>
                </div>
              </div>
            </div>

            <!-- Priority values -->
            <div class="form-group" *ngFor="let attr of priorityAttrs | keyvalue"
                 [ngClass]="{'has-error': osdRecvSpeedForm.getValue('customizePriority') &&
                 osdRecvSpeedForm.showError(attr.key, formDir)}">
              <label class="control-label col-sm-6"
                     [for]="attr.key">{{ attr.value.text }}
                <cd-helper *ngIf="attr.value.desc">{{ attr.value.desc }}</cd-helper>
                <span class="required" *ngIf="osdRecvSpeedForm.getValue('customizePriority')"></span>
              </label>
              <div class="col-sm-6">
                <input class="form-control"
                       type="number"
                       [id]="attr.key"
                       [formControlName]="attr.key"
                       [readonly]="!osdRecvSpeedForm.getValue('customizePriority')">
                <span class="help-block"
                      *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
                      osdRecvSpeedForm.showError(attr.key, formDir, 'required')"
                      i18n>This field is required!</span>
                <span class="help-block"
                      *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
                      osdRecvSpeedForm.showError(attr.key, formDir, 'pattern')"
                      i18n>{{ attr.value.patternHelpText }}</span>
                <span class="help-block"
                      *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
                      osdRecvSpeedForm.showError(attr.key, formDir, 'max')"
                      i18n>The entered value is too high! It must not be greater than {{ attr.value.maxValue }}.</span>
                <span class="help-block"
                      *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
                      osdRecvSpeedForm.showError(attr.key, formDir, 'min')"
                      i18n>The entered value is too low! It must not be lower than {{ attr.value.minValue }}.</span>
              </div>
            </div>
          </div>
          <div class="modal-footer">
            <div class="button-group text-right">
              <cd-submit-button (submitAction)="submitAction()"
                                [form]="osdRecvSpeedForm"
                                i18n>Submit</cd-submit-button>
              <cd-back-button [back]="bsModalRef.hide"
                              name="Cancel"
                              i18n-name>
              </cd-back-button>
            </div>
          </div>
        </form>
      </ng-container>
    </cd-modal>