]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | <div class="cd-col-form" |
2 | *cdFormLoading="loading"> | |
11fdf7f2 | 3 | <form name="configForm" |
11fdf7f2 TL |
4 | #formDir="ngForm" |
5 | [formGroup]="configForm" | |
6 | novalidate> | |
9f95a23c TL |
7 | <div class="card"> |
8 | <div class="card-header"> | |
9 | <ng-container i18>Edit</ng-container> {{ configForm.getValue('name') }} | |
11fdf7f2 | 10 | </div> |
11fdf7f2 | 11 | |
9f95a23c | 12 | <div class="card-body"> |
11fdf7f2 | 13 | <!-- Name --> |
9f95a23c | 14 | <div class="form-group row"> |
11fdf7f2 | 15 | <label i18n |
9f95a23c TL |
16 | class="cd-col-form-label">Name</label> |
17 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
18 | <input class="form-control" |
19 | type="text" | |
20 | id="name" | |
21 | formControlName="name" | |
22 | readonly> | |
23 | </div> | |
24 | </div> | |
25 | ||
26 | <!-- Description --> | |
9f95a23c | 27 | <div class="form-group row" |
11fdf7f2 TL |
28 | *ngIf="configForm.getValue('desc')"> |
29 | <label i18n | |
9f95a23c TL |
30 | class="cd-col-form-label">Description</label> |
31 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
32 | <textarea class="form-control resize-vertical" |
33 | id="desc" | |
34 | formControlName="desc" | |
35 | readonly> | |
36 | </textarea> | |
37 | </div> | |
38 | </div> | |
39 | ||
40 | <!-- Long description --> | |
9f95a23c | 41 | <div class="form-group row" |
11fdf7f2 TL |
42 | *ngIf="configForm.getValue('long_desc')"> |
43 | <label i18n | |
9f95a23c TL |
44 | class="cd-col-form-label">Long description</label> |
45 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
46 | <textarea class="form-control resize-vertical" |
47 | id="long_desc" | |
48 | formControlName="long_desc" | |
49 | readonly> | |
50 | </textarea> | |
51 | </div> | |
52 | </div> | |
53 | ||
54 | <!-- Default --> | |
9f95a23c | 55 | <div class="form-group row" |
11fdf7f2 TL |
56 | *ngIf="configForm.getValue('default') !== ''"> |
57 | <label i18n | |
9f95a23c TL |
58 | class="cd-col-form-label">Default</label> |
59 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
60 | <input class="form-control" |
61 | type="text" | |
62 | id="default" | |
63 | formControlName="default" | |
64 | readonly> | |
65 | </div> | |
66 | </div> | |
67 | ||
68 | <!-- Daemon default --> | |
9f95a23c | 69 | <div class="form-group row" |
11fdf7f2 TL |
70 | *ngIf="configForm.getValue('daemon_default') !== ''"> |
71 | <label i18n | |
9f95a23c TL |
72 | class="cd-col-form-label">Daemon default</label> |
73 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
74 | <input class="form-control" |
75 | type="text" | |
76 | id="daemon_default" | |
77 | formControlName="daemon_default" | |
78 | readonly> | |
79 | </div> | |
80 | </div> | |
81 | ||
82 | <!-- Services --> | |
9f95a23c | 83 | <div class="form-group row" |
11fdf7f2 TL |
84 | *ngIf="configForm.getValue('services').length > 0"> |
85 | <label i18n | |
9f95a23c TL |
86 | class="cd-col-form-label">Services</label> |
87 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
88 | <span *ngFor="let service of configForm.getValue('services')" |
89 | class="form-component-badge"> | |
9f95a23c | 90 | <span class="badge badge-dark">{{ service }}</span> |
11fdf7f2 TL |
91 | </span> |
92 | </div> | |
93 | </div> | |
94 | ||
95 | <!-- Values --> | |
9f95a23c | 96 | <div formGroupName="values"> |
f91f0fd5 TL |
97 | <h3 i18n |
98 | class="cd-header">Values</h3> | |
9f95a23c TL |
99 | <ng-container *ngFor="let section of availSections"> |
100 | <div class="form-group row" | |
11fdf7f2 | 101 | *ngIf="type === 'bool'"> |
9f95a23c | 102 | <label class="cd-col-form-label" |
92f5a8d4 TL |
103 | [for]="section">{{ section }} |
104 | </label> | |
9f95a23c | 105 | <div class="cd-col-form-input"> |
92f5a8d4 TL |
106 | <select id="pool" |
107 | name="pool" | |
39ae355f | 108 | class="form-select" |
92f5a8d4 TL |
109 | [formControlName]="section"> |
110 | <option [ngValue]="null" | |
111 | i18n>-- Default --</option> | |
112 | <option [ngValue]="true" | |
113 | i18n>true</option> | |
114 | <option [ngValue]="false" | |
115 | i18n>false</option> | |
116 | </select> | |
11fdf7f2 TL |
117 | </div> |
118 | </div> | |
9f95a23c TL |
119 | |
120 | <div class="form-group row" | |
11fdf7f2 | 121 | *ngIf="type !== 'bool'"> |
9f95a23c | 122 | <label class="cd-col-form-label" |
11fdf7f2 TL |
123 | [for]="section">{{ section }} |
124 | </label> | |
9f95a23c | 125 | <div class="cd-col-form-input"> |
11fdf7f2 TL |
126 | <input class="form-control" |
127 | [type]="inputType" | |
128 | [id]="section" | |
129 | [placeholder]="humanReadableType" | |
130 | [formControlName]="section" | |
131 | [step]="getStep(type, this.configForm.getValue(section))"> | |
9f95a23c | 132 | <span class="invalid-feedback" |
11fdf7f2 TL |
133 | *ngIf="configForm.showError(section, formDir, 'pattern')"> |
134 | {{ patternHelpText }} | |
135 | </span> | |
9f95a23c | 136 | <span class="invalid-feedback" |
11fdf7f2 TL |
137 | *ngIf="configForm.showError(section, formDir, 'invalidUuid')"> |
138 | {{ patternHelpText }} | |
139 | </span> | |
9f95a23c | 140 | <span class="invalid-feedback" |
11fdf7f2 TL |
141 | *ngIf="configForm.showError(section, formDir, 'max')" |
142 | i18n>The entered value is too high! It must not be greater than {{ maxValue }}.</span> | |
9f95a23c | 143 | <span class="invalid-feedback" |
11fdf7f2 TL |
144 | *ngIf="configForm.showError(section, formDir, 'min')" |
145 | i18n>The entered value is too low! It must not be lower than {{ minValue }}.</span> | |
146 | </div> | |
147 | </div> | |
9f95a23c | 148 | </ng-container> |
11fdf7f2 TL |
149 | </div> |
150 | </div> | |
151 | <!-- Footer --> | |
9f95a23c | 152 | <div class="card-footer"> |
f67539c2 TL |
153 | <cd-form-button-panel (submitActionEvent)="submit()" |
154 | [form]="configForm" | |
155 | [submitText]="actionLabels.UPDATE" | |
156 | wrappingClass="text-right"></cd-form-button-panel> | |
11fdf7f2 TL |
157 | </div> |
158 | </div> | |
159 | </form> | |
160 | </div> |