1 <div class="modal-header">
2 <h4 class="modal-title pull-left"
3 i18n>Add erasure code profile
6 class="close pull-right"
8 (click)="bsModalRef.hide()">
9 <span aria-hidden="true">×</span>
13 <form class="form-horizontal"
17 <div class="modal-body">
18 <div class="form-group"
19 [ngClass]="{'has-error': form.showError('name', frm)}">
21 class="control-label col-sm-3">
22 <ng-container i18n>Name</ng-container>
23 <span class="required"></span>
25 <div class="col-sm-9">
31 formControlName="name"
35 *ngIf="form.showError('name', frm, 'required')">
36 This field is required!
38 <span class="help-block"
39 *ngIf="form.showError('name', frm, 'pattern')">
40 The name can only consist of alphanumeric characters, dashes and underscores.
44 *ngIf="form.showError('name', frm, 'uniqueName')">
45 The chosen erasure code profile name is already in use.
50 <div class="form-group">
52 class="control-label col-sm-3">
53 <ng-container i18n>Plugin</ng-container>
54 <span class="required"></span>
55 <cd-helper [html]="tooltips.plugins[plugin].description">
58 <div class="col-sm-9">
59 <select class="form-control"
62 formControlName="plugin">
63 <option *ngIf="!plugins"
68 <option *ngFor="let plugin of plugins"
75 *ngIf="form.showError('name', frm, 'required')">
76 This field is required!
81 <div class="form-group"
82 [ngClass]="{'has-error': form.showError('k', frm)}">
85 class="control-label col-sm-3">
87 <span class="required"
88 *ngIf="requiredControls.includes('k')"></span>
89 <cd-helper [html]="tooltips.k">
92 <div class="col-sm-9">
97 ng-model="$ctrl.erasureCodeProfile.k"
98 placeholder="Data chunks..."
102 *ngIf="form.showError('k', frm, 'required')">
103 This field is required!
107 *ngIf="form.showError('k', frm, 'min')">
108 Must be equal to or greater than 2.
113 <div class="form-group"
114 [ngClass]="{'has-error': form.showError('m', frm)}">
116 class="control-label col-sm-3">
117 <ng-container i18n>Coding chunks (m)</ng-container>
118 <span class="required"
119 *ngIf="requiredControls.includes('m')"></span>
120 <cd-helper [html]="tooltips.m">
123 <div class="col-sm-9">
128 placeholder="Coding chunks..."
132 *ngIf="form.showError('m', frm, 'required')">
133 This field is required!
137 *ngIf="form.showError('m', frm, 'min')">
138 Must be equal to or greater than 1.
143 <div class="form-group"
144 *ngIf="plugin === 'shec'"
145 [ngClass]="{'has-error': form.showError('c', frm)}">
147 class="control-label col-sm-3">
148 <ng-container i18n>Durability estimator (c)</ng-container>
149 <cd-helper [html]="tooltips.plugins.shec.c">
152 <div class="col-sm-9">
157 placeholder="Coding chunks..."
161 *ngIf="form.showError('c', frm, 'min')">
162 Must be equal to or greater than 1.
167 <div class="form-group"
168 *ngIf="plugin === PLUGIN.LRC"
169 [ngClass]="{'has-error': form.showError('l', frm)}">
171 class="control-label col-sm-3">
172 <ng-container i18n>Locality (l)</ng-container>
173 <span class="required"></span>
174 <cd-helper [html]="tooltips.plugins.lrc.l">
177 <div class="col-sm-9">
182 placeholder="Coding chunks..."
186 *ngIf="form.showError('l', frm, 'required')">
187 This field is required!
191 *ngIf="form.showError('l', frm, 'min')">
192 Must be equal to or greater than 1.
197 <div class="form-group">
198 <label for="crushFailureDomain"
199 class="control-label col-sm-3">
200 <ng-container i18n>Crush failure domain</ng-container>
201 <cd-helper [html]="tooltips.crushFailureDomain">
204 <div class="col-sm-9">
205 <select class="form-control"
206 id="crushFailureDomain"
207 name="crushFailureDomain"
208 formControlName="crushFailureDomain">
209 <option *ngIf="!failureDomains"
214 <option *ngFor="let domain of failureDomains"
222 <div class="form-group"
223 *ngIf="plugin === PLUGIN.LRC">
224 <label for="crushLocality"
225 class="control-label col-sm-3">
226 <ng-container i18n>Crush Locality</ng-container>
227 <cd-helper [html]="tooltips.plugins.lrc.crushLocality">
230 <div class="col-sm-9">
231 <select class="form-control"
234 formControlName="crushLocality">
235 <option *ngIf="!failureDomains"
240 <option *ngIf="failureDomains && failureDomains.length > 0"
245 <option *ngFor="let domain of failureDomains"
253 <div class="form-group"
254 *ngIf="[PLUGIN.JERASURE, PLUGIN.ISA].includes(plugin)">
255 <label for="technique"
256 class="control-label col-sm-3">
257 <ng-container i18n>Technique</ng-container>
258 <cd-helper [html]="tooltips.plugins[plugin].technique">
261 <div class="col-sm-9">
262 <select class="form-control"
265 formControlName="technique">
266 <option *ngFor="let technique of techniques"
267 [ngValue]="technique">
274 <div class="form-group"
275 *ngIf="plugin === PLUGIN.JERASURE"
276 [ngClass]="{'has-error': form.showError('packetSize', frm)}">
277 <label for="packetSize"
278 class="control-label col-sm-3">
279 <ng-container i18n>Packetsize</ng-container>
280 <cd-helper [html]="tooltips.plugins.jerasure.packetSize">
283 <div class="col-sm-9">
288 placeholder="Packetsize..."
289 formControlName="packetSize">
292 *ngIf="form.showError('packetSize', frm, 'min')">
293 Must be equal to or greater than 1.
298 <div class="form-group"
299 [ngClass]="{'has-error': form.showError('crushRoot', frm)}">
300 <label for="crushRoot"
301 class="control-label col-sm-3">
302 <ng-container i18n>Crush root</ng-container>
303 <cd-helper [html]="tooltips.crushRoot">
306 <div class="col-sm-9">
311 placeholder="root..."
312 formControlName="crushRoot">
316 <div class="form-group">
317 <label for="crushDeviceClass"
318 class="control-label col-sm-3">
319 <ng-container i18n>Crush device class</ng-container>
320 <cd-helper [html]="tooltips.crushDeviceClass">
323 <div class="col-sm-9">
324 <select class="form-control"
325 id="crushDeviceClass"
326 name="crushDeviceClass"
327 formControlName="crushDeviceClass">
332 <option *ngFor="let deviceClass of devices"
333 [ngValue]="deviceClass">
340 <div class="form-group">
341 <label for="directory"
342 class="control-label col-sm-3">
343 <ng-container i18n>Directory</ng-container>
344 <cd-helper [html]="tooltips.directory">
347 <div class="col-sm-9">
352 placeholder="Path..."
353 formControlName="directory">
358 <div class="modal-footer">
359 <cd-submit-button (submitAction)="onSubmit()"
364 <button class="btn btn-sm btn-default"
366 (click)="bsModalRef.hide()"