summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html
blob: 72c71794257f008100d7b8399d8979ce7f239432 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<div class="cd-col-form"
     *cdFormLoading="loading">
  <form name="configForm"
        #formDir="ngForm"
        [formGroup]="configForm"
        novalidate>
    <div class="card">
      <div class="card-header">
        <ng-container i18>Edit</ng-container> {{ configForm.getValue('name') }}
      </div>

      <div class="card-body">
        <!-- Name -->
        <div class="form-group row">
          <label i18n
                 class="cd-col-form-label">Name</label>
          <div class="cd-col-form-input">
            <input class="form-control"
                   type="text"
                   id="name"
                   formControlName="name"
                   readonly>
          </div>
        </div>

        <!-- Description -->
        <div class="form-group row"
             *ngIf="configForm.getValue('desc')">
          <label i18n
                 class="cd-col-form-label">Description</label>
          <div class="cd-col-form-input">
            <textarea class="form-control resize-vertical"
                      id="desc"
                      formControlName="desc"
                      readonly>
            </textarea>
          </div>
        </div>

        <!-- Long description -->
        <div class="form-group row"
             *ngIf="configForm.getValue('long_desc')">
          <label i18n
                 class="cd-col-form-label">Long description</label>
          <div class="cd-col-form-input">
            <textarea class="form-control resize-vertical"
                      id="long_desc"
                      formControlName="long_desc"
                      readonly>
            </textarea>
          </div>
        </div>

        <!-- Default -->
        <div class="form-group row"
             *ngIf="configForm.getValue('default') !== ''">
          <label i18n
                 class="cd-col-form-label">Default</label>
          <div class="cd-col-form-input">
            <input class="form-control"
                   type="text"
                   id="default"
                   formControlName="default"
                   readonly>
          </div>
        </div>

        <!-- Daemon default -->
        <div class="form-group row"
             *ngIf="configForm.getValue('daemon_default') !== ''">
          <label i18n
                 class="cd-col-form-label">Daemon default</label>
          <div class="cd-col-form-input">
            <input class="form-control"
                   type="text"
                   id="daemon_default"
                   formControlName="daemon_default"
                   readonly>
          </div>
        </div>

        <!-- Services -->
        <div class="form-group row"
             *ngIf="configForm.getValue('services').length > 0">
          <label i18n
                 class="cd-col-form-label">Services</label>
          <div class="cd-col-form-input">
            <span *ngFor="let service of configForm.getValue('services')"
                  class="form-component-badge">
              <span class="badge badge-dark">{{ service }}</span>
            </span>
          </div>
        </div>

        <!-- Values -->
        <div formGroupName="values">
          <h3 i18n
              class="cd-header">Values</h3>
          <ng-container *ngFor="let section of availSections">
            <div class="form-group row"
                 *ngIf="type === 'bool'">
              <label class="cd-col-form-label"
                     [for]="section">{{ section }}
              </label>
              <div class="cd-col-form-input">
                <select id="pool"
                        name="pool"
                        class="form-control"
                        [formControlName]="section">
                  <option [ngValue]="null"
                          i18n>-- Default --</option>
                  <option [ngValue]="true"
                          i18n>true</option>
                  <option [ngValue]="false"
                          i18n>false</option>
                </select>
              </div>
            </div>

            <div class="form-group row"
                 *ngIf="type !== 'bool'">
              <label class="cd-col-form-label"
                     [for]="section">{{ section }}
              </label>
              <div class="cd-col-form-input">
                <input class="form-control"
                       [type]="inputType"
                       [id]="section"
                       [placeholder]="humanReadableType"
                       [formControlName]="section"
                       [step]="getStep(type, this.configForm.getValue(section))">
                <span class="invalid-feedback"
                      *ngIf="configForm.showError(section, formDir, 'pattern')">
                  {{ patternHelpText }}
                </span>
                <span class="invalid-feedback"
                      *ngIf="configForm.showError(section, formDir, 'invalidUuid')">
                  {{ patternHelpText }}
                </span>
                <span class="invalid-feedback"
                      *ngIf="configForm.showError(section, formDir, 'max')"
                      i18n>The entered value is too high! It must not be greater than {{ maxValue }}.</span>
                <span class="invalid-feedback"
                      *ngIf="configForm.showError(section, formDir, 'min')"
                      i18n>The entered value is too low! It must not be lower than {{ minValue }}.</span>
              </div>
            </div>
          </ng-container>
        </div>
      </div>
      <!-- Footer -->
      <div class="card-footer">
        <cd-form-button-panel (submitActionEvent)="submit()"
                              [form]="configForm"
                              [submitText]="actionLabels.UPDATE"
                              wrappingClass="text-right"></cd-form-button-panel>
      </div>
    </div>
  </form>
</div>