summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-setting/iscsi-setting.component.html
blob: b19941ae0d58ec520152cf97590292dff058a6f5 (plain)
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
<div class="form-group"
     [formGroup]="settingsForm">
  <label class="col-form-label"
         for="{{ setting }}">{{ setting }}</label>
  <select id="{{ setting }}"
          name="{{ setting }}"
          *ngIf="limits['type'] === 'enum'"
          class="form-control"
          [formControlName]="setting">
    <option [ngValue]="null"></option>
    <option *ngFor="let opt of limits['values']"
            [ngValue]="opt">{{ opt }}</option>
  </select>

  <span *ngIf="limits['type'] !== 'enum'">
    <input type="number"
           *ngIf="limits['type'] === 'int'"
           class="form-control"
           [formControlName]="setting">

    <input type="text"
           *ngIf="limits['type'] === 'str'"
           class="form-control"
           [formControlName]="setting">

    <ng-container *ngIf="limits['type'] === 'bool'">
      <br>
      <div class="custom-control custom-radio custom-control-inline">
        <input type="radio"
               [id]="setting + 'True'"
               [value]="true"
               [formControlName]="setting"
               class="custom-control-input">
        <label class="custom-control-label"
               [for]="setting + 'True'">Yes</label>
      </div>
      <div class="custom-control custom-radio custom-control-inline">
        <input type="radio"
               [id]="setting + 'False'"
               [value]="false"
               class="custom-control-input"
               [formControlName]="setting">
        <label class="custom-control-label"
               [for]="setting + 'False'">No</label>
      </div>
    </ng-container>
  </span>

  <span class="invalid-feedback"
        *ngIf="settingsForm.showError(setting, formDir, 'min')">
    <ng-container i18n>Must be greater than or equal to {{ limits['min'] }}.</ng-container>
  </span>
  <span class="invalid-feedback"
        *ngIf="settingsForm.showError(setting, formDir, 'max')">
    <ng-container i18n>Must be less than or equal to {{ limits['max'] }}.</ng-container>
  </span>
</div>