1 <cd-modal [pageURL]=
"pageURL"
2 [modalRef]=
"activeModal">
3 <span class=
"modal-title"
4 i18n
>{{ action | titlecase }} {{ resource | upperFirst }}
</span>
5 <ng-container class=
"modal-content">
7 [formGroup]=
"serviceForm"
9 <div class=
"modal-body">
12 <div class=
"form-group row">
13 <label class=
"cd-col-form-label required"
16 <div class=
"cd-col-form-input">
17 <select id=
"service_type"
20 formControlName=
"service_type"
21 (change)=
"getServiceIds($event.target.value)">
23 [ngValue]=
"null">-- Select a service type --
</option>
24 <option *
ngFor=
"let serviceType of serviceTypes"
25 [value]=
"serviceType">
29 <span class=
"invalid-feedback"
30 *
ngIf=
"serviceForm.showError('service_type', frm, 'required')"
31 i18n
>This field is required.
</span>
35 <!-- backend_service -->
36 <div *
ngIf=
"serviceForm.controls.service_type.value === 'ingress'"
37 class=
"form-group row">
39 class=
"cd-col-form-label"
40 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
41 for=
"backend_service">Backend Service
</label>
42 <div class=
"cd-col-form-input">
43 <select id=
"backend_service"
44 name=
"backend_service"
46 formControlName=
"backend_service"
47 (change)=
"prePopulateId()">
48 <option *
ngIf=
"services === null"
50 i18n
>Loading...
</option>
51 <option *
ngIf=
"services !== null && services.length === 0"
53 i18n
>-- No service available --
</option>
54 <option *
ngIf=
"services !== null && services.length > 0"
56 i18n
>-- Select an existing service --
</option>
57 <option *
ngFor=
"let service of services"
58 [value]=
"service.service_name">{{ service.service_name }}
</option>
60 <span class=
"invalid-feedback"
61 *
ngIf=
"serviceForm.showError('backend_service', frm, 'required')"
62 i18n
>This field is required.
</span>
67 <div class=
"form-group row"
68 *
ngIf=
"serviceForm.controls.service_type.value !== 'snmp-gateway'">
70 class=
"cd-col-form-label"
71 [ngClass]=
"{'required': ['mds', 'rgw', 'nfs', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)}"
72 for=
"service_id">Id
</label>
73 <div class=
"cd-col-form-input">
74 <input id=
"service_id"
77 formControlName=
"service_id">
78 <span class=
"invalid-feedback"
79 *
ngIf=
"serviceForm.showError('service_id', frm, 'required')"
80 i18n
>This field is required.
</span>
81 <span class=
"invalid-feedback"
82 *
ngIf=
"serviceForm.showError('service_id', frm, 'uniqueName')"
83 i18n
>This service id is already in use.
</span>
84 <span class=
"invalid-feedback"
85 *
ngIf=
"serviceForm.showError('service_id', frm, 'rgwPattern')"
86 i18n
>The value does not match the pattern
<strong><service_id
>[.
<realm_name
>.
<zone_name
>]
</strong>.
</span>
91 <div class=
"form-group row">
92 <div class=
"cd-col-form-offset">
93 <div class=
"custom-control custom-checkbox">
94 <input class=
"custom-control-input"
97 formControlName=
"unmanaged">
98 <label class=
"custom-control-label"
100 i18n
>Unmanaged
</label>
106 <div *
ngIf=
"!serviceForm.controls.unmanaged.value"
107 class=
"form-group row">
108 <label class=
"cd-col-form-label"
110 i18n
>Placement
</label>
111 <div class=
"cd-col-form-input">
112 <select id=
"placement"
114 formControlName=
"placement">
116 value=
"hosts">Hosts
</option>
118 value=
"label">Label
</option>
124 <div *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'label'"
125 class=
"form-group row">
127 class=
"cd-col-form-label"
128 for=
"label">Label
</label>
129 <div class=
"cd-col-form-input">
133 formControlName=
"label"
134 [ngbTypeahead]=
"searchLabels"
135 (focus)=
"labelFocus.next($any($event).target.value)"
136 (click)=
"labelClick.next($any($event).target.value)">
137 <span class=
"invalid-feedback"
138 *
ngIf=
"serviceForm.showError('label', frm, 'required')"
139 i18n
>This field is required.
</span>
144 <div *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'hosts'"
145 class=
"form-group row">
146 <label class=
"cd-col-form-label"
149 <div class=
"cd-col-form-input">
150 <cd-select-badges id=
"hosts"
151 [data]=
"serviceForm.controls.hosts.value"
152 [options]=
"hosts.options"
153 [messages]=
"hosts.messages">
159 <div *
ngIf=
"!serviceForm.controls.unmanaged.value"
160 class=
"form-group row">
161 <label class=
"cd-col-form-label"
163 <span i18n
>Count
</span>
164 <cd-helper i18n
>Only that number of daemons will be created.
</cd-helper>
166 <div class=
"cd-col-form-input">
170 formControlName=
"count"
172 <span class=
"invalid-feedback"
173 *
ngIf=
"serviceForm.showError('count', frm, 'min')"
174 i18n
>The value must be at least
1.
</span>
175 <span class=
"invalid-feedback"
176 *
ngIf=
"serviceForm.showError('count', frm, 'pattern')"
177 i18n
>The entered value needs to be a number.
</span>
182 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'rgw'">
183 <!-- rgw_frontend_port -->
184 <div class=
"form-group row">
186 class=
"cd-col-form-label"
187 for=
"rgw_frontend_port">Port
</label>
188 <div class=
"cd-col-form-input">
189 <input id=
"rgw_frontend_port"
192 formControlName=
"rgw_frontend_port"
195 <span class=
"invalid-feedback"
196 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'pattern')"
197 i18n
>The entered value needs to be a number.
</span>
198 <span class=
"invalid-feedback"
199 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'min')"
200 i18n
>The value must be at least
1.
</span>
201 <span class=
"invalid-feedback"
202 *
ngIf=
"serviceForm.showError('rgw_frontend_port', frm, 'max')"
203 i18n
>The value cannot exceed
65535.
</span>
210 <div class=
"form-group row"
211 *
ngIf=
"serviceForm.controls.service_type.value === 'iscsi'">
213 class=
"cd-col-form-label required"
214 for=
"pool">Pool
</label>
215 <div class=
"cd-col-form-input">
219 formControlName=
"pool">
220 <option *
ngIf=
"pools === null"
222 i18n
>Loading...
</option>
223 <option *
ngIf=
"pools && pools.length === 0"
225 i18n
>-- No pools available --
</option>
226 <option *
ngIf=
"pools && pools.length > 0"
228 i18n
>-- Select a pool --
</option>
229 <option *
ngFor=
"let pool of pools"
230 [value]=
"pool.pool_name">{{ pool.pool_name }}
</option>
232 <span class=
"invalid-feedback"
233 *
ngIf=
"serviceForm.showError('pool', frm, 'required')"
234 i18n
>This field is required.
</span>
238 <!-- fields in iSCSI which are hidden when unmanaged is true -->
239 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
240 <!-- trusted_ip_list -->
241 <div class=
"form-group row">
242 <label class=
"cd-col-form-label"
243 for=
"trusted_ip_list">
244 <span i18n
>Trusted IPs
</span>
246 <span i18n
>Comma separated list of IP addresses.
</span>
248 <span i18n
>Please add the
<b>Ceph Manager
</b> IP addresses here, otherwise the iSCSI gateways can't be reached.
</span>
251 <div class=
"cd-col-form-input">
252 <input id=
"trusted_ip_list"
255 formControlName=
"trusted_ip_list">
260 <div class=
"form-group row">
262 class=
"cd-col-form-label"
263 for=
"api_port">Port
</label>
264 <div class=
"cd-col-form-input">
268 formControlName=
"api_port"
271 <span class=
"invalid-feedback"
272 *
ngIf=
"serviceForm.showError('api_port', frm, 'pattern')"
273 i18n
>The entered value needs to be a number.
</span>
274 <span class=
"invalid-feedback"
275 *
ngIf=
"serviceForm.showError('api_port', frm, 'min')"
276 i18n
>The value must be at least
1.
</span>
277 <span class=
"invalid-feedback"
278 *
ngIf=
"serviceForm.showError('api_port', frm, 'max')"
279 i18n
>The value cannot exceed
65535.
</span>
284 <div class=
"form-group row">
286 class=
"cd-col-form-label"
287 [ngClass]=
"{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
288 for=
"api_user">User
</label>
289 <div class=
"cd-col-form-input">
293 formControlName=
"api_user">
294 <span class=
"invalid-feedback"
295 *
ngIf=
"serviceForm.showError('api_user', frm, 'required')"
296 i18n
>This field is required.
</span>
300 <!-- api_password -->
301 <div class=
"form-group row">
303 class=
"cd-col-form-label"
304 [ngClass]=
"{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
305 for=
"api_password">Password
</label>
306 <div class=
"cd-col-form-input">
307 <div class=
"input-group">
308 <input id=
"api_password"
311 autocomplete=
"new-password"
312 formControlName=
"api_password">
313 <span class=
"input-group-append">
314 <button type=
"button"
315 class=
"btn btn-light"
316 cdPasswordButton=
"api_password">
318 <cd-copy-2-clipboard-button source=
"api_password">
319 </cd-copy-2-clipboard-button>
321 <span class=
"invalid-feedback"
322 *
ngIf=
"serviceForm.showError('api_password', frm, 'required')"
323 i18n
>This field is required.
</span>
330 <ng-container *
ngIf=
"serviceForm.controls.service_type.value === 'ingress'">
332 <div class=
"form-group row">
333 <label class=
"cd-col-form-label"
334 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
336 <span i18n
>Virtual IP
</span>
338 <span i18n
>The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.
</span>
341 <div class=
"cd-col-form-input">
342 <input id=
"virtual_ip"
345 formControlName=
"virtual_ip">
346 <span class=
"invalid-feedback"
347 *
ngIf=
"serviceForm.showError('virtual_ip', frm, 'required')"
348 i18n
>This field is required.
</span>
352 <!-- frontend_port -->
353 <div class=
"form-group row">
354 <label class=
"cd-col-form-label"
355 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
357 <span i18n
>Frontend Port
</span>
359 <span i18n
>The port used to access the ingress service.
</span>
362 <div class=
"cd-col-form-input">
363 <input id=
"frontend_port"
366 formControlName=
"frontend_port"
369 <span class=
"invalid-feedback"
370 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'pattern')"
371 i18n
>The entered value needs to be a number.
</span>
372 <span class=
"invalid-feedback"
373 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'min')"
374 i18n
>The value must be at least
1.
</span>
375 <span class=
"invalid-feedback"
376 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'max')"
377 i18n
>The value cannot exceed
65535.
</span>
378 <span class=
"invalid-feedback"
379 *
ngIf=
"serviceForm.showError('frontend_port', frm, 'required')"
380 i18n
>This field is required.
</span>
384 <!-- monitor_port -->
385 <div class=
"form-group row">
386 <label class=
"cd-col-form-label"
387 [ngClass]=
"{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
389 <span i18n
>Monitor Port
</span>
391 <span i18n
>The port used by haproxy for load balancer status.
</span>
394 <div class=
"cd-col-form-input">
395 <input id=
"monitor_port"
398 formControlName=
"monitor_port"
401 <span class=
"invalid-feedback"
402 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'pattern')"
403 i18n
>The entered value needs to be a number.
</span>
404 <span class=
"invalid-feedback"
405 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'min')"
406 i18n
>The value must be at least
1.
</span>
407 <span class=
"invalid-feedback"
408 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'max')"
409 i18n
>The value cannot exceed
65535.
</span>
410 <span class=
"invalid-feedback"
411 *
ngIf=
"serviceForm.showError('monitor_port', frm, 'required')"
412 i18n
>This field is required.
</span>
415 <!-- virtual_interface_networks -->
416 <div class=
"form-group row"
417 *
ngIf=
"!serviceForm.controls.unmanaged.value">
418 <label class=
"cd-col-form-label"
419 for=
"virtual_interface_networks">
420 <span i18n
>CIDR Networks
</span>
422 <span i18n
>A list of networks to identify which network interface to use for the virtual IP address.
</span>
425 <div class=
"cd-col-form-input">
426 <input id=
"virtual_interface_networks"
429 formControlName=
"virtual_interface_networks">
434 <!-- SNMP-Gateway -->
435 <ng-container *
ngIf=
"serviceForm.controls.service_type.value === 'snmp-gateway'">
436 <!-- snmp-version -->
437 <div class=
"form-group row">
438 <label class=
"cd-col-form-label required"
441 <div class=
"cd-col-form-input">
442 <select id=
"snmp_version"
445 formControlName=
"snmp_version"
446 (change)=
"clearValidations()">
448 [ngValue]=
"null">-- Select SNMP version --
</option>
449 <option *
ngFor=
"let snmpVersion of ['V2c', 'V3']"
450 [value]=
"snmpVersion">{{ snmpVersion }}
</option>
452 <span class=
"invalid-feedback"
453 *
ngIf=
"serviceForm.showError('snmp_version', frm, 'required')"
454 i18n
>This field is required.
</span>
458 <div class=
"form-group row">
459 <label class=
"cd-col-form-label required"
460 for=
"snmp_destination">
461 <span i18n
>Destination
</span>
463 <span i18n
>Must be of the format hostname:port.
</span>
466 <div class=
"cd-col-form-input">
467 <input id=
"snmp_destination"
470 formControlName=
"snmp_destination">
471 <span class=
"invalid-feedback"
472 *
ngIf=
"serviceForm.showError('snmp_destination', frm, 'required')"
473 i18n
>This field is required.
</span>
474 <span class=
"invalid-feedback"
475 *
ngIf=
"serviceForm.showError('snmp_destination', frm, 'snmpDestinationPattern')"
476 i18n
>The value does not match the pattern:
<strong>hostname:port
</strong></span>
479 <!-- Engine id for snmp V3 -->
480 <div class=
"form-group row"
481 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3'">
482 <label class=
"cd-col-form-label required"
484 <span i18n
>Engine Id
</span>
486 <span i18n
>Unique identifier for the device (in hex).
</span>
489 <div class=
"cd-col-form-input">
490 <input id=
"engine_id"
493 formControlName=
"engine_id">
494 <span class=
"invalid-feedback"
495 *
ngIf=
"serviceForm.showError('engine_id', frm, 'required')"
496 i18n
>This field is required.
</span>
497 <span class=
"invalid-feedback"
498 *
ngIf=
"serviceForm.showError('engine_id', frm, 'snmpEngineIdPattern')"
499 i18n
>The value does not match the pattern:
<strong>Must be in hexadecimal and length must be multiple of
2 with min value =
10 amd max value =
64.
</strong></span>
502 <!-- Auth protocol for snmp V3 -->
503 <div class=
"form-group row"
504 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3'">
505 <label class=
"cd-col-form-label required"
507 i18n
>Auth Protocol
</label>
508 <div class=
"cd-col-form-input">
509 <select id=
"auth_protocol"
512 formControlName=
"auth_protocol">
514 [ngValue]=
"null">-- Select auth protocol --
</option>
515 <option *
ngFor=
"let authProtocol of ['SHA', 'MD5']"
516 [value]=
"authProtocol">
520 <span class=
"invalid-feedback"
521 *
ngIf=
"serviceForm.showError('auth_protocol', frm, 'required')"
522 i18n
>This field is required.
</span>
525 <!-- Privacy protocol for snmp V3 -->
526 <div class=
"form-group row"
527 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3'">
528 <label class=
"cd-col-form-label"
529 for=
"privacy_protocol"
530 i18n
>Privacy Protocol
</label>
531 <div class=
"cd-col-form-input">
532 <select id=
"privacy_protocol"
533 name=
"privacy_protocol"
535 formControlName=
"privacy_protocol">
537 [ngValue]=
"null">-- Select privacy protocol --
</option>
538 <option *
ngFor=
"let privacyProtocol of ['DES', 'AES']"
539 [value]=
"privacyProtocol">
540 {{ privacyProtocol }}
547 <legend i18n
>Credentials
</legend>
548 <!-- snmp v2c snmp_community -->
549 <div class=
"form-group row"
550 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V2c'">
551 <label class=
"cd-col-form-label required"
552 for=
"snmp_community">
553 <span i18n
>SNMP Community
</span>
555 <div class=
"cd-col-form-input">
556 <input id=
"snmp_community"
559 formControlName=
"snmp_community">
560 <span class=
"invalid-feedback"
561 *
ngIf=
"serviceForm.showError('snmp_community', frm, 'required')"
562 i18n
>This field is required.
</span>
565 <!-- snmp v3 auth username -->
566 <div class=
"form-group row"
567 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3'">
568 <label class=
"cd-col-form-label required"
569 for=
"snmp_v3_auth_username">
570 <span i18n
>Username
</span>
572 <div class=
"cd-col-form-input">
573 <input id=
"snmp_v3_auth_username"
576 formControlName=
"snmp_v3_auth_username">
577 <span class=
"invalid-feedback"
578 *
ngIf=
"serviceForm.showError('snmp_v3_auth_username', frm, 'required')"
579 i18n
>This field is required.
</span>
582 <!-- snmp v3 auth password -->
583 <div class=
"form-group row"
584 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3'">
585 <label class=
"cd-col-form-label required"
586 for=
"snmp_v3_auth_password">
587 <span i18n
>Password
</span>
589 <div class=
"cd-col-form-input">
590 <input id=
"snmp_v3_auth_password"
593 formControlName=
"snmp_v3_auth_password">
594 <span class=
"invalid-feedback"
595 *
ngIf=
"serviceForm.showError('snmp_v3_auth_password', frm, 'required')"
596 i18n
>This field is required.
</span>
599 <!-- snmp v3 priv password -->
600 <div class=
"form-group row"
601 *
ngIf=
"serviceForm.controls.snmp_version.value === 'V3' && serviceForm.controls.privacy_protocol.value !== null && serviceForm.controls.privacy_protocol.value !== undefined">
602 <label class=
"cd-col-form-label required"
603 for=
"snmp_v3_priv_password">
604 <span i18n
>Encryption
</span>
606 <div class=
"cd-col-form-input">
607 <input id=
"snmp_v3_priv_password"
610 formControlName=
"snmp_v3_priv_password">
611 <span class=
"invalid-feedback"
612 *
ngIf=
"serviceForm.showError('snmp_v3_priv_password', frm, 'required')"
613 i18n
>This field is required.
</span>
618 <!-- RGW, Ingress & iSCSI -->
619 <ng-container *
ngIf=
"!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)">
621 <div class=
"form-group row">
622 <div class=
"cd-col-form-offset">
623 <div class=
"custom-control custom-checkbox">
624 <input class=
"custom-control-input"
627 formControlName=
"ssl">
628 <label class=
"custom-control-label"
636 <div *
ngIf=
"serviceForm.controls.ssl.value"
637 class=
"form-group row">
638 <label class=
"cd-col-form-label"
640 <span i18n
>Certificate
</span>
641 <cd-helper i18n
>The SSL certificate in PEM format.
</cd-helper>
643 <div class=
"cd-col-form-input">
644 <textarea id=
"ssl_cert"
645 class=
"form-control resize-vertical text-monospace text-pre"
646 formControlName=
"ssl_cert"
650 (change)=
"fileUpload($event.target.files, 'ssl_cert')">
651 <span class=
"invalid-feedback"
652 *
ngIf=
"serviceForm.showError('ssl_cert', frm, 'required')"
653 i18n
>This field is required.
</span>
654 <span class=
"invalid-feedback"
655 *
ngIf=
"serviceForm.showError('ssl_cert', frm, 'pattern')"
656 i18n
>Invalid SSL certificate.
</span>
661 <div *
ngIf=
"serviceForm.controls.ssl.value && !(['rgw', 'ingress'].includes(serviceForm.controls.service_type.value))"
662 class=
"form-group row">
663 <label class=
"cd-col-form-label"
665 <span i18n
>Private key
</span>
666 <cd-helper i18n
>The SSL private key in PEM format.
</cd-helper>
668 <div class=
"cd-col-form-input">
669 <textarea id=
"ssl_key"
670 class=
"form-control resize-vertical text-monospace text-pre"
671 formControlName=
"ssl_key"
675 (change)=
"fileUpload($event.target.files,'ssl_key')">
676 <span class=
"invalid-feedback"
677 *
ngIf=
"serviceForm.showError('ssl_key', frm, 'required')"
678 i18n
>This field is required.
</span>
679 <span class=
"invalid-feedback"
680 *
ngIf=
"serviceForm.showError('ssl_key', frm, 'pattern')"
681 i18n
>Invalid SSL private key.
</span>
687 <div class=
"modal-footer">
688 <div class=
"text-right">
689 <cd-form-button-panel (submitActionEvent)=
"onSubmit()"
691 [submitText]=
"(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>