summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.html
blob: 0b0f87957a93ef4025c56ecf48842817aab38400 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<div [formGroup]="optionsFormGroup">
  <div *ngFor="let option of options; let last = last">
    <div class="form-group row pt-2"
         *ngIf="option.type === 'bool'">
      <label class="cd-col-form-label"
             [for]="option.name">
        <b>{{ option.text }}</b>
        <br>
        <span class="text-muted">
          {{ option.desc }}
          <cd-helper *ngIf="option.long_desc">
            {{ option.long_desc }}</cd-helper>
        </span>
      </label>

      <div class="cd-col-form-input">
        <div class="custom-control custom-checkbox">
          <input class="custom-control-input"
                 type="checkbox"
                 [id]="option.name"
                 [formControlName]="option.name">
          <label class="custom-control-label"
                 [for]="option.name"></label>
        </div>
      </div>
    </div>

    <div class="form-group row pt-2"
         *ngIf="option.type !== 'bool'">
      <label class="cd-col-form-label"
             [for]="option.name">{{ option.text }}
        <br>
        <span class="text-muted">
          {{ option.desc }}
          <cd-helper *ngIf="option.long_desc">
            {{ option.long_desc }}</cd-helper>
        </span>
      </label>
      <div class="cd-col-form-input">
        <div class="input-group">
          <input class="form-control"
                 [type]="option.additionalTypeInfo.inputType"
                 [id]="option.name"
                 [placeholder]="option.additionalTypeInfo.humanReadable"
                 [formControlName]="option.name"
                 [step]="getStep(option.type, optionsForm.getValue(option.name))">
          <div class="input-group-append"
               *ngIf="optionsFormShowReset">
            <button class="btn btn-light"
                    type="button"
                    data-toggle="button"
                    title="Remove the custom configuration value. The default configuration will be inherited and used instead."
                    (click)="resetValue(option.name)"
                    i18n-title>
              <i [ngClass]="[icons.erase]"
                 aria-hidden="true"></i>
            </button>
          </div>
        </div>
        <span class="invalid-feedback"
              *ngIf="optionsForm.showError(option.name, optionsFormDir, 'pattern')">
          {{ option.additionalTypeInfo.patternHelpText }}</span>
        <span class="invalid-feedback"
              *ngIf="optionsForm.showError(option.name, optionsFormDir, 'invalidUuid')">
          {{ option.additionalTypeInfo.patternHelpText }}</span>
        <span class="invalid-feedback"
              *ngIf="optionsForm.showError(option.name, optionsFormDir, 'max')"
              i18n>The entered value is too high! It must not be greater than {{ option.maxValue }}.</span>
        <span class="invalid-feedback"
              *ngIf="optionsForm.showError(option.name, optionsFormDir, 'min')"
              i18n>The entered value is too low! It must not be lower than {{ option.minValue }}.</span>
      </div>
    </div>
    <hr *ngIf="!last"
        class="my-2">
  </div>
</div>