]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
ea467161a3089b319ccd42357a64868132aa455f
[ceph.git] /
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 i18>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
19           </label>
20           <div class="col-sm-9">
21             <input class="form-control"
22                    type="text"
23                    id="name"
24                    formControlName="name"
25                    readonly>
26           </div>
27         </div>
28
29         <!-- Description -->
30         <div class="form-group"
31              *ngIf="configForm.getValue('desc')">
32           <label i18n
33                  class="control-label col-sm-3">Description
34           </label>
35           <div class="col-sm-9">
36             <textarea class="form-control"
37                       id="desc"
38                       formControlName="desc"
39                       readonly>
40             </textarea>
41           </div>
42         </div>
43
44         <!-- Long description -->
45         <div class="form-group"
46              *ngIf="configForm.getValue('long_desc')">
47           <label i18n
48                  class="control-label col-sm-3">Long description
49           </label>
50           <div class="col-sm-9">
51             <textarea class="form-control"
52                       id="long_desc"
53                       formControlName="long_desc"
54                       readonly>
55             </textarea>
56           </div>
57         </div>
58
59         <!-- Default -->
60         <div class="form-group"
61              *ngIf="configForm.getValue('default') !== ''">
62           <label i18n
63                  class="control-label col-sm-3">Default
64           </label>
65           <div class="col-sm-9">
66             <input class="form-control"
67                    type="text"
68                    id="default"
69                    formControlName="default"
70                    readonly>
71           </div>
72         </div>
73
74         <!-- Daemon default -->
75         <div class="form-group"
76              *ngIf="configForm.getValue('daemon_default') !== ''">
77           <label i18n
78                  class="control-label col-sm-3">Daemon default
79           </label>
80           <div class="col-sm-9">
81             <input class="form-control"
82                    type="text"
83                    id="daemon_default"
84                    formControlName="daemon_default"
85                    readonly>
86           </div>
87         </div>
88
89         <!-- Services -->
90         <div class="form-group"
91              *ngIf="configForm.getValue('services').length > 0">
92           <label i18n
93                  class="control-label col-sm-3">Services
94           </label>
95           <div class="col-sm-9">
96             <span *ngFor="let service of configForm.getValue('services')"
97                   class="form-component-badge">
98               <span class="badge badge-pill badge-primary">{{ service }}</span>
99             </span>
100           </div>
101         </div>
102
103         <!-- Values -->
104         <div class="col-sm-12">
105           <h2 i18n
106               class="page-header">Values</h2>
107           <div class="row" *ngFor="let section of availSections">
108             <div class="form-group" *ngIf="type === 'bool'">
109               <div class="col-sm-offset-3 col-sm-9">
110                 <div class="checkbox checkbox-primary">
111                   <input [id]="section"
112                          type="checkbox"
113                          [formControlName]="section">
114                   <label [for]="section"
115                          i18n>{{ section }}
116                   </label>
117                 </div>
118               </div>
119             </div>
120             <div class="form-group"
121                  [ngClass]="{'has-error': configForm.showError(section, formDir)}"
122                  *ngIf="type !== 'bool'">
123               <label class="control-label col-sm-3"
124                      [for]="section"
125                      i18n>{{ section }}
126               </label>
127               <div class="col-sm-9">
128                 <input class="form-control"
129                        [type]="inputType"
130                        [id]="section"
131                        [placeholder]="humanReadableType"
132                        [formControlName]="section"
133                        [step]="getStep(type, this.configForm.getValue(section))">
134                 <span class="help-block"
135                       *ngIf="configForm.showError(section, formDir, 'pattern')"
136                       i18n>
137                   {{ patternHelpText }}
138                 </span>
139                 <span class="help-block"
140                       *ngIf="configForm.showError(section, formDir, 'max')"
141                       i18n>
142                   The entered value is too high! It must not be greater than {{ maxValue }}.
143                 </span>
144                 <span class="help-block"
145                       *ngIf="configForm.showError(section, formDir, 'min')"
146                       i18n>
147                   The entered value is too low! It must not be lower than {{ minValue }}.
148                 </span>
149               </div>
150             </div>
151           </div>
152         </div>
153       </div>
154       <!-- Footer -->
155       <div class="panel-footer">
156         <div class="button-group text-right">
157           <cd-submit-button [form]="formDir"
158                             type="button"
159                             (submitAction)="submit()">
160             <span i18n>Save</span>
161           </cd-submit-button>
162           <button type="button"
163                   class="btn btn-sm btn-default"
164                   routerLink="/configuration"
165                   i18n>
166             Back
167           </button>
168         </div>
169       </div>
170     </div>
171   </form>
172 </div>