1 <div class=
"cd-col-form"
2 *
cdFormLoading=
"loading">
9 class=
"card-header">{{ action | titlecase }} {{ resource | upperFirst }}
</div>
10 <div class=
"card-body">
13 <div class=
"form-group row"
14 *
ngIf=
"rbdForm.getValue('parent')">
16 class=
"cd-col-form-label"
17 for=
"name">{{ action | titlecase }} from
</label>
18 <div class=
"cd-col-form-input">
19 <input class=
"form-control"
23 formControlName=
"parent">
29 <div class=
"form-group row">
30 <label class=
"cd-col-form-label required"
33 <div class=
"cd-col-form-input">
34 <input class=
"form-control"
39 formControlName=
"name"
41 <span class=
"invalid-feedback"
42 *
ngIf=
"rbdForm.showError('name', formDir, 'required')">
43 <ng-container i18n
>This field is required.
</ng-container>
45 <span class=
"invalid-feedback"
46 *
ngIf=
"rbdForm.showError('name', formDir, 'pattern')">
47 <ng-container i18n
>'/' and '@' are not allowed.
</ng-container>
53 <div class=
"form-group row"
54 (change)=
"onPoolChange($event.target.value)">
55 <label class=
"cd-col-form-label"
56 [ngClass]=
"{'required': mode !== 'editing'}"
59 <div class=
"cd-col-form-input">
60 <input class=
"form-control"
62 placeholder=
"Pool name..."
65 formControlName=
"pool"
66 *
ngIf=
"mode === 'editing' || !poolPermission.read">
70 formControlName=
"pool"
71 *
ngIf=
"mode !== 'editing' && poolPermission.read">
72 <option *
ngIf=
"pools === null"
74 i18n
>Loading...
</option>
75 <option *
ngIf=
"pools !== null && pools.length === 0"
77 i18n
>-- No rbd pools available --
</option>
78 <option *
ngIf=
"pools !== null && pools.length > 0"
80 i18n
>-- Select a pool --
</option>
81 <option *
ngFor=
"let pool of pools"
82 [value]=
"pool.pool_name">{{ pool.pool_name }}
</option>
84 <span *
ngIf=
"rbdForm.showError('pool', formDir, 'required')"
85 class=
"invalid-feedback"
86 i18n
>This field is required.
</span>
91 <div class=
"form-group row"
92 *
ngIf=
"mode !== 'editing' && rbdForm.getValue('pool') && namespaces === null">
93 <div class=
"cd-col-form-offset">
94 <i [ngClass]=
"[icons.spinner, icons.spin]"></i>
97 <div class=
"form-group row"
98 *
ngIf=
"(mode === 'editing' && rbdForm.getValue('namespace')) || mode !== 'editing' && (namespaces && namespaces.length > 0 || !poolPermission.read)">
99 <label class=
"cd-col-form-label"
103 <div class=
"cd-col-form-input">
104 <input class=
"form-control"
106 placeholder=
"Namespace..."
109 formControlName=
"namespace"
110 *
ngIf=
"mode === 'editing' || !poolPermission.read">
111 <select id=
"namespace"
114 formControlName=
"namespace"
115 *
ngIf=
"mode !== 'editing' && poolPermission.read">
116 <option *
ngIf=
"pools === null"
118 i18n
>Loading...
</option>
119 <option *
ngIf=
"pools !== null && pools.length === 0"
121 i18n
>-- No namespaces available --
</option>
122 <option *
ngIf=
"pools !== null && pools.length > 0"
124 i18n
>-- Select a namespace --
</option>
125 <option *
ngFor=
"let namespace of namespaces"
126 [value]=
"namespace">{{ namespace }}
</option>
131 <!-- Use a dedicated pool -->
132 <div class=
"form-group row">
133 <div class=
"cd-col-form-offset">
134 <div class=
"custom-control custom-checkbox">
135 <input type=
"checkbox"
136 class=
"custom-control-input"
139 formControlName=
"useDataPool"
140 (change)=
"onUseDataPoolChange()">
141 <label class=
"custom-control-label"
143 i18n
>Use a dedicated data pool
</label>
144 <cd-helper *
ngIf=
"allDataPools.length <= 1">
145 <span i18n
>You need more than one pool with the rbd application label use to use a dedicated data pool.
</span>
152 <div class=
"form-group row"
153 *
ngIf=
"rbdForm.getValue('useDataPool')">
154 <label class=
"cd-col-form-label"
156 <span [ngClass]=
"{'required': mode !== 'editing'}"
157 i18n
>Data pool
</span>
159 html=
"Dedicated pool that stores the object-data of the RBD.">
162 <div class=
"cd-col-form-input">
163 <input class=
"form-control"
165 placeholder=
"Data pool name..."
168 formControlName=
"dataPool"
169 *
ngIf=
"mode === 'editing' || !poolPermission.read">
170 <select id=
"dataPool"
173 formControlName=
"dataPool"
174 (change)=
"onDataPoolChange($event.target.value)"
175 *
ngIf=
"mode !== 'editing' && poolPermission.read">
176 <option *
ngIf=
"dataPools === null"
178 i18n
>Loading...
</option>
179 <option *
ngIf=
"dataPools !== null && dataPools.length === 0"
181 i18n
>-- No data pools available --
</option>
182 <option *
ngIf=
"dataPools !== null && dataPools.length > 0"
183 [ngValue]=
"null">-- Select a data pool --
185 <option *
ngFor=
"let dataPool of dataPools"
186 [value]=
"dataPool.pool_name">{{ dataPool.pool_name }}
</option>
188 <span class=
"invalid-feedback"
189 *
ngIf=
"rbdForm.showError('dataPool', formDir, 'required')"
190 i18n
>This field is required.
</span>
195 <div class=
"form-group row">
196 <label class=
"cd-col-form-label required"
199 <div class=
"cd-col-form-input">
204 formControlName=
"size"
206 placeholder=
"e.g., 10GiB"
209 <span class=
"invalid-feedback"
210 *
ngIf=
"rbdForm.showError('size', formDir, 'required')"
211 i18n
>This field is required.
</span>
212 <span class=
"invalid-feedback"
213 *
ngIf=
"rbdForm.showError('size', formDir, 'invalidSizeObject')"
214 i18n
>You have to increase the size.
</span>
219 <div class=
"form-group row"
220 formGroupName=
"features">
222 class=
"cd-col-form-label"
223 for=
"features">Features
</label>
224 <div class=
"cd-col-form-input">
225 <div class=
"custom-control custom-checkbox"
226 *
ngFor=
"let feature of featuresList">
227 <input type=
"checkbox"
228 class=
"custom-control-input"
229 id=
"{{ feature.key }}"
230 name=
"{{ feature.key }}"
231 formControlName=
"{{ feature.key }}">
232 <label class=
"custom-control-label"
233 for=
"{{ feature.key }}">{{ feature.desc }}
</label>
234 <cd-helper *
ngIf=
"feature.helperHtml"
235 html=
"{{ feature.helperHtml }}">
243 <div class=
"col-sm-12">
244 <a class=
"float-right margin-right-md"
245 (click)=
"advancedEnabled = true; false"
246 *
ngIf=
"!advancedEnabled"
252 <div [hidden]=
"!advancedEnabled">
254 <legend class=
"cd-header"
255 i18n
>Advanced
</legend>
257 <div class=
"col-md-12">
258 <h4 class=
"cd-header"
262 <div class=
"form-group row">
264 class=
"cd-col-form-label"
265 for=
"size">Object size
</label>
266 <div class=
"cd-col-form-input">
267 <select id=
"obj_size"
270 formControlName=
"obj_size">
271 <option *
ngFor=
"let objectSize of objectSizes"
272 [value]=
"objectSize">{{ objectSize }}
</option>
277 <!-- stripingUnit -->
278 <div class=
"form-group row">
279 <label class=
"cd-col-form-label"
280 [ngClass]=
"{'required': rbdForm.getValue('stripingCount')}"
282 i18n
>Stripe unit
</label>
283 <div class=
"cd-col-form-input">
284 <select id=
"stripingUnit"
287 formControlName=
"stripingUnit">
289 [ngValue]=
"null">-- Select stripe unit --
</option>
290 <option *
ngFor=
"let objectSize of objectSizes"
291 [value]=
"objectSize">{{ objectSize }}
</option>
293 <span class=
"invalid-feedback"
294 *
ngIf=
"rbdForm.showError('stripingUnit', formDir, 'required')"
295 i18n
>This field is required because stripe count is defined!
</span>
296 <span class=
"invalid-feedback"
297 *
ngIf=
"rbdForm.showError('stripingUnit', formDir, 'invalidStripingUnit')"
298 i18n
>Stripe unit is greater than object size.
</span>
302 <!-- Stripe Count -->
303 <div class=
"form-group row">
304 <label class=
"cd-col-form-label"
305 [ngClass]=
"{'required': rbdForm.getValue('stripingUnit')}"
307 i18n
>Stripe count
</label>
308 <div class=
"cd-col-form-input">
309 <input id=
"stripingCount"
311 formControlName=
"stripingCount"
314 <span class=
"invalid-feedback"
315 *
ngIf=
"rbdForm.showError('stripingCount', formDir, 'required')"
316 i18n
>This field is required because stripe unit is defined!
</span>
317 <span class=
"invalid-feedback"
318 *
ngIf=
"rbdForm.showError('stripingCount', formDir, 'min')"
319 i18n
>Stripe count must be greater than
0.
</span>
324 <cd-rbd-configuration-form [form]=
"rbdForm"
325 [initializeData]=
"initializeConfigData"
326 (changes)=
"getDirtyConfigurationValues = $event"></cd-rbd-configuration-form>
330 <div class=
"card-footer">
331 <cd-form-button-panel (submitActionEvent)=
"submit()"
333 [submitText]=
"(action | titlecase) + ' ' + (resource | upperFirst)"
334 wrappingClass=
"text-right"></cd-form-button-panel>