]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
985f6a3fa551d9e6a8402d45a83308b4127298e4
[ceph.git] /
1 <cd-modal [modalRef]="bsModalRef">
2   <ng-container i18n="form title|Example: Create Pool@@formTitle"
3                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
4
5   <ng-container class="modal-content">
6     <form #frm="ngForm"
7           [formGroup]="form"
8           novalidate>
9       <div class="modal-body">
10         <div class="form-group row">
11           <label class="cd-col-form-label"
12                  for="name"
13                  i18n>Name</label>
14           <div class="cd-col-form-input">
15             <input type="text"
16                    id="name"
17                    name="name"
18                    class="form-control"
19                    placeholder="Name..."
20                    formControlName="name"
21                    autofocus>
22             <span class="invalid-feedback"
23                   *ngIf="form.showError('name', frm, 'required')"
24                   i18n>This field is required!</span>
25             <span class="invalid-feedback"
26                   *ngIf="form.showError('name', frm, 'pattern')"
27                   i18n>The name can only consist of alphanumeric characters, dashes and underscores.</span>
28             <span class="invalid-feedback"
29                   *ngIf="form.showError('name', frm, 'uniqueName')"
30                   i18n>The chosen erasure code profile name is already in use.</span>
31           </div>
32         </div>
33
34         <div class="form-group row">
35           <label for="plugin"
36                  class="cd-col-form-label">
37             <span class="required"
38                   i18n>Plugin</span>
39             <cd-helper [html]="tooltips.plugins[plugin].description">
40             </cd-helper>
41           </label>
42           <div class="cd-col-form-input">
43             <select class="form-control custom-select"
44                     id="plugin"
45                     name="plugin"
46                     formControlName="plugin">
47               <option *ngIf="!plugins"
48                       ngValue=""
49                       i18n>Loading...</option>
50               <option *ngFor="let plugin of plugins"
51                       [ngValue]="plugin">
52                 {{ plugin }}
53               </option>
54             </select>
55             <span class="invalid-feedback"
56                   *ngIf="form.showError('name', frm, 'required')"
57                   i18n>This field is required!</span>
58           </div>
59         </div>
60
61         <div class="form-group row">
62           <label for="k"
63                  class="cd-col-form-label">
64             <span [ngClass]="{'required': requiredControls.includes('k')}"
65                   i18n>Data chunks (k)</span>
66             <cd-helper [html]="tooltips.k">
67             </cd-helper>
68           </label>
69           <div class="cd-col-form-input">
70             <input type="number"
71                    id="k"
72                    name="k"
73                    class="form-control"
74                    ng-model="$ctrl.erasureCodeProfile.k"
75                    placeholder="Data chunks..."
76                    formControlName="k">
77             <span class="invalid-feedback"
78                   *ngIf="form.showError('k', frm, 'required')"
79                   i18n>This field is required!</span>
80             <span class="invalid-feedback"
81                   *ngIf="form.showError('k', frm, 'min')"
82                   i18n>Must be equal to or greater than 2.</span>
83           </div>
84         </div>
85
86         <div class="form-group row">
87           <label for="m"
88                  class="cd-col-form-label">
89             <span [ngClass]="{'required': requiredControls.includes('m')}"
90                   i18n>Coding chunks (m)</span>
91             <cd-helper [html]="tooltips.m">
92             </cd-helper>
93           </label>
94           <div class="cd-col-form-input">
95             <input type="number"
96                    id="m"
97                    name="m"
98                    class="form-control"
99                    placeholder="Coding chunks..."
100                    formControlName="m">
101             <span class="invalid-feedback"
102                   *ngIf="form.showError('m', frm, 'required')"
103                   i18n>This field is required!</span>
104             <span class="invalid-feedback"
105                   *ngIf="form.showError('m', frm, 'min')"
106                   i18n>Must be equal to or greater than 1.</span>
107           </div>
108         </div>
109
110         <div class="form-group row"
111              *ngIf="plugin === 'shec'">
112           <label for="c"
113                  class="cd-col-form-label">
114             <ng-container i18n>Durability estimator (c)</ng-container>
115             <cd-helper [html]="tooltips.plugins.shec.c">
116             </cd-helper>
117           </label>
118           <div class="cd-col-form-input">
119             <input type="number"
120                    id="c"
121                    name="c"
122                    class="form-control"
123                    placeholder="Coding chunks..."
124                    formControlName="c">
125             <span class="invalid-feedback"
126                   *ngIf="form.showError('c', frm, 'min')"
127                   i18n>Must be equal to or greater than 1.</span>
128           </div>
129         </div>
130
131         <div class="form-group row"
132              *ngIf="plugin === PLUGIN.LRC">
133           <label class="cd-col-form-label"
134                  for="l">
135             <span class="required"
136                   i18n>Locality (l)</span>
137             <cd-helper [html]="tooltips.plugins.lrc.l">
138             </cd-helper>
139           </label>
140           <div class="cd-col-form-input">
141             <input type="number"
142                    id="l"
143                    name="l"
144                    class="form-control"
145                    placeholder="Coding chunks..."
146                    formControlName="l">
147             <span class="invalid-feedback"
148                   *ngIf="form.showError('l', frm, 'required')"
149                   i18n>This field is required!</span>
150             <span class="invalid-feedback"
151                   *ngIf="form.showError('l', frm, 'min')"
152                   i18n>Must be equal to or greater than 1.</span>
153           </div>
154         </div>
155
156         <div class="form-group row">
157           <label for="crushFailureDomain"
158                  class="cd-col-form-label">
159             <ng-container i18n>Crush failure domain</ng-container>
160             <cd-helper [html]="tooltips.crushFailureDomain">
161             </cd-helper>
162           </label>
163           <div class="cd-col-form-input">
164             <select class="form-control custom-select"
165                     id="crushFailureDomain"
166                     name="crushFailureDomain"
167                     formControlName="crushFailureDomain">
168               <option *ngIf="!failureDomains"
169                       ngValue=""
170                       i18n>Loading...</option>
171               <option *ngFor="let domain of failureDomains"
172                       [ngValue]="domain">
173                 {{ domain }}
174               </option>
175             </select>
176           </div>
177         </div>
178
179         <div class="form-group row"
180              *ngIf="plugin === PLUGIN.LRC">
181           <label for="crushLocality"
182                  class="cd-col-form-label">
183             <ng-container i18n>Crush Locality</ng-container>
184             <cd-helper [html]="tooltips.plugins.lrc.crushLocality">
185             </cd-helper>
186           </label>
187           <div class="cd-col-form-input">
188             <select class="form-control custom-select"
189                     id="crushLocality"
190                     name="crushLocality"
191                     formControlName="crushLocality">
192               <option *ngIf="!failureDomains"
193                       ngValue=""
194                       i18n>Loading...</option>
195               <option *ngIf="failureDomains && failureDomains.length > 0"
196                       ngValue=""
197                       i18n>None</option>
198               <option *ngFor="let domain of failureDomains"
199                       [ngValue]="domain">
200                 {{ domain }}
201               </option>
202             </select>
203           </div>
204         </div>
205
206         <div class="form-group row"
207              *ngIf="[PLUGIN.JERASURE, PLUGIN.ISA].includes(plugin)">
208           <label for="technique"
209                  class="cd-col-form-label">
210             <ng-container i18n>Technique</ng-container>
211             <cd-helper [html]="tooltips.plugins[plugin].technique">
212             </cd-helper>
213           </label>
214           <div class="cd-col-form-input">
215             <select class="form-control custom-select"
216                     id="technique"
217                     name="technique"
218                     formControlName="technique">
219               <option *ngFor="let technique of techniques"
220                       [ngValue]="technique">
221                 {{ technique }}
222               </option>
223             </select>
224           </div>
225         </div>
226
227         <div class="form-group row"
228              *ngIf="plugin === PLUGIN.JERASURE">
229           <label for="packetSize"
230                  class="cd-col-form-label">
231             <ng-container i18n>Packetsize</ng-container>
232             <cd-helper [html]="tooltips.plugins.jerasure.packetSize">
233             </cd-helper>
234           </label>
235           <div class="cd-col-form-input">
236             <input type="number"
237                    id="packetSize"
238                    name="packetSize"
239                    class="form-control"
240                    placeholder="Packetsize..."
241                    formControlName="packetSize">
242             <span class="invalid-feedback"
243                   *ngIf="form.showError('packetSize', frm, 'min')"
244                   i18n>Must be equal to or greater than 1.</span>
245           </div>
246         </div>
247
248         <div class="form-group row">
249           <label for="crushRoot"
250                  class="cd-col-form-label">
251             <ng-container i18n>Crush root</ng-container>
252             <cd-helper [html]="tooltips.crushRoot">
253             </cd-helper>
254           </label>
255           <div class="cd-col-form-input">
256             <input type="text"
257                    id="crushRoot"
258                    name="crushRoot"
259                    class="form-control"
260                    placeholder="root..."
261                    formControlName="crushRoot">
262           </div>
263         </div>
264
265         <div class="form-group row">
266           <label for="crushDeviceClass"
267                  class="cd-col-form-label">
268             <ng-container i18n>Crush device class</ng-container>
269             <cd-helper [html]="tooltips.crushDeviceClass">
270             </cd-helper>
271           </label>
272           <div class="cd-col-form-input">
273             <select class="form-control custom-select"
274                     id="crushDeviceClass"
275                     name="crushDeviceClass"
276                     formControlName="crushDeviceClass">
277               <option ngValue=""
278                       i18n>any</option>
279               <option *ngFor="let deviceClass of devices"
280                       [ngValue]="deviceClass">
281                 {{ deviceClass }}
282               </option>
283             </select>
284           </div>
285         </div>
286
287         <div class="form-group row">
288           <label for="directory"
289                  class="cd-col-form-label">
290             <ng-container i18n>Directory</ng-container>
291             <cd-helper [html]="tooltips.directory">
292             </cd-helper>
293           </label>
294           <div class="cd-col-form-input">
295             <input type="text"
296                    id="directory"
297                    name="directory"
298                    class="form-control"
299                    placeholder="Path..."
300                    formControlName="directory">
301           </div>
302         </div>
303       </div>
304
305       <div class="modal-footer">
306         <cd-submit-button (submitAction)="onSubmit()"
307                           i18n="form action button|Example: Create Pool@@formActionButton"
308                           [form]="frm">{{ action | titlecase }} {{ resource | upperFirst }}</cd-submit-button>
309         <cd-back-button [back]="bsModalRef.hide"></cd-back-button>
310       </div>
311     </form>
312   </ng-container>
313 </cd-modal>