]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.html
import ceph quincy 17.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / mgr-modules / mgr-module-form / mgr-module-form.component.html
CommitLineData
9f95a23c 1<div class="cd-col-form"
f67539c2 2 *cdFormLoading="loading">
11fdf7f2 3 <form name="mgrModuleForm"
11fdf7f2
TL
4 #frm="ngForm"
5 [formGroup]="mgrModuleForm"
6 novalidate>
9f95a23c
TL
7 <div class="card">
8 <div class="card-header"
9 i18n>Edit Manager module</div>
10 <div class="card-body">
11 <div class="form-group row"
11fdf7f2
TL
12 *ngFor="let moduleOption of moduleOptions | keyvalue">
13
14 <!-- Field label -->
f67539c2 15 <label class="cd-col-form-label"
11fdf7f2
TL
16 for="{{ moduleOption.value.name }}">
17 {{ moduleOption.value.name }}
18 <cd-helper *ngIf="moduleOption.value.long_desc || moduleOption.value.desc">
19 {{ moduleOption.value.long_desc || moduleOption.value.desc | upperFirst }}
20 </cd-helper>
21 </label>
22
23 <!-- Field control -->
24 <!-- bool -->
f67539c2 25 <div class="cd-col-form-input"
11fdf7f2 26 *ngIf="moduleOption.value.type === 'bool'">
9f95a23c 27 <div class="custom-control custom-checkbox">
11fdf7f2
TL
28 <input id="{{ moduleOption.value.name }}"
29 type="checkbox"
9f95a23c 30 class="custom-control-input"
11fdf7f2 31 formControlName="{{ moduleOption.value.name }}">
9f95a23c
TL
32 <label class="custom-control-label"
33 for="{{ moduleOption.value.name }}"></label>
11fdf7f2
TL
34 </div>
35 </div>
36
37 <!-- addr|str|uuid -->
f67539c2 38 <div class="cd-col-form-input"
11fdf7f2
TL
39 *ngIf="['addr', 'str', 'uuid'].includes(moduleOption.value.type)">
40 <input id="{{ moduleOption.value.name }}"
41 class="form-control"
42 type="text"
43 formControlName="{{ moduleOption.value.name }}"
44 *ngIf="moduleOption.value.enum_allowed.length === 0">
45 <select id="{{ moduleOption.value.name }}"
33c7a0ef 46 class="form-control"
11fdf7f2
TL
47 formControlName="{{ moduleOption.value.name }}"
48 *ngIf="moduleOption.value.enum_allowed.length > 0">
49 <option *ngFor="let value of moduleOption.value.enum_allowed"
50 [ngValue]="value">
51 {{ value }}
52 </option>
53 </select>
9f95a23c 54 <span class="invalid-feedback"
11fdf7f2
TL
55 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'invalidUuid')"
56 i18n>The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8</span>
9f95a23c 57 <span class="invalid-feedback"
11fdf7f2
TL
58 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
59 i18n>The entered value needs to be a valid IP address.</span>
60 </div>
61
62 <!-- uint|int|size|secs -->
f67539c2 63 <div class="cd-col-form-input"
11fdf7f2
TL
64 *ngIf="['uint', 'int', 'size', 'secs'].includes(moduleOption.value.type)">
65 <input id="{{ moduleOption.value.name }}"
66 class="form-control"
67 type="number"
68 formControlName="{{ moduleOption.value.name }}"
69 min="{{ moduleOption.value.min }}"
70 max="{{ moduleOption.value.max }}">
9f95a23c 71 <span class="invalid-feedback"
11fdf7f2
TL
72 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')"
73 i18n>This field is required.</span>
9f95a23c 74 <span class="invalid-feedback"
11fdf7f2
TL
75 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'max')"
76 i18n>The entered value is too high! It must be lower or equal to {{ moduleOption.value.max }}.</span>
9f95a23c 77 <span class="invalid-feedback"
11fdf7f2
TL
78 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'min')"
79 i18n>The entered value is too low! It must be greater or equal to {{ moduleOption.value.min }}.</span>
9f95a23c 80 <span class="invalid-feedback"
11fdf7f2
TL
81 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
82 i18n>The entered value needs to be a number.</span>
83 </div>
84
85 <!-- float -->
f67539c2 86 <div class="cd-col-form-input"
11fdf7f2
TL
87 *ngIf="moduleOption.value.type === 'float'">
88 <input id="{{ moduleOption.value.name }}"
89 class="form-control"
90 type="number"
91 formControlName="{{ moduleOption.value.name }}">
9f95a23c 92 <span class="invalid-feedback"
11fdf7f2
TL
93 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')"
94 i18n>This field is required.</span>
9f95a23c 95 <span class="invalid-feedback"
11fdf7f2
TL
96 *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
97 i18n>The entered value needs to be a number or decimal.</span>
98 </div>
99
100 </div>
101 </div>
9f95a23c 102 <div class="card-footer">
f67539c2
TL
103 <cd-form-button-panel (submitActionEvent)="onSubmit()"
104 [form]="mgrModuleForm"
105 [submitText]="actionLabels.UPDATE"
106 wrappingClass="text-right"></cd-form-button-panel>
11fdf7f2
TL
107 </div>
108 </div>
109 </form>
110</div>