]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html
import ceph quincy 17.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / rgw / rgw-bucket-form / rgw-bucket-form.component.html
CommitLineData
9f95a23c 1<div class="cd-col-form"
f67539c2 2 *cdFormLoading="loading">
11fdf7f2 3 <form name="bucketForm"
11fdf7f2
TL
4 #frm="ngForm"
5 [formGroup]="bucketForm"
6 novalidate>
9f95a23c 7 <div class="card">
a4b75251 8 <div i18n="form title"
9f95a23c 9 class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
11fdf7f2 10
9f95a23c 11 <div class="card-body">
11fdf7f2 12 <!-- Id -->
9f95a23c 13 <div class="form-group row"
11fdf7f2
TL
14 *ngIf="editing">
15 <label i18n
9f95a23c 16 class="cd-col-form-label"
11fdf7f2 17 for="id">Id</label>
9f95a23c 18 <div class="cd-col-form-input">
11fdf7f2
TL
19 <input id="id"
20 name="id"
21 class="form-control"
22 type="text"
23 formControlName="id"
24 readonly>
25 </div>
26 </div>
27
28 <!-- Name -->
9f95a23c
TL
29 <div class="form-group row">
30 <label class="cd-col-form-label"
31 [ngClass]="{required: !editing}"
32 for="bid"
33 i18n>Name</label>
34 <div class="cd-col-form-input">
11fdf7f2
TL
35 <input id="bid"
36 name="bid"
37 class="form-control"
38 type="text"
39 i18n-placeholder
40 placeholder="Name..."
41 formControlName="bid"
42 [readonly]="editing"
9f95a23c
TL
43 [autofocus]="!editing">
44 <span class="invalid-feedback"
11fdf7f2
TL
45 *ngIf="bucketForm.showError('bid', frm, 'required')"
46 i18n>This field is required.</span>
9f95a23c 47 <span class="invalid-feedback"
11fdf7f2 48 *ngIf="bucketForm.showError('bid', frm, 'bucketNameInvalid')"
a4b75251 49 i18n>Bucket names can only contain lowercase letters, numbers, periods and hyphens.</span>
9f95a23c 50 <span class="invalid-feedback"
a4b75251 51 *ngIf="bucketForm.showError('bid', frm, 'bucketNameNotAllowed')"
11fdf7f2 52 i18n>The chosen name is already in use.</span>
b3b6e05e
TL
53 <span class="invalid-feedback"
54 *ngIf="bucketForm.showError('bid', frm, 'containsUpperCase')"
55 i18n>Bucket names must not contain uppercase characters or underscores.</span>
56 <span class="invalid-feedback"
57 *ngIf="bucketForm.showError('bid', frm, 'lowerCaseOrNumber')"
58 i18n>Each label must start and end with a lowercase letter or a number.</span>
59 <span class="invalid-feedback"
60 *ngIf="bucketForm.showError('bid', frm, 'ipAddress')"
61 i18n>Bucket names cannot be formatted as IP address.</span>
62 <span class="invalid-feedback"
63 *ngIf="bucketForm.showError('bid', frm, 'onlyLowerCaseAndNumbers')"
a4b75251 64 i18n>Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens.</span>
b3b6e05e
TL
65 <span class="invalid-feedback"
66 *ngIf="bucketForm.showError('bid', frm, 'shouldBeInRange')"
67 i18n>Bucket names must be 3 to 63 characters long.</span>
11fdf7f2
TL
68 </div>
69 </div>
70
71 <!-- Owner -->
9f95a23c
TL
72 <div class="form-group row">
73 <label class="cd-col-form-label required"
74 for="owner"
75 i18n>Owner</label>
76 <div class="cd-col-form-input">
11fdf7f2
TL
77 <select id="owner"
78 name="owner"
39ae355f 79 class="form-select"
9f95a23c
TL
80 formControlName="owner"
81 [autofocus]="editing">
11fdf7f2
TL
82 <option i18n
83 *ngIf="owners === null"
84 [ngValue]="null">Loading...</option>
85 <option i18n
86 *ngIf="owners !== null"
87 [ngValue]="null">-- Select a user --</option>
88 <option *ngFor="let owner of owners"
89 [value]="owner">{{ owner }}</option>
90 </select>
9f95a23c 91 <span class="invalid-feedback"
11fdf7f2
TL
92 *ngIf="bucketForm.showError('owner', frm, 'required')"
93 i18n>This field is required.</span>
94 </div>
95 </div>
96
9f95a23c
TL
97 <!-- Placement target -->
98 <div class="form-group row">
99 <label class="cd-col-form-label"
100 [ngClass]="{required: !editing}"
101 for="placement-target"
102 i18n>Placement target</label>
103 <div class="cd-col-form-input">
104 <ng-template #placementTargetSelect>
105 <select id="placement-target"
106 name="placement-target"
107 formControlName="placement-target"
39ae355f 108 class="form-select">
9f95a23c
TL
109 <option i18n
110 *ngIf="placementTargets === null"
111 [ngValue]="null">Loading...</option>
112 <option i18n
113 *ngIf="placementTargets !== null"
114 [ngValue]="null">-- Select a placement target --</option>
115 <option *ngFor="let placementTarget of placementTargets"
116 [value]="placementTarget.name">{{ placementTarget.description }}</option>
117 </select>
118 <span class="invalid-feedback"
119 *ngIf="bucketForm.showError('placement-target', frm, 'required')"
120 i18n>This field is required.</span>
121 </ng-template>
122 <ng-container *ngIf="editing; else placementTargetSelect">
123 <input id="placement-target"
124 name="placement-target"
125 formControlName="placement-target"
126 class="form-control"
127 type="text"
128 readonly>
129 </ng-container>
130 </div>
131 </div>
132
133 <!-- Versioning -->
134 <fieldset *ngIf="editing">
135 <legend class="cd-header"
136 i18n>Versioning</legend>
137
138 <div class="form-group row">
139 <div class="cd-col-form-offset">
140 <div class="custom-control custom-checkbox">
141 <input type="checkbox"
142 class="custom-control-input"
143 id="versioning"
144 name="versioning"
145 formControlName="versioning"
f67539c2 146 (change)="setMfaDeleteValidators()">
9f95a23c
TL
147 <label class="custom-control-label"
148 for="versioning"
149 i18n>Enabled</label>
150 <cd-helper>
151 <span i18n>Enables versioning for the objects in the bucket.</span>
152 </cd-helper>
153 </div>
154 </div>
155 </div>
156 </fieldset>
157
158 <!-- Multi-Factor Authentication -->
159 <fieldset *ngIf="editing">
160 <!-- MFA Delete -->
161 <legend class="cd-header"
162 i18n>Multi-Factor Authentication</legend>
163
164 <div class="form-group row">
165 <div class="cd-col-form-offset">
166 <div class="custom-control custom-checkbox">
167 <input type="checkbox"
168 class="custom-control-input"
169 id="mfa-delete"
170 name="mfa-delete"
171 formControlName="mfa-delete"
f67539c2 172 (change)="setMfaDeleteValidators()">
9f95a23c
TL
173 <label class="custom-control-label"
174 for="mfa-delete"
175 i18n>Delete enabled</label>
176 <cd-helper>
177 <span i18n>Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state.</span>
178 </cd-helper>
179 </div>
180 </div>
181 </div>
182 <div *ngIf="areMfaCredentialsRequired()"
183 class="form-group row">
184 <label i18n
185 class="cd-col-form-label"
186 for="mfa-token-serial">Token Serial Number</label>
187 <div class="cd-col-form-input">
188 <input type="text"
189 id="mfa-token-serial"
190 name="mfa-token-serial"
191 formControlName="mfa-token-serial"
192 class="form-control">
193 <span class="invalid-feedback"
194 *ngIf="bucketForm.showError('mfa-token-serial', frm, 'required')"
195 i18n>This field is required.</span>
196 </div>
197 </div>
198 <div *ngIf="areMfaCredentialsRequired()"
199 class="form-group row">
200 <label i18n
201 class="cd-col-form-label"
202 for="mfa-token-pin">Token PIN</label>
203 <div class="cd-col-form-input">
204 <input type="text"
205 id="mfa-token-pin"
206 name="mfa-token-pin"
207 formControlName="mfa-token-pin"
208 class="form-control">
209 <span class="invalid-feedback"
210 *ngIf="bucketForm.showError('mfa-token-pin', frm, 'required')"
211 i18n>This field is required.</span>
212 </div>
213 </div>
214 </fieldset>
215
216 <!-- Locking -->
217 <fieldset>
218 <legend class="cd-header"
219 i18n>Locking</legend>
220
221 <!-- Locking enabled -->
222 <div class="form-group row">
223 <div class="cd-col-form-offset">
224 <div class="custom-control custom-checkbox">
225 <input class="custom-control-input"
226 id="lock_enabled"
227 formControlName="lock_enabled"
228 type="checkbox">
229 <label class="custom-control-label"
230 for="lock_enabled"
231 i18n>Enabled</label>
232 <cd-helper>
233 <span i18n>Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket.</span>
234 </cd-helper>
235 </div>
236 </div>
237 </div>
238
239 <!-- Locking mode -->
240 <div *ngIf="bucketForm.getValue('lock_enabled')"
241 class="form-group row">
242 <label class="cd-col-form-label"
243 for="lock_mode"
244 i18n>Mode</label>
245 <div class="cd-col-form-input">
39ae355f 246 <select class="form-select"
9f95a23c
TL
247 formControlName="lock_mode"
248 name="lock_mode"
249 id="lock_mode">
250 <option i18n
251 value="COMPLIANCE">Compliance</option>
252 <option i18n
253 value="GOVERNANCE">Governance</option>
254 </select>
255 </div>
256 </div>
257
258 <!-- Retention period (days) -->
259 <div *ngIf="bucketForm.getValue('lock_enabled')"
260 class="form-group row">
261 <label class="cd-col-form-label"
262 for="lock_retention_period_days">
263 <ng-container i18n>Days</ng-container>
264 <cd-helper i18n>The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.</cd-helper>
265 </label>
266 <div class="cd-col-form-input">
267 <input class="form-control"
268 type="number"
269 id="lock_retention_period_days"
270 formControlName="lock_retention_period_days"
271 min="0">
272 <span class="invalid-feedback"
273 *ngIf="bucketForm.showError('lock_retention_period_days', frm, 'pattern')"
274 i18n>The entered value must be a positive integer.</span>
275 <span class="invalid-feedback"
b3b6e05e
TL
276 *ngIf="bucketForm.showError('lock_retention_period_days', frm, 'lockDays')"
277 i18n>Retention Days must be a positive integer.</span>
9f95a23c
TL
278 </div>
279 </div>
280 </fieldset>
281
39ae355f
TL
282 <fieldset>
283 <legend class="cd-header"
284 i18n>Security</legend>
285 <div class="form-group row">
286 <div class="cd-col-form-offset">
287 <div class="custom-control custom-checkbox">
288 <input class="form-check-input"
289 id="encryption_enabled"
290 name="encryption_enabled"
291 formControlName="encryption_enabled"
292 type="checkbox"
293 [attr.disabled]="!kmsVaultConfig && !s3VaultConfig ? true : null">
294 <label class="form-check-label"
295 for="encryption_enabled"
296 i18n>Encryption</label>
297 <cd-helper>
298 <span i18n>Enables encryption for the objects in the bucket.
299 To enable encryption on a bucket you need to set the configuration values for SSE-S3 or SSE-KMS.
300 To set the configuration values <a href="#/rgw/bucket/create"
301 (click)="openConfigModal()">Click here</a></span>
302 </cd-helper>
303 </div>
304 </div>
305 </div>
306
307 <div *ngIf="bucketForm.getValue('encryption_enabled')">
308 <div class="form-group row">
309 <div class="cd-col-form-offset">
310 <div class="custom-control custom-radio custom-control-inline ps-5">
311 <input class="form-check-input"
312 formControlName="encryption_type"
313 id="sse_S3_enabled"
314 type="radio"
315 name="encryption_type"
316 value="AES256"
317 [attr.disabled]="!s3VaultConfig ? true : null">
318 <label class="form-control-label"
319 for="sse_S3_enabled"
320 i18n>SSE-S3 Encryption</label>
321 </div>
322 </div>
323 </div>
324
325 <div class="form-group row">
326 <div class="cd-col-form-offset">
327 <div class="custom-control custom-radio custom-control-inline ps-5">
328 <input class="form-check-input"
329 formControlName="encryption_type"
330 id="kms_enabled"
331 name="encryption_type"
332 value="aws:kms"
333 [attr.disabled]="!kmsVaultConfig ? true : null"
334 type="radio">
335 <label class="form-control-label"
336 for="kms_enabled"
337 i18n>Connect to an external key management service</label>
338 </div>
339 </div>
340 </div>
341
342 <div *ngIf="bucketForm.getValue('encryption_type') === 'aws:kms'">
343 <div class="form-group row">
344 <label class="cd-col-form-label required"
345 for="kms_provider"
346 i18n>KMS Provider</label>
347 <div class="cd-col-form-input">
348 <select id="kms_provider"
349 name="kms_provider"
350 class="form-select"
351 formControlName="kms_provider"
352 [autofocus]="editing">
353 <option i18n
354 *ngIf="kmsProviders !== null"
355 [ngValue]="null">-- Select a provider --</option>
356 <option *ngFor="let provider of kmsProviders"
357 [value]="provider">{{ provider }}</option>
358 </select>
359 <span class="invalid-feedback"
360 *ngIf="bucketForm.showError('kms_provider', frm, 'required')"
361 i18n>This field is required.</span>
362 </div>
363 </div>
364 </div>
365
366 <div *ngIf="bucketForm.getValue('encryption_type') === 'aws:kms'">
367 <div class="form-group row">
368 <label class="cd-col-form-label required"
369 for="keyId"
370 i18n>Key Id
371 </label>
372 <div class="cd-col-form-input">
373 <input id="keyId"
374 name="keyId"
375 class="form-control"
376 type="text"
377 formControlName="keyId">
378 <span class="invalid-feedback"
379 *ngIf="bucketForm.showError('keyId', frm, 'required')"
380 i18n>This field is required.</span>
381 </div>
382 </div>
383 </div>
384 </div>
385 </fieldset>
386
11fdf7f2 387 </div>
9f95a23c 388 <div class="card-footer">
f67539c2
TL
389 <cd-form-button-panel (submitActionEvent)="submit()"
390 [form]="bucketForm"
391 [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
392 wrappingClass="text-right"></cd-form-button-panel>
11fdf7f2
TL
393 </div>
394 </div>
395 </form>
396</div>