]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
cbdeb36b1b4a475595fdd09c917d20f8d79f93c3
[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 class="required"
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             <span class="invalid-feedback"
84                   *ngIf="form.showError('k', frm, 'max')"
85                   i18n>Chunks (k+m) have exceeded the available OSDs of {{deviceCount}}.</span>
86             <span class="invalid-feedback"
87                   *ngIf="form.showError('k', frm, 'unequal')"
88                   i18n>For an equal distribution k has to be a multiple of (k+m)/l.</span>
89             <span class="invalid-feedback"
90                   *ngIf="form.showError('k', frm, 'kLowerM')"
91                   i18n>K has to be equal to or greater than m in order to recover data correctly through c.</span>
92             <span *ngIf="plugin === 'lrc'"
93                   class="form-text text-muted"
94                   i18n>Distribution factor: {{lrcMultiK}}</span>
95           </div>
96         </div>
97
98         <div class="form-group row">
99           <label for="m"
100                  class="cd-col-form-label">
101             <span class="required"
102                   i18n>Coding chunks (m)</span>
103             <cd-helper [html]="tooltips.m">
104             </cd-helper>
105           </label>
106           <div class="cd-col-form-input">
107             <input type="number"
108                    id="m"
109                    name="m"
110                    class="form-control"
111                    placeholder="Coding chunks..."
112                    formControlName="m">
113             <span class="invalid-feedback"
114                   *ngIf="form.showError('m', frm, 'required')"
115                   i18n>This field is required!</span>
116             <span class="invalid-feedback"
117                   *ngIf="form.showError('m', frm, 'min')"
118                   i18n>Must be equal to or greater than 1.</span>
119             <span class="invalid-feedback"
120                   *ngIf="form.showError('m', frm, 'max')"
121                   i18n>Chunks (k+m) have exceeded the available OSDs of {{deviceCount}}.</span>
122           </div>
123         </div>
124
125         <div class="form-group row"
126              *ngIf="plugin === 'shec'">
127           <label for="c"
128                  class="cd-col-form-label">
129             <span class="required"
130                   i18n>Durability estimator (c)</span>
131             <cd-helper [html]="tooltips.plugins.shec.c">
132             </cd-helper>
133           </label>
134           <div class="cd-col-form-input">
135             <input type="number"
136                    id="c"
137                    name="c"
138                    class="form-control"
139                    placeholder="Coding chunks..."
140                    formControlName="c">
141             <span class="invalid-feedback"
142                   *ngIf="form.showError('c', frm, 'min')"
143                   i18n>Must be equal to or greater than 1.</span>
144             <span class="invalid-feedback"
145                   *ngIf="form.showError('c', frm, 'cGreaterM')"
146                   i18n>C has to be equal to or lower than m as m defines the amount of chunks that can be used.</span>
147           </div>
148         </div>
149
150         <div class="form-group row"
151              *ngIf="plugin === PLUGIN.LRC">
152           <label class="cd-col-form-label"
153                  for="l">
154             <span class="required"
155                   i18n>Locality (l)</span>
156             <cd-helper [html]="tooltips.plugins.lrc.l">
157             </cd-helper>
158           </label>
159           <div class="cd-col-form-input">
160             <input type="number"
161                    id="l"
162                    name="l"
163                    class="form-control"
164                    placeholder="Coding chunks..."
165                    formControlName="l">
166             <span class="invalid-feedback"
167                   *ngIf="form.showError('l', frm, 'required')"
168                   i18n>This field is required!</span>
169             <span class="invalid-feedback"
170                   *ngIf="form.showError('l', frm, 'min')"
171                   i18n>Must be equal to or greater than 1.</span>
172             <span class="invalid-feedback"
173                   *ngIf="form.showError('l', frm, 'unequal')"
174                   i18n>Can't split up chunks (k+m) correctly with the current locality.</span>
175             <span class="form-text text-muted"
176                   i18n>Locality groups: {{lrcGroups}}</span>
177           </div>
178         </div>
179
180         <div class="form-group row">
181           <label for="crushFailureDomain"
182                  class="cd-col-form-label">
183             <ng-container i18n>Crush failure domain</ng-container>
184             <cd-helper [html]="tooltips.crushFailureDomain">
185             </cd-helper>
186           </label>
187           <div class="cd-col-form-input">
188             <select class="form-control custom-select"
189                     id="crushFailureDomain"
190                     name="crushFailureDomain"
191                     formControlName="crushFailureDomain">
192               <option *ngIf="!failureDomains"
193                       ngValue=""
194                       i18n>Loading...</option>
195               <option *ngFor="let domain of failureDomainKeys"
196                       [ngValue]="domain">
197                 {{ domain }} ( {{failureDomains[domain].length}} )
198               </option>
199             </select>
200           </div>
201         </div>
202
203         <div class="form-group row"
204              *ngIf="plugin === PLUGIN.LRC">
205           <label for="crushLocality"
206                  class="cd-col-form-label">
207             <ng-container i18n>Crush Locality</ng-container>
208             <cd-helper [html]="tooltips.plugins.lrc.crushLocality">
209             </cd-helper>
210           </label>
211           <div class="cd-col-form-input">
212             <select class="form-control custom-select"
213                     id="crushLocality"
214                     name="crushLocality"
215                     formControlName="crushLocality">
216               <option *ngIf="!failureDomains"
217                       ngValue=""
218                       i18n>Loading...</option>
219               <option *ngIf="failureDomainKeys.length > 0"
220                       ngValue=""
221                       i18n>None</option>
222               <option *ngFor="let domain of failureDomainKeys"
223                       [ngValue]="domain">
224                 {{ domain }} ( {{failureDomains[domain].length}} )
225               </option>
226             </select>
227           </div>
228         </div>
229
230         <div class="form-group row"
231              *ngIf="[PLUGIN.JERASURE, PLUGIN.ISA].includes(plugin)">
232           <label for="technique"
233                  class="cd-col-form-label">
234             <ng-container i18n>Technique</ng-container>
235             <cd-helper [html]="tooltips.plugins[plugin].technique">
236             </cd-helper>
237           </label>
238           <div class="cd-col-form-input">
239             <select class="form-control custom-select"
240                     id="technique"
241                     name="technique"
242                     formControlName="technique">
243               <option *ngFor="let technique of techniques"
244                       [ngValue]="technique">
245                 {{ technique }}
246               </option>
247             </select>
248           </div>
249         </div>
250
251         <div class="form-group row"
252              *ngIf="plugin === PLUGIN.JERASURE">
253           <label for="packetSize"
254                  class="cd-col-form-label">
255             <ng-container i18n>Packetsize</ng-container>
256             <cd-helper [html]="tooltips.plugins.jerasure.packetSize">
257             </cd-helper>
258           </label>
259           <div class="cd-col-form-input">
260             <input type="number"
261                    id="packetSize"
262                    name="packetSize"
263                    class="form-control"
264                    placeholder="Packetsize..."
265                    formControlName="packetSize">
266             <span class="invalid-feedback"
267                   *ngIf="form.showError('packetSize', frm, 'min')"
268                   i18n>Must be equal to or greater than 1.</span>
269           </div>
270         </div>
271
272         <div class="form-group row">
273           <label for="crushRoot"
274                  class="cd-col-form-label">
275             <ng-container i18n>Crush root</ng-container>
276             <cd-helper [html]="tooltips.crushRoot">
277             </cd-helper>
278           </label>
279           <div class="cd-col-form-input">
280             <select class="form-control custom-select"
281                     id="crushRoot"
282                     name="crushRoot"
283                     formControlName="crushRoot">
284               <option *ngIf="!buckets"
285                       ngValue=""
286                       i18n>Loading...</option>
287               <option *ngFor="let bucket of buckets"
288                       [ngValue]="bucket">
289                 {{ bucket.name }}
290               </option>
291             </select>
292           </div>
293         </div>
294
295         <div class="form-group row">
296           <label for="crushDeviceClass"
297                  class="cd-col-form-label">
298             <ng-container i18n>Crush device class</ng-container>
299             <cd-helper [html]="tooltips.crushDeviceClass">
300             </cd-helper>
301           </label>
302           <div class="cd-col-form-input">
303             <select class="form-control custom-select"
304                     id="crushDeviceClass"
305                     name="crushDeviceClass"
306                     formControlName="crushDeviceClass">
307               <option ngValue=""
308                       i18n>Let Ceph decide</option>
309               <option *ngFor="let deviceClass of devices"
310                       [ngValue]="deviceClass">
311                 {{ deviceClass }}
312               </option>
313             </select>
314             <span class="form-text text-muted"
315                   i18n>Available OSDs: {{deviceCount}}</span>
316           </div>
317         </div>
318
319         <div class="form-group row">
320           <label for="directory"
321                  class="cd-col-form-label">
322             <ng-container i18n>Directory</ng-container>
323             <cd-helper [html]="tooltips.directory">
324             </cd-helper>
325           </label>
326           <div class="cd-col-form-input">
327             <input type="text"
328                    id="directory"
329                    name="directory"
330                    class="form-control"
331                    placeholder="Path..."
332                    formControlName="directory">
333           </div>
334         </div>
335       </div>
336
337       <div class="modal-footer">
338         <cd-submit-button (submitAction)="onSubmit()"
339                           i18n="form action button|Example: Create Pool@@formActionButton"
340                           [form]="frm">{{ action | titlecase }} {{ resource | upperFirst }}</cd-submit-button>
341         <cd-back-button [back]="bsModalRef.hide"></cd-back-button>
342       </div>
343     </form>
344   </ng-container>
345 </cd-modal>