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
|
<div class="cd-col-form"
*cdFormLoading="loading">
<form name="mgrModuleForm"
#frm="ngForm"
[formGroup]="mgrModuleForm"
novalidate>
<div class="card">
<div class="card-header"
i18n>Edit Manager module</div>
<div class="card-body">
<div class="form-group row"
*ngFor="let moduleOption of moduleOptions | keyvalue">
<!-- Field label -->
<label class="cd-col-form-label"
for="{{ moduleOption.value.name }}">
{{ moduleOption.value.name }}
<cd-helper *ngIf="moduleOption.value.long_desc || moduleOption.value.desc">
{{ moduleOption.value.long_desc || moduleOption.value.desc | upperFirst }}
</cd-helper>
</label>
<!-- Field control -->
<!-- bool -->
<div class="cd-col-form-input"
*ngIf="moduleOption.value.type === 'bool'">
<div class="custom-control custom-checkbox">
<input id="{{ moduleOption.value.name }}"
type="checkbox"
class="custom-control-input"
formControlName="{{ moduleOption.value.name }}">
<label class="custom-control-label"
for="{{ moduleOption.value.name }}"></label>
</div>
</div>
<!-- addr|str|uuid -->
<div class="cd-col-form-input"
*ngIf="['addr', 'str', 'uuid'].includes(moduleOption.value.type)">
<input id="{{ moduleOption.value.name }}"
class="form-control"
type="text"
formControlName="{{ moduleOption.value.name }}"
*ngIf="moduleOption.value.enum_allowed.length === 0">
<select id="{{ moduleOption.value.name }}"
class="form-control"
formControlName="{{ moduleOption.value.name }}"
*ngIf="moduleOption.value.enum_allowed.length > 0">
<option *ngFor="let value of moduleOption.value.enum_allowed"
[ngValue]="value">
{{ value }}
</option>
</select>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'invalidUuid')"
i18n>The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8</span>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
i18n>The entered value needs to be a valid IP address.</span>
</div>
<!-- uint|int|size|secs -->
<div class="cd-col-form-input"
*ngIf="['uint', 'int', 'size', 'secs'].includes(moduleOption.value.type)">
<input id="{{ moduleOption.value.name }}"
class="form-control"
type="number"
formControlName="{{ moduleOption.value.name }}"
min="{{ moduleOption.value.min }}"
max="{{ moduleOption.value.max }}">
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'max')"
i18n>The entered value is too high! It must be lower or equal to {{ moduleOption.value.max }}.</span>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'min')"
i18n>The entered value is too low! It must be greater or equal to {{ moduleOption.value.min }}.</span>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
</div>
<!-- float -->
<div class="cd-col-form-input"
*ngIf="moduleOption.value.type === 'float'">
<input id="{{ moduleOption.value.name }}"
class="form-control"
type="number"
formControlName="{{ moduleOption.value.name }}">
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')"
i18n>The entered value needs to be a number or decimal.</span>
</div>
</div>
</div>
<div class="card-footer">
<cd-form-button-panel (submitActionEvent)="onSubmit()"
[form]="mgrModuleForm"
[submitText]="actionLabels.UPDATE"
wrappingClass="text-right"></cd-form-button-panel>
</div>
</div>
</form>
</div>
|