1 <div class="modal-header">
2 <h4 class="modal-title pull-left"
3 i18n>Add erasure code profile</h4>
5 class="close pull-right"
7 (click)="bsModalRef.hide()">
8 <span aria-hidden="true">×</span>
12 <form class="form-horizontal"
16 <div class="modal-body">
17 <div class="form-group"
18 [ngClass]="{'has-error': form.showError('name', frm)}">
20 class="control-label col-sm-3">
21 <ng-container i18n>Name</ng-container>
22 <span class="required"></span>
24 <div class="col-sm-9">
30 formControlName="name"
32 <span class="help-block"
33 *ngIf="form.showError('name', frm, 'required')"
34 i18n>This field is required!</span>
35 <span class="help-block"
36 *ngIf="form.showError('name', frm, 'pattern')"
37 i18n>The name can only consist of alphanumeric characters, dashes and underscores.</span>
38 <span class="help-block"
39 *ngIf="form.showError('name', frm, 'uniqueName')"
40 i18n>The chosen erasure code profile name is already in use.</span>
44 <div class="form-group">
46 class="control-label col-sm-3">
47 <ng-container i18n>Plugin</ng-container>
48 <span class="required"></span>
49 <cd-helper [html]="tooltips.plugins[plugin].description">
52 <div class="col-sm-9">
53 <select class="form-control"
56 formControlName="plugin">
57 <option *ngIf="!plugins"
59 i18n>Loading...</option>
60 <option *ngFor="let plugin of plugins"
65 <span class="help-block"
66 *ngIf="form.showError('name', frm, 'required')"
67 i18n>This field is required!</span>
71 <div class="form-group"
72 [ngClass]="{'has-error': form.showError('k', frm)}">
74 class="control-label col-sm-3">
75 <ng-container i18n>Data chunks (k)</ng-container>
76 <span class="required"
77 *ngIf="requiredControls.includes('k')"></span>
78 <cd-helper [html]="tooltips.k">
81 <div class="col-sm-9">
86 ng-model="$ctrl.erasureCodeProfile.k"
87 placeholder="Data chunks..."
89 <span class="help-block"
90 *ngIf="form.showError('k', frm, 'required')"
91 i18n>This field is required!</span>
92 <span class="help-block"
93 *ngIf="form.showError('k', frm, 'min')"
94 i18n>Must be equal to or greater than 2.</span>
98 <div class="form-group"
99 [ngClass]="{'has-error': form.showError('m', frm)}">
101 class="control-label col-sm-3">
102 <ng-container i18n>Coding chunks (m)</ng-container>
103 <span class="required"
104 *ngIf="requiredControls.includes('m')"></span>
105 <cd-helper [html]="tooltips.m">
108 <div class="col-sm-9">
113 placeholder="Coding chunks..."
115 <span class="help-block"
116 *ngIf="form.showError('m', frm, 'required')"
117 i18n>This field is required!</span>
118 <span class="help-block"
119 *ngIf="form.showError('m', frm, 'min')"
120 i18n>Must be equal to or greater than 1.</span>
124 <div class="form-group"
125 *ngIf="plugin === 'shec'"
126 [ngClass]="{'has-error': form.showError('c', frm)}">
128 class="control-label col-sm-3">
129 <ng-container i18n>Durability estimator (c)</ng-container>
130 <cd-helper [html]="tooltips.plugins.shec.c">
133 <div class="col-sm-9">
138 placeholder="Coding chunks..."
140 <span class="help-block"
141 *ngIf="form.showError('c', frm, 'min')"
142 i18n>Must be equal to or greater than 1.</span>
146 <div class="form-group"
147 *ngIf="plugin === PLUGIN.LRC"
148 [ngClass]="{'has-error': form.showError('l', frm)}">
150 class="control-label col-sm-3">
151 <ng-container i18n>Locality (l)</ng-container>
152 <span class="required"></span>
153 <cd-helper [html]="tooltips.plugins.lrc.l">
156 <div class="col-sm-9">
161 placeholder="Coding chunks..."
163 <span class="help-block"
164 *ngIf="form.showError('l', frm, 'required')"
165 i18n>This field is required!</span>
166 <span class="help-block"
167 *ngIf="form.showError('l', frm, 'min')"
168 i18n>Must be equal to or greater than 1.</span>
172 <div class="form-group">
173 <label for="crushFailureDomain"
174 class="control-label col-sm-3">
175 <ng-container i18n>Crush failure domain</ng-container>
176 <cd-helper [html]="tooltips.crushFailureDomain">
179 <div class="col-sm-9">
180 <select class="form-control"
181 id="crushFailureDomain"
182 name="crushFailureDomain"
183 formControlName="crushFailureDomain">
184 <option *ngIf="!failureDomains"
186 i18n>Loading...</option>
187 <option *ngFor="let domain of failureDomains"
195 <div class="form-group"
196 *ngIf="plugin === PLUGIN.LRC">
197 <label for="crushLocality"
198 class="control-label col-sm-3">
199 <ng-container i18n>Crush Locality</ng-container>
200 <cd-helper [html]="tooltips.plugins.lrc.crushLocality">
203 <div class="col-sm-9">
204 <select class="form-control"
207 formControlName="crushLocality">
208 <option *ngIf="!failureDomains"
210 i18n>Loading...</option>
211 <option *ngIf="failureDomains && failureDomains.length > 0"
214 <option *ngFor="let domain of failureDomains"
222 <div class="form-group"
223 *ngIf="[PLUGIN.JERASURE, PLUGIN.ISA].includes(plugin)">
224 <label for="technique"
225 class="control-label col-sm-3">
226 <ng-container i18n>Technique</ng-container>
227 <cd-helper [html]="tooltips.plugins[plugin].technique">
230 <div class="col-sm-9">
231 <select class="form-control"
234 formControlName="technique">
235 <option *ngFor="let technique of techniques"
236 [ngValue]="technique">
243 <div class="form-group"
244 *ngIf="plugin === PLUGIN.JERASURE"
245 [ngClass]="{'has-error': form.showError('packetSize', frm)}">
246 <label for="packetSize"
247 class="control-label col-sm-3">
248 <ng-container i18n>Packetsize</ng-container>
249 <cd-helper [html]="tooltips.plugins.jerasure.packetSize">
252 <div class="col-sm-9">
257 placeholder="Packetsize..."
258 formControlName="packetSize">
259 <span class="help-block"
260 *ngIf="form.showError('packetSize', frm, 'min')"
261 i18n>Must be equal to or greater than 1.</span>
265 <div class="form-group"
266 [ngClass]="{'has-error': form.showError('crushRoot', frm)}">
267 <label for="crushRoot"
268 class="control-label col-sm-3">
269 <ng-container i18n>Crush root</ng-container>
270 <cd-helper [html]="tooltips.crushRoot">
273 <div class="col-sm-9">
278 placeholder="root..."
279 formControlName="crushRoot">
283 <div class="form-group">
284 <label for="crushDeviceClass"
285 class="control-label col-sm-3">
286 <ng-container i18n>Crush device class</ng-container>
287 <cd-helper [html]="tooltips.crushDeviceClass">
290 <div class="col-sm-9">
291 <select class="form-control"
292 id="crushDeviceClass"
293 name="crushDeviceClass"
294 formControlName="crushDeviceClass">
297 <option *ngFor="let deviceClass of devices"
298 [ngValue]="deviceClass">
305 <div class="form-group">
306 <label for="directory"
307 class="control-label col-sm-3">
308 <ng-container i18n>Directory</ng-container>
309 <cd-helper [html]="tooltips.directory">
312 <div class="col-sm-9">
317 placeholder="Path..."
318 formControlName="directory">
323 <div class="modal-footer">
324 <cd-submit-button (submitAction)="onSubmit()"
326 i18n>Add</cd-submit-button>
327 <button class="btn btn-sm btn-default"
329 (click)="bsModalRef.hide()"