1 <cd-modal [modalRef]="bsModalRef">
2 <ng-container class="modal-title"
3 i18n>OSD Recovery Priority</ng-container>
5 <ng-container class="modal-content">
6 <form class="form-horizontal"
8 [formGroup]="osdRecvSpeedForm"
10 <div class="modal-body">
12 <div class="form-group"
13 [ngClass]="{'has-error': osdRecvSpeedForm.showError('priority', formDir)}">
14 <label class="control-label col-sm-6"
16 <ng-container i18n>Priority</ng-container>
17 <span class="required"></span>
19 <div class="col-sm-6">
20 <select class="form-control"
21 formControlName="priority"
23 (change)="onPriorityChange($event.target.value)">
24 <option *ngFor="let priority of priorities"
25 [value]="priority.name">
29 <span class="help-block"
30 *ngIf="osdRecvSpeedForm.showError('priority', formDir, 'required')"
31 i18n>This field is required.</span>
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"
42 (change)="onCustomizePriorityChange()">
44 for="customizePriority">Customize priority values</label>
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>
58 <div class="col-sm-6">
59 <input class="form-control"
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>
83 <div class="modal-footer">
84 <div class="button-group text-right">
85 <cd-submit-button (submitAction)="submitAction()"
86 [form]="osdRecvSpeedForm"
87 i18n>Submit</cd-submit-button>
89 <button class="btn btn-link btn-sm"
90 (click)="bsModalRef.hide()"