1 <cd-modal [modalRef]="activeModal">
2 <ng-container class="modal-title"
3 i18n>OSD Recovery Priority</ng-container>
5 <ng-container class="modal-content">
6 <form #formDir="ngForm"
7 [formGroup]="osdRecvSpeedForm"
10 <div class="modal-body">
12 <div class="form-group row">
13 <label class="cd-col-form-label required"
16 <div class="cd-col-form-input">
17 <select class="form-control custom-select"
18 formControlName="priority"
20 (change)="onPriorityChange($event.target.value)">
21 <option *ngFor="let priority of priorities"
22 [value]="priority.name">
26 <span class="invalid-feedback"
27 *ngIf="osdRecvSpeedForm.showError('priority', formDir, 'required')"
28 i18n>This field is required.</span>
32 <!-- Customize priority -->
33 <div class="form-group row">
34 <div class="cd-col-form-offset">
35 <div class="custom-control custom-checkbox">
36 <input formControlName="customizePriority"
37 class="custom-control-input"
38 id="customizePriority"
39 name="customizePriority"
41 (change)="onCustomizePriorityChange()">
42 <label class="custom-control-label"
43 for="customizePriority"
44 i18n>Customize priority values</label>
49 <!-- Priority values -->
50 <div class="form-group row"
51 *ngFor="let attr of priorityAttrs | keyvalue">
52 <label class="cd-col-form-label"
54 <span [ngClass]="{'required': osdRecvSpeedForm.getValue('customizePriority')}">
57 <cd-helper *ngIf="attr.value.desc">{{ attr.value.desc }}</cd-helper>
59 <div class="cd-col-form-input">
60 <input class="form-control"
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>
84 <div class="modal-footer">
85 <cd-form-button-panel (submitActionEvent)="submitAction()"
86 [form]="osdRecvSpeedForm"
87 [submitText]="actionLabels.UPDATE"
88 [showSubmit]="permissions.configOpt.update"></cd-form-button-panel>