]>
Commit | Line | Data |
---|---|---|
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 | 22 | <div class="cd-col-form-input"> |
33c7a0ef | 23 | <select class="form-control" |
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"> | |
33c7a0ef | 55 | <select class="form-control" |
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 | 88 | <div class="cd-col-form-input"> |
33c7a0ef | 89 | <select class="form-control" |
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: >, <, |, &, ( 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"> | |
33c7a0ef | 270 | <select class="form-control" |
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> | |
11fdf7f2 TL |
281 | <option *ngFor="let accessType of nfsAccessType" |
282 | [value]="accessType.value">{{ accessType.value }}</option> | |
283 | </select> | |
9f95a23c | 284 | <span class="form-text text-muted" |
11fdf7f2 TL |
285 | *ngIf="nfsForm.getValue('access_type')"> |
286 | {{ getAccessTypeHelp(nfsForm.getValue('access_type')) }} | |
287 | </span> | |
9f95a23c | 288 | <span class="form-text text-warning" |
eafe8130 TL |
289 | *ngIf="nfsForm.getValue('access_type') === 'RW' && nfsForm.getValue('name') === 'RGW'" |
290 | i18n>The Object Gateway NFS backend has a number of | |
291 | limitations which will seriously affect applications writing to | |
f6b5b4d7 TL |
292 | the share. Please consult the <cd-doc section="rgw-nfs"></cd-doc> |
293 | for details before enabling write access.</span> | |
9f95a23c | 294 | <span class="invalid-feedback" |
11fdf7f2 | 295 | *ngIf="nfsForm.showError('access_type', formDir, 'required')" |
f6b5b4d7 | 296 | i18n>This field is required.</span> |
11fdf7f2 TL |
297 | </div> |
298 | </div> | |
299 | ||
300 | <!-- Squash --> | |
9f95a23c | 301 | <div class="form-group row"> |
a4b75251 TL |
302 | <label class="cd-col-form-label" |
303 | for="squash"> | |
2a845540 | 304 | <span i18n>Squash</span> |
a4b75251 TL |
305 | <ng-container *ngTemplateOutlet="squashHelper"></ng-container> |
306 | </label> | |
9f95a23c | 307 | <div class="cd-col-form-input"> |
33c7a0ef | 308 | <select class="form-control" |
11fdf7f2 TL |
309 | name="squash" |
310 | formControlName="squash" | |
311 | id="squash"> | |
312 | <option *ngIf="nfsSquash === null" | |
313 | value="" | |
314 | i18n>Loading...</option> | |
315 | <option *ngIf="nfsSquash !== null && nfsSquash.length === 0" | |
316 | value="" | |
317 | i18n>-- No squash available --</option> | |
11fdf7f2 TL |
318 | <option *ngFor="let squash of nfsSquash" |
319 | [value]="squash">{{ squash }}</option> | |
320 | ||
321 | </select> | |
9f95a23c | 322 | <span class="invalid-feedback" |
11fdf7f2 | 323 | *ngIf="nfsForm.showError('squash', formDir,'required')" |
f6b5b4d7 | 324 | i18n>This field is required.</span> |
11fdf7f2 TL |
325 | </div> |
326 | </div> | |
327 | ||
328 | <!-- Transport Protocol --> | |
9f95a23c TL |
329 | <div class="form-group row"> |
330 | <label class="cd-col-form-label required" | |
331 | for="transports" | |
332 | i18n>Transport Protocol</label> | |
333 | <div class="cd-col-form-input"> | |
334 | <div class="custom-control custom-checkbox"> | |
11fdf7f2 | 335 | <input type="checkbox" |
9f95a23c | 336 | class="custom-control-input" |
11fdf7f2 TL |
337 | formControlName="transportUDP" |
338 | name="transportUDP" | |
339 | id="transportUDP"> | |
340 | <label for="transportUDP" | |
9f95a23c | 341 | class="custom-control-label" |
11fdf7f2 TL |
342 | i18n>UDP</label> |
343 | </div> | |
9f95a23c | 344 | <div class="custom-control custom-checkbox"> |
11fdf7f2 | 345 | <input type="checkbox" |
9f95a23c | 346 | class="custom-control-input" |
11fdf7f2 TL |
347 | formControlName="transportTCP" |
348 | name="transportTCP" | |
349 | id="transportTCP"> | |
350 | <label for="transportTCP" | |
9f95a23c | 351 | class="custom-control-label" |
11fdf7f2 TL |
352 | i18n>TCP</label> |
353 | </div> | |
9f95a23c | 354 | <span class="invalid-feedback" |
11fdf7f2 TL |
355 | *ngIf="nfsForm.showError('transportUDP', formDir, 'required') || |
356 | nfsForm.showError('transportTCP', formDir, 'required')" | |
f6b5b4d7 | 357 | i18n>This field is required.</span> |
11fdf7f2 TL |
358 | <hr> |
359 | </div> | |
360 | </div> | |
361 | ||
362 | <!-- Clients --> | |
363 | <cd-nfs-form-client [form]="nfsForm" | |
f67539c2 | 364 | [clients]="clients" |
11fdf7f2 | 365 | #nfsClients> |
a4b75251 TL |
366 | <ng-template #squashHelper> |
367 | <cd-helper> | |
368 | <ul class="squash-helper"> | |
369 | <li> | |
370 | <span class="squash-helper-item-value">no_root_squash: </span> | |
371 | <span i18n>No user id squashing is performed.</span> | |
372 | </li> | |
373 | <li> | |
374 | <span class="squash-helper-item-value">root_id_squash: </span> | |
375 | <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> | |
376 | </li> | |
377 | <li> | |
378 | <span class="squash-helper-item-value">root_squash: </span> | |
379 | <span i18n>uid 0 and gid of any value are squashed to the Anonymous_Uid and Anonymous_Gid alt_groups lists is discarded.</span> | |
380 | </li> | |
381 | <li> | |
382 | <span class="squash-helper-item-value">all_squash: </span> | |
383 | <span i18n>All users are squashed.</span> | |
384 | </li> | |
385 | </ul> | |
386 | </cd-helper> | |
387 | </ng-template> | |
11fdf7f2 TL |
388 | </cd-nfs-form-client> |
389 | ||
390 | </div> | |
391 | ||
9f95a23c | 392 | <div class="card-footer"> |
f67539c2 TL |
393 | <cd-form-button-panel (submitActionEvent)="submitAction()" |
394 | [form]="nfsForm" | |
395 | [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)" | |
396 | wrappingClass="text-right"></cd-form-button-panel> | |
11fdf7f2 TL |
397 | </div> |
398 | </div> | |
399 | </form> | |
400 | </div> |