]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | <cd-loading-panel *ngIf="loading && !error" |
2 | i18n>Loading configuration...</cd-loading-panel> | |
3 | <cd-error-panel *ngIf="loading && error" | |
4 | i18n>The configuration could not be loaded.</cd-error-panel> | |
5 | ||
6 | <div class="col-sm-12 col-lg-6" | |
7 | *ngIf="!loading && !error"> | |
8 | <form name="mgrModuleForm" | |
9 | class="form-horizontal" | |
10 | #frm="ngForm" | |
11 | [formGroup]="mgrModuleForm" | |
12 | novalidate> | |
13 | <div class="panel panel-default"> | |
14 | <div class="panel-heading"> | |
15 | <h3 class="panel-title" i18n>Edit Manager module</h3> | |
16 | </div> | |
17 | <div class="panel-body"> | |
18 | <div class="form-group" | |
19 | [ngClass]="{'has-error': mgrModuleForm.showError(moduleOption.value.name, frm)}" | |
20 | *ngFor="let moduleOption of moduleOptions | keyvalue"> | |
21 | ||
22 | <!-- Field label --> | |
23 | <label class="control-label col-sm-3" | |
24 | for="{{ moduleOption.value.name }}"> | |
25 | {{ moduleOption.value.name }} | |
26 | <cd-helper *ngIf="moduleOption.value.long_desc || moduleOption.value.desc"> | |
27 | {{ moduleOption.value.long_desc || moduleOption.value.desc | upperFirst }} | |
28 | </cd-helper> | |
29 | </label> | |
30 | ||
31 | <!-- Field control --> | |
32 | <!-- bool --> | |
33 | <div class="col-sm-7" | |
34 | *ngIf="moduleOption.value.type === 'bool'"> | |
35 | <div class="checkbox checkbox-primary"> | |
36 | <input id="{{ moduleOption.value.name }}" | |
37 | type="checkbox" | |
38 | formControlName="{{ moduleOption.value.name }}"> | |
39 | <label for="{{ moduleOption.value.name }}"></label> | |
40 | </div> | |
41 | </div> | |
42 | ||
43 | <!-- addr|str|uuid --> | |
44 | <div class="col-sm-7" | |
45 | *ngIf="['addr', 'str', 'uuid'].includes(moduleOption.value.type)"> | |
46 | <input id="{{ moduleOption.value.name }}" | |
47 | class="form-control" | |
48 | type="text" | |
49 | formControlName="{{ moduleOption.value.name }}" | |
50 | *ngIf="moduleOption.value.enum_allowed.length === 0"> | |
51 | <select id="{{ moduleOption.value.name }}" | |
52 | class="form-control" | |
53 | formControlName="{{ moduleOption.value.name }}" | |
54 | *ngIf="moduleOption.value.enum_allowed.length > 0"> | |
55 | <option *ngFor="let value of moduleOption.value.enum_allowed" | |
56 | [ngValue]="value"> | |
57 | {{ value }} | |
58 | </option> | |
59 | </select> | |
60 | <span class="help-block" | |
61 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'invalidUuid')" | |
62 | i18n>The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8</span> | |
63 | <span class="help-block" | |
64 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')" | |
65 | i18n>The entered value needs to be a valid IP address.</span> | |
66 | </div> | |
67 | ||
68 | <!-- uint|int|size|secs --> | |
69 | <div class="col-sm-7" | |
70 | *ngIf="['uint', 'int', 'size', 'secs'].includes(moduleOption.value.type)"> | |
71 | <input id="{{ moduleOption.value.name }}" | |
72 | class="form-control" | |
73 | type="number" | |
74 | formControlName="{{ moduleOption.value.name }}" | |
75 | min="{{ moduleOption.value.min }}" | |
76 | max="{{ moduleOption.value.max }}"> | |
77 | <span class="help-block" | |
78 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')" | |
79 | i18n>This field is required.</span> | |
80 | <span class="help-block" | |
81 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'max')" | |
82 | i18n>The entered value is too high! It must be lower or equal to {{ moduleOption.value.max }}.</span> | |
83 | <span class="help-block" | |
84 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'min')" | |
85 | i18n>The entered value is too low! It must be greater or equal to {{ moduleOption.value.min }}.</span> | |
86 | <span class="help-block" | |
87 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')" | |
88 | i18n>The entered value needs to be a number.</span> | |
89 | </div> | |
90 | ||
91 | <!-- float --> | |
92 | <div class="col-sm-7" | |
93 | *ngIf="moduleOption.value.type === 'float'"> | |
94 | <input id="{{ moduleOption.value.name }}" | |
95 | class="form-control" | |
96 | type="number" | |
97 | formControlName="{{ moduleOption.value.name }}"> | |
98 | <span class="help-block" | |
99 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'required')" | |
100 | i18n>This field is required.</span> | |
101 | <span class="help-block" | |
102 | *ngIf="mgrModuleForm.showError(moduleOption.value.name, frm, 'pattern')" | |
103 | i18n>The entered value needs to be a number or decimal.</span> | |
104 | </div> | |
105 | ||
106 | </div> | |
107 | </div> | |
108 | <div class="panel-footer"> | |
109 | <div class="button-group text-right"> | |
110 | <cd-submit-button type="button" | |
111 | (submitAction)="onSubmit()" | |
112 | [form]="mgrModuleForm"> | |
113 | <ng-container i18n>Update</ng-container> | |
114 | </cd-submit-button> | |
115 | <button type="button" | |
116 | class="btn btn-sm btn-default" | |
117 | routerLink="/mgr-modules" | |
118 | i18n>Back</button> | |
119 | </div> | |
120 | </div> | |
121 | </div> | |
122 | </form> | |
123 | </div> |