]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
bump version to 17.2.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / nfs / nfs-form / nfs-form.component.html
CommitLineData
f67539c2
TL
1<div class="cd-col-form"
2 *cdFormLoading="loading">
11fdf7f2 3 <form name="nfsForm"
11fdf7f2
TL
4 #formDir="ngForm"
5 [formGroup]="nfsForm"
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 <!-- cluster_id -->
a4b75251
TL
13 <div class="form-group row">
14 <label class="cd-col-form-label"
15 for="cluster_id">
16 <span class="required"
17 i18n>Cluster</span>
18 <cd-helper>
19 <p i18n>This is the ID of an NFS Service.</p>
20 </cd-helper>
21 </label>
9f95a23c
TL
22 <div class="cd-col-form-input">
23 <select class="form-control custom-select"
11fdf7f2
TL
24 formControlName="cluster_id"
25 name="cluster_id"
a4b75251 26 id="cluster_id">
11fdf7f2
TL
27 <option *ngIf="allClusters === null"
28 value=""
29 i18n>Loading...</option>
30 <option *ngIf="allClusters !== null && allClusters.length === 0"
31 value=""
32 i18n>-- No cluster available --</option>
33 <option *ngIf="allClusters !== null && allClusters.length > 0"
34 value=""
35 i18n>-- Select the cluster --</option>
36 <option *ngFor="let cluster of allClusters"
adb31ebb 37 [value]="cluster.cluster_id">{{ cluster.cluster_id }}</option>
11fdf7f2 38 </select>
9f95a23c 39 <span class="invalid-feedback"
a4b75251
TL
40 *ngIf="nfsForm.showError('cluster_id', formDir, 'required') || allClusters?.length === 0"
41 i18n>This field is required.
42 To create a new NFS cluster, <a [routerLink]="['/services', {outlets: {modal: ['create']}}]"
43 class="btn-link">add a new NFS Service</a>.</span>
11fdf7f2
TL
44 </div>
45 </div>
46
47 <!-- FSAL -->
48 <div formGroupName="fsal">
49 <!-- Name -->
9f95a23c
TL
50 <div class="form-group row">
51 <label class="cd-col-form-label required"
52 for="name"
53 i18n>Storage Backend</label>
54 <div class="cd-col-form-input">
55 <select class="form-control custom-select"
11fdf7f2
TL
56 formControlName="name"
57 name="name"
58 id="name"
59 (change)="fsalChangeHandler()">
60 <option *ngIf="allFsals === null"
61 value=""
62 i18n>Loading...</option>
63 <option *ngIf="allFsals !== null && allFsals.length === 0"
64 value=""
65 i18n>-- No data pools available --</option>
66 <option *ngIf="allFsals !== null && allFsals.length > 0"
67 value=""
68 i18n>-- Select the storage backend --</option>
69 <option *ngFor="let fsal of allFsals"
a4b75251
TL
70 [value]="fsal.value"
71 [disabled]="fsal.disabled">{{ fsal.descr }}</option>
11fdf7f2 72 </select>
9f95a23c 73 <span class="invalid-feedback"
11fdf7f2 74 *ngIf="nfsForm.showError('name', formDir, 'required')"
f6b5b4d7 75 i18n>This field is required.</span>
9f95a23c 76 <span class="invalid-feedback"
a4b75251
TL
77 *ngIf="fsalAvailabilityError"
78 i18n>{{ fsalAvailabilityError }}</span>
11fdf7f2
TL
79 </div>
80 </div>
81
a4b75251 82 <!-- CephFS Volume -->
9f95a23c 83 <div class="form-group row"
11fdf7f2 84 *ngIf="nfsForm.getValue('name') === 'CEPH'">
9f95a23c
TL
85 <label class="cd-col-form-label required"
86 for="fs_name"
a4b75251 87 i18n>Volume</label>
9f95a23c
TL
88 <div class="cd-col-form-input">
89 <select class="form-control custom-select"
11fdf7f2
TL
90 formControlName="fs_name"
91 name="fs_name"
92 id="fs_name"
a4b75251 93 (change)="pathChangeHandler()">
11fdf7f2
TL
94 <option *ngIf="allFsNames === null"
95 value=""
96 i18n>Loading...</option>
97 <option *ngIf="allFsNames !== null && allFsNames.length === 0"
98 value=""
99 i18n>-- No CephFS filesystem available --</option>
100 <option *ngIf="allFsNames !== null && allFsNames.length > 0"
101 value=""
102 i18n>-- Select the CephFS filesystem --</option>
103 <option *ngFor="let filesystem of allFsNames"
104 [value]="filesystem.name">{{ filesystem.name }}</option>
105 </select>
9f95a23c 106 <span class="invalid-feedback"
11fdf7f2 107 *ngIf="nfsForm.showError('fs_name', formDir, 'required')"
f6b5b4d7 108 i18n>This field is required.</span>
11fdf7f2
TL
109 </div>
110 </div>
111 </div>
112
f67539c2 113 <!-- Security Label -->
9f95a23c 114 <div class="form-group row"
11fdf7f2 115 *ngIf="nfsForm.getValue('name') === 'CEPH'">
9f95a23c
TL
116 <label class="cd-col-form-label"
117 [ngClass]="{'required': nfsForm.getValue('security_label')}"
118 for="security_label"
119 i18n>Security Label</label>
11fdf7f2 120
9f95a23c
TL
121 <div class="cd-col-form-input">
122 <div class="custom-control custom-checkbox">
11fdf7f2 123 <input type="checkbox"
9f95a23c 124 class="custom-control-input"
11fdf7f2
TL
125 formControlName="security_label"
126 name="security_label"
127 id="security_label">
128 <label for="security_label"
9f95a23c 129 class="custom-control-label"
11fdf7f2
TL
130 i18n>Enable security label</label>
131 </div>
132
133 <br>
134
135 <input type="text"
136 *ngIf="nfsForm.getValue('security_label')"
137 class="form-control"
138 name="sec_label_xattr"
139 id="sec_label_xattr"
140 formControlName="sec_label_xattr">
141
9f95a23c 142 <span class="invalid-feedback"
11fdf7f2 143 *ngIf="nfsForm.showError('sec_label_xattr', formDir, 'required')"
f6b5b4d7 144 i18n>This field is required.</span>
11fdf7f2
TL
145 </div>
146 </div>
147
148 <!-- Path -->
9f95a23c 149 <div class="form-group row"
11fdf7f2 150 *ngIf="nfsForm.getValue('name') === 'CEPH'">
a4b75251
TL
151 <label class="cd-col-form-label"
152 for="path">
153 <span class="required"
154 i18n>CephFS Path</span>
155 <cd-helper>
156 <p i18n>A path in a CephFS file system.</p>
157 </cd-helper>
158 </label>
9f95a23c 159 <div class="cd-col-form-input">
11fdf7f2
TL
160 <input type="text"
161 class="form-control"
162 name="path"
163 id="path"
a4b75251 164 data-testid="fs_path"
11fdf7f2 165 formControlName="path"
f67539c2
TL
166 [ngbTypeahead]="pathDataSource"
167 (selectItem)="pathChangeHandler()"
11fdf7f2 168 (blur)="pathChangeHandler()">
9f95a23c 169 <span class="invalid-feedback"
11fdf7f2 170 *ngIf="nfsForm.showError('path', formDir, 'required')"
f6b5b4d7 171 i18n>This field is required.</span>
11fdf7f2 172
9f95a23c 173 <span class="invalid-feedback"
11fdf7f2
TL
174 *ngIf="nfsForm.showError('path', formDir, 'pattern')"
175 i18n>Path need to start with a '/' and can be followed by a word</span>
a4b75251
TL
176 <span class="invalid-feedback"
177 *ngIf="nfsForm.showError('path', formDir, 'pathNameNotAllowed')"
178 i18n>The path does not exist in the selected volume.</span>
11fdf7f2
TL
179 </div>
180 </div>
181
182 <!-- Bucket -->
9f95a23c 183 <div class="form-group row"
11fdf7f2 184 *ngIf="nfsForm.getValue('name') === 'RGW'">
a4b75251
TL
185 <label class="cd-col-form-label"
186 for="path">
187 <span class="required"
188 i18n>Bucket</span>
189 </label>
9f95a23c 190 <div class="cd-col-form-input">
11fdf7f2
TL
191 <input type="text"
192 class="form-control"
193 name="path"
194 id="path"
a4b75251 195 data-testid="rgw_path"
11fdf7f2 196 formControlName="path"
a4b75251 197 [ngbTypeahead]="bucketDataSource">
11fdf7f2 198
9f95a23c 199 <span class="invalid-feedback"
11fdf7f2 200 *ngIf="nfsForm.showError('path', formDir, 'required')"
f6b5b4d7 201 i18n>This field is required.</span>
9f95a23c 202 <span class="invalid-feedback"
a4b75251
TL
203 *ngIf="nfsForm.showError('path', formDir, 'bucketNameNotAllowed')"
204 i18n>The bucket does not exist or is not in the default realm (if multiple realms are configured).
205 To continue, <a routerLink="/rgw/bucket/create"
206 class="btn-link">create a new bucket</a>.</span>
11fdf7f2
TL
207 </div>
208 </div>
209
210 <!-- NFS Protocol -->
9f95a23c
TL
211 <div class="form-group row">
212 <label class="cd-col-form-label required"
213 for="protocols"
214 i18n>NFS Protocol</label>
215 <div class="cd-col-form-input">
9f95a23c 216 <div class="custom-control custom-checkbox">
11fdf7f2 217 <input type="checkbox"
9f95a23c 218 class="custom-control-input"
11fdf7f2
TL
219 formControlName="protocolNfsv4"
220 name="protocolNfsv4"
a4b75251
TL
221 id="protocolNfsv4"
222 disabled>
11fdf7f2 223 <label i18n
9f95a23c 224 class="custom-control-label"
11fdf7f2
TL
225 for="protocolNfsv4">NFSv4</label>
226 </div>
9f95a23c 227 <span class="invalid-feedback"
a4b75251 228 *ngIf="nfsForm.showError('protocolNfsv4', formDir, 'required')"
f6b5b4d7 229 i18n>This field is required.</span>
11fdf7f2
TL
230 </div>
231 </div>
232
11fdf7f2 233 <!-- Pseudo -->
9f95a23c 234 <div class="form-group row"
11fdf7f2 235 *ngIf="nfsForm.getValue('protocolNfsv4')">
9f95a23c 236 <label class="cd-col-form-label"
11fdf7f2 237 for="pseudo">
9f95a23c
TL
238 <span class="required"
239 i18n>Pseudo</span>
11fdf7f2
TL
240 <cd-helper>
241 <p i18n>The position that this <strong>NFS v4</strong> export occupies
242 in the <strong>Pseudo FS</strong> (it must be unique).</p>
243 <p i18n>By using different Pseudo options, the same Path may be exported multiple times.</p>
244 </cd-helper>
245 </label>
9f95a23c 246 <div class="cd-col-form-input">
11fdf7f2
TL
247 <input type="text"
248 class="form-control"
249 name="pseudo"
250 id="pseudo"
251 formControlName="pseudo">
9f95a23c 252 <span class="invalid-feedback"
11fdf7f2 253 *ngIf="nfsForm.showError('pseudo', formDir, 'required')"
f6b5b4d7 254 i18n>This field is required.</span>
a4b75251
TL
255 <span class="invalid-feedback"
256 *ngIf="nfsForm.showError('pseudo', formDir, 'pseudoAlreadyExists')"
257 i18n>The pseudo is already in use by another export.</span>
9f95a23c 258 <span class="invalid-feedback"
11fdf7f2 259 *ngIf="nfsForm.showError('pseudo', formDir, 'pattern')"
9f95a23c 260 i18n>Pseudo needs to start with a '/' and can't contain any of the following: &gt;, &lt;, |, &, ( or ).</span>
11fdf7f2
TL
261 </div>
262 </div>
263
264 <!-- Access Type -->
9f95a23c
TL
265 <div class="form-group row">
266 <label class="cd-col-form-label required"
267 for="access_type"
268 i18n>Access Type</label>
269 <div class="cd-col-form-input">
270 <select class="form-control custom-select"
11fdf7f2
TL
271 formControlName="access_type"
272 name="access_type"
eafe8130
TL
273 id="access_type"
274 (change)="accessTypeChangeHandler()">
11fdf7f2
TL
275 <option *ngIf="nfsAccessType === null"
276 value=""
277 i18n>Loading...</option>
278 <option *ngIf="nfsAccessType !== null && nfsAccessType.length === 0"
279 value=""
280 i18n>-- No access type available --</option>
281 <option *ngIf="nfsAccessType !== null && nfsAccessType.length > 0"
282 value=""
283 i18n>-- Select the access type --</option>
284 <option *ngFor="let accessType of nfsAccessType"
285 [value]="accessType.value">{{ accessType.value }}</option>
286 </select>
9f95a23c 287 <span class="form-text text-muted"
11fdf7f2
TL
288 *ngIf="nfsForm.getValue('access_type')">
289 {{ getAccessTypeHelp(nfsForm.getValue('access_type')) }}
290 </span>
9f95a23c 291 <span class="form-text text-warning"
eafe8130
TL
292 *ngIf="nfsForm.getValue('access_type') === 'RW' && nfsForm.getValue('name') === 'RGW'"
293 i18n>The Object Gateway NFS backend has a number of
294 limitations which will seriously affect applications writing to
f6b5b4d7
TL
295 the share. Please consult the <cd-doc section="rgw-nfs"></cd-doc>
296 for details before enabling write access.</span>
9f95a23c 297 <span class="invalid-feedback"
11fdf7f2 298 *ngIf="nfsForm.showError('access_type', formDir, 'required')"
f6b5b4d7 299 i18n>This field is required.</span>
11fdf7f2
TL
300 </div>
301 </div>
302
303 <!-- Squash -->
9f95a23c 304 <div class="form-group row">
a4b75251
TL
305 <label class="cd-col-form-label"
306 for="squash">
307 <span class="required"
308 i18n>Squash</span>
309 <ng-container *ngTemplateOutlet="squashHelper"></ng-container>
310 </label>
9f95a23c
TL
311 <div class="cd-col-form-input">
312 <select class="form-control custom-select"
11fdf7f2
TL
313 name="squash"
314 formControlName="squash"
315 id="squash">
316 <option *ngIf="nfsSquash === null"
317 value=""
318 i18n>Loading...</option>
319 <option *ngIf="nfsSquash !== null && nfsSquash.length === 0"
320 value=""
321 i18n>-- No squash available --</option>
322 <option *ngIf="nfsSquash !== null && nfsSquash.length > 0"
323 value=""
324 i18n>--Select what kind of user id squashing is performed --</option>
325 <option *ngFor="let squash of nfsSquash"
326 [value]="squash">{{ squash }}</option>
327
328 </select>
9f95a23c 329 <span class="invalid-feedback"
11fdf7f2 330 *ngIf="nfsForm.showError('squash', formDir,'required')"
f6b5b4d7 331 i18n>This field is required.</span>
11fdf7f2
TL
332 </div>
333 </div>
334
335 <!-- Transport Protocol -->
9f95a23c
TL
336 <div class="form-group row">
337 <label class="cd-col-form-label required"
338 for="transports"
339 i18n>Transport Protocol</label>
340 <div class="cd-col-form-input">
341 <div class="custom-control custom-checkbox">
11fdf7f2 342 <input type="checkbox"
9f95a23c 343 class="custom-control-input"
11fdf7f2
TL
344 formControlName="transportUDP"
345 name="transportUDP"
346 id="transportUDP">
347 <label for="transportUDP"
9f95a23c 348 class="custom-control-label"
11fdf7f2
TL
349 i18n>UDP</label>
350 </div>
9f95a23c 351 <div class="custom-control custom-checkbox">
11fdf7f2 352 <input type="checkbox"
9f95a23c 353 class="custom-control-input"
11fdf7f2
TL
354 formControlName="transportTCP"
355 name="transportTCP"
356 id="transportTCP">
357 <label for="transportTCP"
9f95a23c 358 class="custom-control-label"
11fdf7f2
TL
359 i18n>TCP</label>
360 </div>
9f95a23c 361 <span class="invalid-feedback"
11fdf7f2
TL
362 *ngIf="nfsForm.showError('transportUDP', formDir, 'required') ||
363 nfsForm.showError('transportTCP', formDir, 'required')"
f6b5b4d7 364 i18n>This field is required.</span>
11fdf7f2
TL
365 <hr>
366 </div>
367 </div>
368
369 <!-- Clients -->
370 <cd-nfs-form-client [form]="nfsForm"
f67539c2 371 [clients]="clients"
11fdf7f2 372 #nfsClients>
a4b75251
TL
373 <ng-template #squashHelper>
374 <cd-helper>
375 <ul class="squash-helper">
376 <li>
377 <span class="squash-helper-item-value">no_root_squash: </span>
378 <span i18n>No user id squashing is performed.</span>
379 </li>
380 <li>
381 <span class="squash-helper-item-value">root_id_squash: </span>
382 <span i18n>uid 0 and gid 0 are squashed to the Anonymous_Uid and Anonymous_Gid gid 0 in alt_groups lists is also squashed.</span>
383 </li>
384 <li>
385 <span class="squash-helper-item-value">root_squash: </span>
386 <span i18n>uid 0 and gid of any value are squashed to the Anonymous_Uid and Anonymous_Gid alt_groups lists is discarded.</span>
387 </li>
388 <li>
389 <span class="squash-helper-item-value">all_squash: </span>
390 <span i18n>All users are squashed.</span>
391 </li>
392 </ul>
393 </cd-helper>
394 </ng-template>
11fdf7f2
TL
395 </cd-nfs-form-client>
396
397 </div>
398
9f95a23c 399 <div class="card-footer">
f67539c2
TL
400 <cd-form-button-panel (submitActionEvent)="submitAction()"
401 [form]="nfsForm"
402 [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
403 wrappingClass="text-right"></cd-form-button-panel>
11fdf7f2
TL
404 </div>
405 </div>
406 </form>
407</div>