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