1 <div class=
"cd-col-form">
3 [formGroup]=
"serviceForm"
6 <div i18n=
"form title|Example: Create Pool@@formTitle"
7 class=
"card-header">{{ action | titlecase }} {{ resource | upperFirst }}
</div>
9 <div class=
"card-body">
11 <div class=
"form-group row">
12 <label class=
"cd-col-form-label required"
15 <div class=
"cd-col-form-input">
16 <select id=
"service_type"
18 class=
"form-control custom-select"
19 formControlName=
"service_type">
21 [ngValue]=
"null">-- Select a service type --
</option>
22 <option *
ngFor=
"let serviceType of serviceTypes"
23 [value]=
"serviceType">
27 <span class=
"invalid-feedback"
28 *
ngIf=
"serviceForm.showError('service_type', frm, 'required')"
29 i18n
>This field is required.
</span>
33 <!-- backend_service -->
34 <div *
ngIf=
"serviceForm.controls.service_type.value === 'ingress'"
35 class=
"form-group row">
37 class=
"cd-col-form-label"
38 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
39 for=
"backend_service">Backend Service
</label>
40 <div class=
"cd-col-form-input">
41 <select id=
"backend_service"
42 name=
"backend_service"
43 class=
"form-control custom-select"
44 formControlName=
"backend_service"
45 (change)=
"prePopulateId()">
46 <option *
ngIf=
"services === null"
48 i18n
>Loading...
</option>
49 <option *
ngIf=
"services !== null && services.length === 0"
51 i18n
>-- No service available --
</option>
52 <option *
ngIf=
"services !== null && services.length > 0"
54 i18n
>-- Select an existing RGW service --
</option>
55 <option *
ngFor=
"let service of services"
56 [value]=
"service.service_name">{{ service.service_name }}
</option>
58 <span class=
"invalid-feedback"
59 *
ngIf=
"serviceForm.showError('backend_service', frm, 'required')"
60 i18n
>This field is required.
</span>
65 <div class=
"form-group row">
67 class=
"cd-col-form-label"
68 [ngClass]=
"{'required': ['mds', 'rgw', 'nfs', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)}"
69 for=
"service_id">Id
</label>
70 <div class=
"cd-col-form-input">
71 <input id=
"service_id"
74 formControlName=
"service_id">
75 <span class=
"invalid-feedback"
76 *
ngIf=
"serviceForm.showError('service_id', frm, 'required')"
77 i18n
>This field is required.
</span>
78 <span class=
"invalid-feedback"
79 *
ngIf=
"serviceForm.showError('service_id', frm, 'rgwPattern')"
80 i18n
>The value does not match the pattern
<strong><service_id
>[.
<realm_name
>.
<zone_name
>]
</strong>.
</span>
85 <div class=
"form-group row">
86 <div class=
"cd-col-form-offset">
87 <div class=
"custom-control custom-checkbox">
88 <input class=
"custom-control-input"
91 formControlName=
"unmanaged">
92 <label class=
"custom-control-label"
94 i18n
>Unmanaged
</label>
100 <div *
ngIf=
"!serviceForm.controls.unmanaged.value"
101 class=
"form-group row">
102 <label class=
"cd-col-form-label"
104 i18n
>Placement
</label>
105 <div class=
"cd-col-form-input">
106 <select id=
"placement"
107 class=
"form-control custom-select"
108 formControlName=
"placement">
110 value=
"hosts">Hosts
</option>
112 value=
"label">Label
</option>
118 <div *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'label'"
119 class=
"form-group row">
121 class=
"cd-col-form-label"
122 for=
"label">Label
</label>
123 <div class=
"cd-col-form-input">
127 formControlName=
"label"
128 [ngbTypeahead]=
"searchLabels"
129 (focus)=
"labelFocus.next($any($event).target.value)"
130 (click)=
"labelClick.next($any($event).target.value)">
131 <span class=
"invalid-feedback"
132 *
ngIf=
"serviceForm.showError('label', frm, 'required')"
133 i18n
>This field is required.
</span>
138 <div *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'hosts'"
139 class=
"form-group row">
140 <label class=
"cd-col-form-label"
143 <div class=
"cd-col-form-input">
144 <cd-select-badges id=
"hosts"
145 [data]=
"serviceForm.controls.hosts.value"
146 [options]=
"hosts.options"
147 [messages]=
"hosts.messages">
153 <div *
ngIf=
"!serviceForm.controls.unmanaged.value"
154 class=
"form-group row">
155 <label class=
"cd-col-form-label"
157 <span i18n
>Count
</span>
158 <cd-helper i18n
>Only that number of daemons will be created.
</cd-helper>
160 <div class=
"cd-col-form-input">
164 formControlName=
"count"
166 <span class=
"invalid-feedback"
167 *
ngIf=
"serviceForm.showError('count', frm, 'min')"
168 i18n
>The value must be at least
1.
</span>
169 <span class=
"invalid-feedback"
170 *
ngIf=
"serviceForm.showError('count', frm, 'pattern')"
171 i18n
>The entered value needs to be a number.
</span>
176 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'nfs'">
178 <div class=
"form-group row">
180 class=
"cd-col-form-label required"
181 for=
"pool">Pool
</label>
182 <div class=
"cd-col-form-input">
185 class=
"form-control custom-select"
186 formControlName=
"pool">
187 <option *
ngIf=
"pools === null"
189 i18n
>Loading...
</option>
190 <option *
ngIf=
"pools !== null && pools.length === 0"
192 i18n
>-- No pools available --
</option>
193 <option *
ngIf=
"pools !== null && pools.length > 0"
195 i18n
>-- Select a pool --
</option>
196 <option *
ngFor=
"let pool of pools"
197 [value]=
"pool.pool_name">{{ pool.pool_name }}
</option>
199 <span class=
"invalid-feedback"
200 *
ngIf=
"serviceForm.showError('pool', frm, 'required')"
201 i18n
>This field is required.
</span>
206 <div class=
"form-group row">
208 class=
"cd-col-form-label"
209 for=
"namespace">Namespace
</label>
210 <div class=
"cd-col-form-input">
211 <input id=
"namespace"
214 formControlName=
"namespace">
220 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'rgw'">
221 <!-- rgw_frontend_port -->
222 <div class=
"form-group row">
224 class=
"cd-col-form-label"
225 for=
"rgw_frontend_port">Port
</label>
226 <div class=
"cd-col-form-input">
227 <input id=
"rgw_frontend_port"
230 formControlName=
"rgw_frontend_port"
233 <span class=
"invalid-feedback"
234 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'pattern')"
235 i18n
>The entered value needs to be a number.
</span>
236 <span class=
"invalid-feedback"
237 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'min')"
238 i18n
>The value must be at least
1.
</span>
239 <span class=
"invalid-feedback"
240 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'max')"
241 i18n
>The value cannot exceed
65535.
</span>
247 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
249 <div class=
"form-group row">
251 class=
"cd-col-form-label required"
252 for=
"pool">Pool
</label>
253 <div class=
"cd-col-form-input">
256 class=
"form-control custom-select"
257 formControlName=
"pool">
258 <option *
ngIf=
"pools === null"
260 i18n
>Loading...
</option>
261 <option *
ngIf=
"pools !== null && pools.length === 0"
263 i18n
>-- No pools available --
</option>
264 <option *
ngIf=
"pools !== null && pools.length > 0"
266 i18n
>-- Select a pool --
</option>
267 <option *
ngFor=
"let pool of pools"
268 [value]=
"pool.pool_name">{{ pool.pool_name }}
</option>
270 <span class=
"invalid-feedback"
271 *
ngIf=
"serviceForm.showError('pool', frm, 'required')"
272 i18n
>This field is required.
</span>
276 <!-- trusted_ip_list -->
277 <div class=
"form-group row">
278 <label class=
"cd-col-form-label"
279 for=
"trusted_ip_list">
280 <span i18n
>Trusted IPs
</span>
282 <span i18n
>Comma separated list of IP addresses.
</span>
284 <span i18n
>Please add the
<b>Ceph Manager
</b> IP addresses here, otherwise the iSCSI gateways can't be reached.
</span>
287 <div class=
"cd-col-form-input">
288 <input id=
"trusted_ip_list"
291 formControlName=
"trusted_ip_list">
296 <div class=
"form-group row">
298 class=
"cd-col-form-label"
299 for=
"api_port">Port
</label>
300 <div class=
"cd-col-form-input">
304 formControlName=
"api_port"
307 <span class=
"invalid-feedback"
308 *
ngIf=
"serviceForm.showError('api_port', frm, 'pattern')"
309 i18n
>The entered value needs to be a number.
</span>
310 <span class=
"invalid-feedback"
311 *
ngIf=
"serviceForm.showError('api_port', frm, 'min')"
312 i18n
>The value must be at least
1.
</span>
313 <span class=
"invalid-feedback"
314 *
ngIf=
"serviceForm.showError('api_port', frm, 'max')"
315 i18n
>The value cannot exceed
65535.
</span>
320 <div class=
"form-group row">
322 class=
"cd-col-form-label"
323 [ngClass]=
"{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
324 for=
"api_user">User
</label>
325 <div class=
"cd-col-form-input">
329 formControlName=
"api_user">
330 <span class=
"invalid-feedback"
331 *
ngIf=
"serviceForm.showError('api_user', frm, 'required')"
332 i18n
>This field is required.
</span>
336 <!-- api_password -->
337 <div class=
"form-group row">
339 class=
"cd-col-form-label"
340 [ngClass]=
"{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
341 for=
"api_password">Password
</label>
342 <div class=
"cd-col-form-input">
343 <div class=
"input-group">
344 <input id=
"api_password"
347 autocomplete=
"new-password"
348 formControlName=
"api_password">
349 <span class=
"input-group-append">
350 <button type=
"button"
351 class=
"btn btn-light"
352 cdPasswordButton=
"api_password">
354 <cd-copy-2-clipboard-button source=
"api_password">
355 </cd-copy-2-clipboard-button>
357 <span class=
"invalid-feedback"
358 *
ngIf=
"serviceForm.showError('api_password', frm, 'required')"
359 i18n
>This field is required.
</span>
366 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'ingress'">
368 <div class=
"form-group row">
369 <label class=
"cd-col-form-label"
370 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
372 <span i18n
>Virtual IP
</span>
374 <span i18n
>The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.
</span>
377 <div class=
"cd-col-form-input">
378 <input id=
"virtual_ip"
381 formControlName=
"virtual_ip">
382 <span class=
"invalid-feedback"
383 *
ngIf=
"serviceForm.showError('virtual_ip', frm, 'required')"
384 i18n
>This field is required.
</span>
388 <!-- frontend_port -->
389 <div class=
"form-group row">
390 <label class=
"cd-col-form-label"
391 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
393 <span i18n
>Frontend Port
</span>
395 <span i18n
>The port used to access the ingress service.
</span>
398 <div class=
"cd-col-form-input">
399 <input id=
"frontend_port"
402 formControlName=
"frontend_port"
405 <span class=
"invalid-feedback"
406 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'pattern')"
407 i18n
>The entered value needs to be a number.
</span>
408 <span class=
"invalid-feedback"
409 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'min')"
410 i18n
>The value must be at least
1.
</span>
411 <span class=
"invalid-feedback"
412 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'max')"
413 i18n
>The value cannot exceed
65535.
</span>
414 <span class=
"invalid-feedback"
415 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'required')"
416 i18n
>This field is required.
</span>
420 <!-- monitor_port -->
421 <div class=
"form-group row">
422 <label class=
"cd-col-form-label"
423 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
425 <span i18n
>Monitor Port
</span>
427 <span i18n
>The port used by haproxy for load balancer status.
</span>
430 <div class=
"cd-col-form-input">
431 <input id=
"monitor_port"
434 formControlName=
"monitor_port"
437 <span class=
"invalid-feedback"
438 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'pattern')"
439 i18n
>The entered value needs to be a number.
</span>
440 <span class=
"invalid-feedback"
441 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'min')"
442 i18n
>The value must be at least
1.
</span>
443 <span class=
"invalid-feedback"
444 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'max')"
445 i18n
>The value cannot exceed
65535.
</span>
446 <span class=
"invalid-feedback"
447 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'required')"
448 i18n
>This field is required.
</span>
451 <!-- virtual_interface_networks -->
452 <div class=
"form-group row">
453 <label class=
"cd-col-form-label"
454 for=
"virtual_interface_networks">
455 <span i18n
>CIDR Networks
</span>
457 <span i18n
>A list of networks to identify which network interface to use for the virtual IP address.
</span>
460 <div class=
"cd-col-form-input">
461 <input id=
"virtual_interface_networks"
464 formControlName=
"virtual_interface_networks">
468 <!-- RGW, Ingress & iSCSI -->
469 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)">
471 <div class=
"form-group row">
472 <div class=
"cd-col-form-offset">
473 <div class=
"custom-control custom-checkbox">
474 <input class=
"custom-control-input"
477 formControlName=
"ssl">
478 <label class=
"custom-control-label"
486 <div *
ngIf=
"serviceForm.controls.ssl.value"
487 class=
"form-group row">
488 <label class=
"cd-col-form-label"
490 <span i18n
>Certificate
</span>
491 <cd-helper i18n
>The SSL certificate in PEM format.
</cd-helper>
493 <div class=
"cd-col-form-input">
494 <textarea id=
"ssl_cert"
495 class=
"form-control resize-vertical text-monospace text-pre"
496 formControlName=
"ssl_cert"
500 (change)=
"fileUpload($event.target.files, 'ssl_cert')">
501 <span class=
"invalid-feedback"
502 *
ngIf=
"serviceForm.showError('ssl_cert', frm, 'required')"
503 i18n
>This field is required.
</span>
504 <span class=
"invalid-feedback"
505 *
ngIf=
"serviceForm.showError('ssl_cert', frm, 'pattern')"
506 i18n
>Invalid SSL certificate.
</span>
511 <div *
ngIf=
"serviceForm.controls.ssl.value && serviceForm.controls.service_type.value !== 'rgw'"
512 class=
"form-group row">
513 <label class=
"cd-col-form-label"
515 <span i18n
>Private key
</span>
516 <cd-helper i18n
>The SSL private key in PEM format.
</cd-helper>
518 <div class=
"cd-col-form-input">
519 <textarea id=
"ssl_key"
520 class=
"form-control resize-vertical text-monospace text-pre"
521 formControlName=
"ssl_key"
525 (change)=
"fileUpload($event.target.files,'ssl_key')">
526 <span class=
"invalid-feedback"
527 *
ngIf=
"serviceForm.showError('ssl_key', frm, 'required')"
528 i18n
>This field is required.
</span>
529 <span class=
"invalid-feedback"
530 *
ngIf=
"serviceForm.showError('ssl_key', frm, 'pattern')"
531 i18n
>Invalid SSL private key.
</span>
537 <div class=
"card-footer">
538 <div class=
"text-right">
539 <cd-form-button-panel (submitActionEvent)=
"onSubmit()"
541 [submitText]=
"(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>