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