]>
Commit | Line | Data |
---|---|---|
9f95a23c | 1 | <div class="cd-col-form" |
f67539c2 | 2 | *cdFormLoading="loading"> |
9f95a23c | 3 | <form #frm="ngForm" |
11fdf7f2 TL |
4 | [formGroup]="userForm" |
5 | novalidate> | |
9f95a23c | 6 | <div class="card"> |
a4b75251 | 7 | <div i18n="form title" |
9f95a23c | 8 | class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div> |
11fdf7f2 | 9 | |
9f95a23c | 10 | <div class="card-body"> |
f67539c2 | 11 | <!-- User ID --> |
9f95a23c TL |
12 | <div class="form-group row"> |
13 | <label class="cd-col-form-label" | |
14 | [ngClass]="{'required': !editing}" | |
f67539c2 TL |
15 | for="user_id" |
16 | i18n>User ID</label> | |
17 | <div class="cd-col-form-input"> | |
18 | <input id="user_id" | |
19 | class="form-control" | |
20 | type="text" | |
21 | formControlName="user_id" | |
22 | [readonly]="editing"> | |
23 | <span class="invalid-feedback" | |
24 | *ngIf="userForm.showError('user_id', frm, 'required')" | |
25 | i18n>This field is required.</span> | |
26 | <span class="invalid-feedback" | |
27 | *ngIf="userForm.showError('user_id', frm, 'pattern')" | |
28 | i18n>The value is not valid.</span> | |
29 | <span class="invalid-feedback" | |
30 | *ngIf="!userForm.getValue('show_tenant') && userForm.showError('user_id', frm, 'notUnique')" | |
31 | i18n>The chosen user ID is already in use.</span> | |
32 | </div> | |
33 | </div> | |
34 | ||
35 | <!-- Show Tenant --> | |
36 | <div class="form-group row"> | |
37 | <div class="cd-col-form-offset"> | |
38 | <div class="custom-control custom-checkbox"> | |
39 | <input class="custom-control-input" | |
40 | id="show_tenant" | |
41 | type="checkbox" | |
42 | (click)="updateFieldsWhenTenanted()" | |
43 | formControlName="show_tenant" | |
44 | [readonly]="true"> | |
45 | <label class="custom-control-label" | |
46 | for="show_tenant" | |
47 | i18n>Show Tenant</label> | |
48 | </div> | |
49 | </div> | |
50 | </div> | |
51 | ||
52 | <!-- Tenant --> | |
53 | <div class="form-group row" | |
54 | *ngIf="userForm.getValue('show_tenant')"> | |
55 | <label class="cd-col-form-label" | |
56 | for="tenant" | |
57 | i18n>Tenant</label> | |
9f95a23c | 58 | <div class="cd-col-form-input"> |
f67539c2 | 59 | <input id="tenant" |
11fdf7f2 TL |
60 | class="form-control" |
61 | type="text" | |
f67539c2 | 62 | formControlName="tenant" |
11fdf7f2 TL |
63 | [readonly]="editing" |
64 | autofocus> | |
9f95a23c | 65 | <span class="invalid-feedback" |
f67539c2 TL |
66 | *ngIf="userForm.showError('tenant', frm, 'pattern')" |
67 | i18n>The value is not valid.</span> | |
9f95a23c | 68 | <span class="invalid-feedback" |
f67539c2 TL |
69 | *ngIf="userForm.showError('tenant', frm, 'notUnique')" |
70 | i18n>The chosen user ID exists in this tenant.</span> | |
11fdf7f2 TL |
71 | </div> |
72 | </div> | |
73 | ||
74 | <!-- Full name --> | |
9f95a23c TL |
75 | <div class="form-group row"> |
76 | <label class="cd-col-form-label" | |
77 | [ngClass]="{'required': !editing}" | |
78 | for="display_name" | |
79 | i18n>Full name</label> | |
80 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
81 | <input id="display_name" |
82 | class="form-control" | |
83 | type="text" | |
84 | formControlName="display_name"> | |
2a845540 TL |
85 | <span class="invalid-feedback" |
86 | *ngIf="userForm.showError('display_name', frm, 'pattern')" | |
87 | i18n>The value is not valid.</span> | |
9f95a23c | 88 | <span class="invalid-feedback" |
11fdf7f2 TL |
89 | *ngIf="userForm.showError('display_name', frm, 'required')" |
90 | i18n>This field is required.</span> | |
91 | </div> | |
92 | </div> | |
93 | ||
94 | <!-- Email address --> | |
9f95a23c TL |
95 | <div class="form-group row"> |
96 | <label class="cd-col-form-label" | |
11fdf7f2 TL |
97 | for="email" |
98 | i18n>Email address</label> | |
9f95a23c | 99 | <div class="cd-col-form-input"> |
11fdf7f2 TL |
100 | <input id="email" |
101 | class="form-control" | |
102 | type="text" | |
103 | formControlName="email"> | |
9f95a23c | 104 | <span class="invalid-feedback" |
11fdf7f2 TL |
105 | *ngIf="userForm.showError('email', frm, 'email')" |
106 | i18n>This is not a valid email address.</span> | |
9f95a23c | 107 | <span class="invalid-feedback" |
11fdf7f2 TL |
108 | *ngIf="userForm.showError('email', frm, 'notUnique')" |
109 | i18n>The chosen email address is already in use.</span> | |
110 | </div> | |
111 | </div> | |
112 | ||
113 | <!-- Max. buckets --> | |
9f95a23c TL |
114 | <div class="form-group row"> |
115 | <label class="cd-col-form-label" | |
116 | for="max_buckets_mode" | |
117 | i18n>Max. buckets</label> | |
118 | <div class="cd-col-form-input"> | |
39ae355f | 119 | <select class="form-select" |
9f95a23c TL |
120 | formControlName="max_buckets_mode" |
121 | name="max_buckets_mode" | |
f6b5b4d7 TL |
122 | id="max_buckets_mode" |
123 | (change)="onMaxBucketsModeChange($event.target.value)"> | |
9f95a23c TL |
124 | <option i18n |
125 | value="-1">Disabled</option> | |
126 | <option i18n | |
127 | value="0">Unlimited</option> | |
128 | <option i18n | |
129 | value="1">Custom</option> | |
130 | </select> | |
131 | </div> | |
132 | </div> | |
133 | <div *ngIf="1 == userForm.get('max_buckets_mode').value" | |
134 | class="form-group row"> | |
135 | <label class="cd-col-form-label"></label> | |
136 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
137 | <input id="max_buckets" |
138 | class="form-control" | |
139 | type="number" | |
9f95a23c TL |
140 | formControlName="max_buckets" |
141 | min="1"> | |
142 | <span class="invalid-feedback" | |
11fdf7f2 TL |
143 | *ngIf="userForm.showError('max_buckets', frm, 'required')" |
144 | i18n>This field is required.</span> | |
9f95a23c | 145 | <span class="invalid-feedback" |
11fdf7f2 | 146 | *ngIf="userForm.showError('max_buckets', frm, 'min')" |
9f95a23c | 147 | i18n>The entered value must be >= 1.</span> |
11fdf7f2 TL |
148 | </div> |
149 | </div> | |
150 | ||
151 | <!-- Suspended --> | |
9f95a23c TL |
152 | <div class="form-group row"> |
153 | <div class="cd-col-form-offset"> | |
154 | <div class="custom-control custom-checkbox"> | |
155 | <input class="custom-control-input" | |
156 | id="suspended" | |
11fdf7f2 TL |
157 | type="checkbox" |
158 | formControlName="suspended"> | |
9f95a23c TL |
159 | <label class="custom-control-label" |
160 | for="suspended" | |
11fdf7f2 | 161 | i18n>Suspended</label> |
1e59de90 | 162 | <cd-helper i18n>Suspending the user disables the user and subuser.</cd-helper> |
11fdf7f2 TL |
163 | </div> |
164 | </div> | |
165 | </div> | |
166 | ||
167 | <!-- S3 key --> | |
168 | <fieldset *ngIf="!editing"> | |
169 | <legend i18n>S3 key</legend> | |
170 | ||
171 | <!-- Auto-generate key --> | |
9f95a23c TL |
172 | <div class="form-group row"> |
173 | <div class="cd-col-form-offset"> | |
174 | <div class="custom-control custom-checkbox"> | |
175 | <input class="custom-control-input" | |
176 | id="generate_key" | |
11fdf7f2 TL |
177 | type="checkbox" |
178 | formControlName="generate_key"> | |
9f95a23c TL |
179 | <label class="custom-control-label" |
180 | for="generate_key" | |
11fdf7f2 TL |
181 | i18n>Auto-generate key</label> |
182 | </div> | |
183 | </div> | |
184 | </div> | |
185 | ||
186 | <!-- Access key --> | |
9f95a23c | 187 | <div class="form-group row" |
11fdf7f2 | 188 | *ngIf="!editing && !userForm.getValue('generate_key')"> |
9f95a23c TL |
189 | <label class="cd-col-form-label required" |
190 | for="access_key" | |
191 | i18n>Access key</label> | |
192 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
193 | <div class="input-group"> |
194 | <input id="access_key" | |
195 | class="form-control" | |
196 | type="password" | |
197 | formControlName="access_key"> | |
39ae355f TL |
198 | <button type="button" |
199 | class="btn btn-light" | |
200 | cdPasswordButton="access_key"> | |
201 | </button> | |
202 | <cd-copy-2-clipboard-button source="access_key"> | |
203 | </cd-copy-2-clipboard-button> | |
11fdf7f2 | 204 | </div> |
9f95a23c | 205 | <span class="invalid-feedback" |
11fdf7f2 TL |
206 | *ngIf="userForm.showError('access_key', frm, 'required')" |
207 | i18n>This field is required.</span> | |
208 | </div> | |
209 | </div> | |
210 | ||
211 | <!-- Secret key --> | |
9f95a23c | 212 | <div class="form-group row" |
11fdf7f2 | 213 | *ngIf="!editing && !userForm.getValue('generate_key')"> |
9f95a23c TL |
214 | <label class="cd-col-form-label required" |
215 | for="secret_key" | |
216 | i18n>Secret key</label> | |
217 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
218 | <div class="input-group"> |
219 | <input id="secret_key" | |
220 | class="form-control" | |
221 | type="password" | |
222 | formControlName="secret_key"> | |
39ae355f TL |
223 | <button type="button" |
224 | class="btn btn-light" | |
225 | cdPasswordButton="secret_key"> | |
226 | </button> | |
227 | <cd-copy-2-clipboard-button source="secret_key"> | |
228 | </cd-copy-2-clipboard-button> | |
11fdf7f2 | 229 | </div> |
9f95a23c | 230 | <span class="invalid-feedback" |
11fdf7f2 TL |
231 | *ngIf="userForm.showError('secret_key', frm, 'required')" |
232 | i18n>This field is required.</span> | |
233 | </div> | |
234 | </div> | |
235 | </fieldset> | |
236 | ||
237 | <!-- Subusers --> | |
238 | <fieldset *ngIf="editing"> | |
239 | <legend i18n>Subusers</legend> | |
9f95a23c TL |
240 | <div class="row"> |
241 | <div class="cd-col-form-offset"> | |
242 | <span *ngIf="subusers.length === 0" | |
243 | class="no-border"> | |
244 | <span class="form-text text-muted" | |
245 | i18n>There are no subusers.</span> | |
246 | </span> | |
247 | ||
248 | <span *ngFor="let subuser of subusers; let i=index;"> | |
249 | <div class="input-group"> | |
39ae355f TL |
250 | <span class="input-group-text"> |
251 | <i class="{{ icons.user }}"></i> | |
252 | </span> | |
9f95a23c TL |
253 | <input type="text" |
254 | class="cd-form-control" | |
255 | value="{{ subuser.id }}" | |
256 | readonly> | |
39ae355f TL |
257 | <span class="input-group-text"> |
258 | <i class="{{ icons.share }}"></i> | |
259 | </span> | |
9f95a23c TL |
260 | <input type="text" |
261 | class="cd-form-control" | |
262 | value="{{ ('full-control' === subuser.permissions) ? 'full' : subuser.permissions }}" | |
263 | readonly> | |
39ae355f TL |
264 | <button type="button" |
265 | class="btn btn-light tc_showSubuserButton" | |
266 | i18n-ngbTooltip | |
267 | ngbTooltip="Edit" | |
268 | (click)="showSubuserModal(i)"> | |
269 | <i [ngClass]="[icons.edit]"></i> | |
270 | </button> | |
271 | <button type="button" | |
272 | class="btn btn-light tc_deleteSubuserButton" | |
273 | i18n-ngbTooltip | |
274 | ngbTooltip="Delete" | |
275 | (click)="deleteSubuser(i)"> | |
276 | <i [ngClass]="[icons.destroy]"></i> | |
277 | </button> | |
9f95a23c TL |
278 | </div> |
279 | <span class="form-text text-muted"></span> | |
280 | </span> | |
281 | ||
39ae355f | 282 | <div class="row my-2"> |
9f95a23c | 283 | <div class="col-12"> |
11fdf7f2 | 284 | <button type="button" |
39ae355f | 285 | class="btn btn-light float-end tc_addSubuserButton" |
9f95a23c TL |
286 | (click)="showSubuserModal()"> |
287 | <i [ngClass]="[icons.add]"></i> | |
288 | <ng-container i18n>{{ actionLabels.CREATE | titlecase }} | |
289 | {{ subuserLabel | upperFirst }}</ng-container> | |
11fdf7f2 | 290 | </button> |
9f95a23c | 291 | </div> |
11fdf7f2 TL |
292 | </div> |
293 | <span class="help-block"></span> | |
9f95a23c | 294 | </div> |
11fdf7f2 TL |
295 | </div> |
296 | </fieldset> | |
297 | ||
298 | <!-- Keys --> | |
299 | <fieldset *ngIf="editing"> | |
300 | <legend i18n>Keys</legend> | |
301 | ||
302 | <!-- S3 keys --> | |
9f95a23c TL |
303 | <div class="form-group row"> |
304 | <label class="cd-col-form-label" | |
305 | i18n>S3</label> | |
306 | <div class="cd-col-form-input"> | |
307 | <span *ngIf="s3Keys.length === 0" | |
308 | class="no-border"> | |
309 | <span class="form-text text-muted" | |
310 | i18n>There are no keys.</span> | |
311 | </span> | |
312 | ||
313 | <span *ngFor="let key of s3Keys; let i=index;"> | |
314 | <div class="input-group"> | |
39ae355f TL |
315 | <div class="input-group-text"> |
316 | <i class="{{ icons.key }}"></i> | |
9f95a23c TL |
317 | </div> |
318 | <input type="text" | |
319 | class="cd-form-control" | |
320 | value="{{ key.user }}" | |
321 | readonly> | |
39ae355f TL |
322 | <button type="button" |
323 | class="btn btn-light tc_showS3KeyButton" | |
324 | i18n-ngbTooltip | |
325 | ngbTooltip="Show" | |
326 | (click)="showS3KeyModal(i)"> | |
327 | <i [ngClass]="[icons.show]"></i> | |
328 | </button> | |
329 | <button type="button" | |
330 | class="btn btn-light tc_deleteS3KeyButton" | |
331 | i18n-ngbTooltip | |
332 | ngbTooltip="Delete" | |
333 | (click)="deleteS3Key(i)"> | |
334 | <i [ngClass]="[icons.destroy]"></i> | |
335 | </button> | |
9f95a23c TL |
336 | </div> |
337 | <span class="form-text text-muted"></span> | |
338 | </span> | |
339 | ||
39ae355f | 340 | <div class="row my-2"> |
9f95a23c | 341 | <div class="col-12"> |
11fdf7f2 | 342 | <button type="button" |
39ae355f | 343 | class="btn btn-light float-end tc_addS3KeyButton" |
9f95a23c TL |
344 | (click)="showS3KeyModal()"> |
345 | <i [ngClass]="[icons.add]"></i> | |
346 | <ng-container i18n>{{ actionLabels.CREATE | titlecase }} | |
347 | {{ s3keyLabel | upperFirst }}</ng-container> | |
11fdf7f2 | 348 | </button> |
9f95a23c | 349 | </div> |
11fdf7f2 | 350 | </div> |
9f95a23c | 351 | |
11fdf7f2 | 352 | <span class="help-block"></span> |
9f95a23c TL |
353 | </div> |
354 | ||
11fdf7f2 TL |
355 | <hr> |
356 | </div> | |
357 | ||
358 | <!-- Swift keys --> | |
9f95a23c TL |
359 | <div class="form-group row"> |
360 | <label class="cd-col-form-label" | |
361 | i18n>Swift</label> | |
362 | ||
363 | <div class="cd-col-form-input"> | |
364 | <span *ngIf="swiftKeys.length === 0" | |
365 | class="no-border"> | |
366 | <span class="form-text text-muted" | |
367 | i18n>There are no keys.</span> | |
368 | </span> | |
369 | ||
370 | <span *ngFor="let key of swiftKeys; let i=index;"> | |
371 | <div class="input-group"> | |
39ae355f TL |
372 | <span class="input-group-text"> |
373 | <i class="{{ icons.key }}"></i> | |
374 | </span> | |
9f95a23c TL |
375 | <input type="text" |
376 | class="cd-form-control" | |
377 | value="{{ key.user }}" | |
378 | readonly> | |
39ae355f TL |
379 | <button type="button" |
380 | class="btn btn-light tc_showSwiftKeyButton" | |
381 | i18n-ngbTooltip | |
382 | ngbTooltip="Show" | |
383 | (click)="showSwiftKeyModal(i)"> | |
384 | <i [ngClass]="[icons.show]"></i> | |
385 | </button> | |
9f95a23c TL |
386 | </div> |
387 | <span class="form-text text-muted"></span> | |
388 | </span> | |
389 | </div> | |
11fdf7f2 TL |
390 | </div> |
391 | </fieldset> | |
392 | ||
393 | <!-- Capabilities --> | |
394 | <fieldset *ngIf="editing"> | |
395 | <legend i18n>Capabilities</legend> | |
396 | ||
9f95a23c TL |
397 | <div class="form-group row"> |
398 | <div class="cd-col-form-offset"> | |
399 | <span *ngIf="capabilities.length === 0" | |
400 | class="no-border"> | |
401 | <span class="form-text text-muted" | |
402 | i18n>There are no capabilities.</span> | |
403 | </span> | |
404 | ||
405 | <span *ngFor="let cap of capabilities; let i=index;"> | |
406 | <div class="input-group"> | |
39ae355f TL |
407 | <div class="input-group-text"> |
408 | <i class="{{ icons.share }}"></i> | |
409 | </div> | |
9f95a23c TL |
410 | <input type="text" |
411 | class="cd-form-control" | |
412 | value="{{ cap.type }}:{{ cap.perm }}" | |
413 | readonly> | |
39ae355f TL |
414 | <button type="button" |
415 | class="btn btn-light tc_editCapButton" | |
416 | i18n-ngbTooltip | |
417 | ngbTooltip="Edit" | |
418 | (click)="showCapabilityModal(i)"> | |
419 | <i [ngClass]="[icons.edit]"></i> | |
420 | </button> | |
421 | <button type="button" | |
422 | class="btn btn-light tc_deleteCapButton" | |
423 | i18n-ngbTooltip | |
424 | ngbTooltip="Delete" | |
425 | (click)="deleteCapability(i)"> | |
426 | <i [ngClass]="[icons.destroy]"></i> | |
427 | </button> | |
9f95a23c TL |
428 | </div> |
429 | <span class="form-text text-muted"></span> | |
430 | </span> | |
431 | ||
39ae355f | 432 | <div class="row my-2"> |
9f95a23c | 433 | <div class="col-12"> |
11fdf7f2 | 434 | <button type="button" |
39ae355f | 435 | class="btn btn-light float-end tc_addCapButton" |
f67539c2 TL |
436 | [disabled]="capabilities | pipeFunction:hasAllCapabilities" |
437 | i18n-ngbTooltip | |
438 | ngbTooltip="All capabilities are already added." | |
439 | [disableTooltip]="!(capabilities | pipeFunction:hasAllCapabilities)" | |
440 | triggers="pointerenter:pointerleave" | |
9f95a23c TL |
441 | (click)="showCapabilityModal()"> |
442 | <i [ngClass]="[icons.add]"></i> | |
443 | <ng-container i18n>{{ actionLabels.ADD | titlecase }} | |
444 | {{ capabilityLabel | upperFirst }}</ng-container> | |
11fdf7f2 | 445 | </button> |
9f95a23c | 446 | </div> |
11fdf7f2 TL |
447 | </div> |
448 | <span class="help-block"></span> | |
9f95a23c | 449 | </div> |
11fdf7f2 TL |
450 | </div> |
451 | </fieldset> | |
452 | ||
453 | <!-- User quota --> | |
454 | <fieldset> | |
455 | <legend i18n>User quota</legend> | |
456 | ||
457 | <!-- Enabled --> | |
9f95a23c TL |
458 | <div class="form-group row"> |
459 | <div class="cd-col-form-offset"> | |
460 | <div class="custom-control custom-checkbox"> | |
461 | <input class="custom-control-input" | |
462 | id="user_quota_enabled" | |
11fdf7f2 TL |
463 | type="checkbox" |
464 | formControlName="user_quota_enabled"> | |
9f95a23c TL |
465 | <label class="custom-control-label" |
466 | for="user_quota_enabled" | |
11fdf7f2 TL |
467 | i18n>Enabled</label> |
468 | </div> | |
469 | </div> | |
470 | </div> | |
471 | ||
472 | <!-- Unlimited size --> | |
9f95a23c | 473 | <div class="form-group row" |
11fdf7f2 | 474 | *ngIf="userForm.controls.user_quota_enabled.value"> |
9f95a23c TL |
475 | <div class="cd-col-form-offset"> |
476 | <div class="custom-control custom-checkbox"> | |
477 | <input class="custom-control-input" | |
478 | id="user_quota_max_size_unlimited" | |
11fdf7f2 TL |
479 | type="checkbox" |
480 | formControlName="user_quota_max_size_unlimited"> | |
9f95a23c TL |
481 | <label class="custom-control-label" |
482 | for="user_quota_max_size_unlimited" | |
11fdf7f2 TL |
483 | i18n>Unlimited size</label> |
484 | </div> | |
485 | </div> | |
486 | </div> | |
487 | ||
488 | <!-- Maximum size --> | |
9f95a23c TL |
489 | <div class="form-group row" |
490 | *ngIf="userForm.controls.user_quota_enabled.value && !userForm.getValue('user_quota_max_size_unlimited')"> | |
491 | <label class="cd-col-form-label required" | |
492 | for="user_quota_max_size" | |
493 | i18n>Max. size</label> | |
494 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
495 | <input id="user_quota_max_size" |
496 | class="form-control" | |
497 | type="text" | |
498 | formControlName="user_quota_max_size" | |
499 | cdDimlessBinary> | |
9f95a23c | 500 | <span class="invalid-feedback" |
11fdf7f2 TL |
501 | *ngIf="userForm.showError('user_quota_max_size', frm, 'required')" |
502 | i18n>This field is required.</span> | |
9f95a23c | 503 | <span class="invalid-feedback" |
11fdf7f2 TL |
504 | *ngIf="userForm.showError('user_quota_max_size', frm, 'quotaMaxSize')" |
505 | i18n>The value is not valid.</span> | |
aee94f69 TL |
506 | <span *ngIf="userForm.showError('user_quota_max_size', formDir, 'pattern')" |
507 | class="invalid-feedback" | |
508 | i18n>Size must be a number or in a valid format. eg: 5 GiB</span> | |
11fdf7f2 TL |
509 | </div> |
510 | </div> | |
511 | ||
512 | <!-- Unlimited objects --> | |
9f95a23c | 513 | <div class="form-group row" |
11fdf7f2 | 514 | *ngIf="userForm.controls.user_quota_enabled.value"> |
9f95a23c TL |
515 | <div class="cd-col-form-offset"> |
516 | <div class="custom-control custom-checkbox"> | |
517 | <input class="custom-control-input" | |
518 | id="user_quota_max_objects_unlimited" | |
11fdf7f2 TL |
519 | type="checkbox" |
520 | formControlName="user_quota_max_objects_unlimited"> | |
9f95a23c TL |
521 | <label class="custom-control-label" |
522 | for="user_quota_max_objects_unlimited" | |
11fdf7f2 TL |
523 | i18n>Unlimited objects</label> |
524 | </div> | |
525 | </div> | |
526 | </div> | |
527 | ||
528 | <!-- Maximum objects --> | |
9f95a23c TL |
529 | <div class="form-group row" |
530 | *ngIf="userForm.controls.user_quota_enabled.value && !userForm.getValue('user_quota_max_objects_unlimited')"> | |
531 | <label class="cd-col-form-label required" | |
532 | for="user_quota_max_objects" | |
533 | i18n>Max. objects</label> | |
534 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
535 | <input id="user_quota_max_objects" |
536 | class="form-control" | |
537 | type="number" | |
20effc67 TL |
538 | formControlName="user_quota_max_objects" |
539 | min="0"> | |
9f95a23c | 540 | <span class="invalid-feedback" |
11fdf7f2 TL |
541 | *ngIf="userForm.showError('user_quota_max_objects', frm, 'required')" |
542 | i18n>This field is required.</span> | |
9f95a23c | 543 | <span class="invalid-feedback" |
11fdf7f2 TL |
544 | *ngIf="userForm.showError('user_quota_max_objects', frm, 'min')" |
545 | i18n>The entered value must be >= 0.</span> | |
546 | </div> | |
547 | </div> | |
548 | </fieldset> | |
549 | ||
550 | <!-- Bucket quota --> | |
551 | <fieldset> | |
552 | <legend i18n>Bucket quota</legend> | |
553 | ||
554 | <!-- Enabled --> | |
9f95a23c TL |
555 | <div class="form-group row"> |
556 | <div class="cd-col-form-offset"> | |
557 | <div class="custom-control custom-checkbox"> | |
558 | <input class="custom-control-input" | |
559 | id="bucket_quota_enabled" | |
11fdf7f2 TL |
560 | type="checkbox" |
561 | formControlName="bucket_quota_enabled"> | |
9f95a23c TL |
562 | <label class="custom-control-label" |
563 | for="bucket_quota_enabled" | |
11fdf7f2 TL |
564 | i18n>Enabled</label> |
565 | </div> | |
566 | </div> | |
567 | </div> | |
568 | ||
569 | <!-- Unlimited size --> | |
9f95a23c | 570 | <div class="form-group row" |
11fdf7f2 | 571 | *ngIf="userForm.controls.bucket_quota_enabled.value"> |
9f95a23c TL |
572 | <div class="cd-col-form-offset"> |
573 | <div class="custom-control custom-checkbox"> | |
574 | <input class="custom-control-input" | |
575 | id="bucket_quota_max_size_unlimited" | |
11fdf7f2 TL |
576 | type="checkbox" |
577 | formControlName="bucket_quota_max_size_unlimited"> | |
9f95a23c TL |
578 | <label class="custom-control-label" |
579 | for="bucket_quota_max_size_unlimited" | |
11fdf7f2 TL |
580 | i18n>Unlimited size</label> |
581 | </div> | |
582 | </div> | |
583 | </div> | |
584 | ||
585 | <!-- Maximum size --> | |
9f95a23c TL |
586 | <div class="form-group row" |
587 | *ngIf="userForm.controls.bucket_quota_enabled.value && !userForm.getValue('bucket_quota_max_size_unlimited')"> | |
588 | <label class="cd-col-form-label required" | |
589 | for="bucket_quota_max_size" | |
590 | i18n>Max. size</label> | |
591 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
592 | <input id="bucket_quota_max_size" |
593 | class="form-control" | |
594 | type="text" | |
595 | formControlName="bucket_quota_max_size" | |
596 | cdDimlessBinary> | |
9f95a23c | 597 | <span class="invalid-feedback" |
11fdf7f2 TL |
598 | *ngIf="userForm.showError('bucket_quota_max_size', frm, 'required')" |
599 | i18n>This field is required.</span> | |
9f95a23c | 600 | <span class="invalid-feedback" |
11fdf7f2 TL |
601 | *ngIf="userForm.showError('bucket_quota_max_size', frm, 'quotaMaxSize')" |
602 | i18n>The value is not valid.</span> | |
aee94f69 TL |
603 | <span *ngIf="userForm.showError('bucket_quota_max_size', formDir, 'pattern')" |
604 | class="invalid-feedback" | |
605 | i18n>Size must be a number or in a valid format. eg: 5 GiB</span> | |
11fdf7f2 TL |
606 | </div> |
607 | </div> | |
608 | ||
609 | <!-- Unlimited objects --> | |
9f95a23c | 610 | <div class="form-group row" |
11fdf7f2 | 611 | *ngIf="userForm.controls.bucket_quota_enabled.value"> |
9f95a23c TL |
612 | <div class="cd-col-form-offset"> |
613 | <div class="custom-control custom-checkbox"> | |
614 | <input class="custom-control-input" | |
615 | id="bucket_quota_max_objects_unlimited" | |
11fdf7f2 TL |
616 | type="checkbox" |
617 | formControlName="bucket_quota_max_objects_unlimited"> | |
9f95a23c TL |
618 | <label class="custom-control-label" |
619 | for="bucket_quota_max_objects_unlimited" | |
11fdf7f2 TL |
620 | i18n>Unlimited objects</label> |
621 | </div> | |
622 | </div> | |
623 | </div> | |
624 | ||
625 | <!-- Maximum objects --> | |
9f95a23c TL |
626 | <div class="form-group row" |
627 | *ngIf="userForm.controls.bucket_quota_enabled.value && !userForm.getValue('bucket_quota_max_objects_unlimited')"> | |
628 | <label class="cd-col-form-label required" | |
629 | for="bucket_quota_max_objects" | |
630 | i18n>Max. objects</label> | |
631 | <div class="cd-col-form-input"> | |
11fdf7f2 TL |
632 | <input id="bucket_quota_max_objects" |
633 | class="form-control" | |
634 | type="number" | |
20effc67 TL |
635 | formControlName="bucket_quota_max_objects" |
636 | min="0"> | |
9f95a23c | 637 | <span class="invalid-feedback" |
11fdf7f2 TL |
638 | *ngIf="userForm.showError('bucket_quota_max_objects', frm, 'required')" |
639 | i18n>This field is required.</span> | |
9f95a23c | 640 | <span class="invalid-feedback" |
11fdf7f2 TL |
641 | *ngIf="userForm.showError('bucket_quota_max_objects', frm, 'min')" |
642 | i18n>The entered value must be >= 0.</span> | |
643 | </div> | |
644 | </div> | |
645 | </fieldset> | |
646 | </div> | |
647 | ||
9f95a23c | 648 | <div class="card-footer"> |
f67539c2 TL |
649 | <cd-form-button-panel (submitActionEvent)="onSubmit()" |
650 | [form]="userForm" | |
651 | [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)" | |
652 | wrappingClass="text-right"></cd-form-button-panel> | |
11fdf7f2 TL |
653 | </div> |
654 | </div> | |
655 | </form> | |
656 | </div> |