]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
978d1b95040575c76a009afaf0e34e32c925cb58
[ceph.git] /
1 <cd-modal [modalRef]="bsModalRef">
2   <ng-container class="modal-title"
3                 i18n>OSD Recovery Priority</ng-container>
4
5   <ng-container class="modal-content">
6     <form #formDir="ngForm"
7           [formGroup]="osdRecvSpeedForm"
8           novalidate>
9       <div class="modal-body">
10         <!-- Priority -->
11         <div class="form-group row">
12           <label class="col-form-label col-sm-6"
13                  for="priority">
14             <ng-container i18n>Priority</ng-container>
15             <span class="required"></span>
16           </label>
17           <div class="col-sm-6">
18             <select class="form-control custom-select"
19                     formControlName="priority"
20                     id="priority"
21                     (change)="onPriorityChange($event.target.value)">
22               <option *ngFor="let priority of priorities"
23                       [value]="priority.name">
24                 {{ priority.text }}
25               </option>
26             </select>
27             <span class="invalid-feedback"
28                   *ngIf="osdRecvSpeedForm.showError('priority', formDir, 'required')"
29                   i18n>This field is required.</span>
30           </div>
31         </div>
32
33         <!-- Customize priority -->
34         <div class="form-group row">
35           <div class="offset-sm-6 col-sm-6">
36             <div class="custom-control custom-checkbox">
37               <input formControlName="customizePriority"
38                      class="custom-control-input"
39                      id="customizePriority"
40                      name="customizePriority"
41                      type="checkbox"
42                      (change)="onCustomizePriorityChange()">
43               <label class="custom-control-label"
44                      for="customizePriority"
45                      i18n>Customize priority values</label>
46             </div>
47           </div>
48         </div>
49
50         <!-- Priority values -->
51         <div class="form-group row"
52              *ngFor="let attr of priorityAttrs | keyvalue">
53           <label class="col-form-label col-sm-6"
54                  [for]="attr.key">{{ attr.value.text }}
55             <cd-helper *ngIf="attr.value.desc">{{ attr.value.desc }}</cd-helper>
56             <span class="required"
57                   *ngIf="osdRecvSpeedForm.getValue('customizePriority')"></span>
58           </label>
59           <div class="col-sm-6">
60             <input class="form-control"
61                    type="number"
62                    [id]="attr.key"
63                    [formControlName]="attr.key"
64                    [readonly]="!osdRecvSpeedForm.getValue('customizePriority')">
65             <span class="invalid-feedback"
66                   *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
67                   osdRecvSpeedForm.showError(attr.key, formDir, 'required')"
68                   i18n>This field is required!</span>
69             <span class="invalid-feedback"
70                   *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
71                   osdRecvSpeedForm.showError(attr.key, formDir, 'pattern')"
72                   i18n>{{ attr.value.patternHelpText }}</span>
73             <span class="invalid-feedback"
74                   *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
75                   osdRecvSpeedForm.showError(attr.key, formDir, 'max')"
76                   i18n>The entered value is too high! It must not be greater than {{ attr.value.maxValue }}.</span>
77             <span class="invalid-feedback"
78                   *ngIf="osdRecvSpeedForm.getValue('customizePriority') &&
79                   osdRecvSpeedForm.showError(attr.key, formDir, 'min')"
80                   i18n>The entered value is too low! It must not be lower than {{ attr.value.minValue }}.</span>
81           </div>
82         </div>
83       </div>
84       <div class="modal-footer">
85         <div class="button-group text-right">
86           <cd-submit-button *ngIf="permissions.configOpt.update"
87                             (submitAction)="submitAction()"
88                             [form]="osdRecvSpeedForm"
89                             i18n>Submit</cd-submit-button>
90           <cd-back-button [back]="bsModalRef.hide"
91                           name="Cancel"
92                           i18n-name>
93           </cd-back-button>
94         </div>
95       </div>
96     </form>
97   </ng-container>
98 </cd-modal>