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