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"
19 class="form-control custom-select"
20 formControlName="service_type">
22 [ngValue]="null">-- Select a service type --</option>
23 <option *ngFor="let serviceType of serviceTypes"
24 [value]="serviceType">
28 <span class="invalid-feedback"
29 *ngIf="serviceForm.showError('service_type', frm, 'required')"
30 i18n>This field is required.</span>
34 <!-- backend_service -->
35 <div *ngIf="serviceForm.controls.service_type.value === 'ingress'"
36 class="form-group row">
38 class="cd-col-form-label"
39 [ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
40 for="backend_service">Backend Service</label>
41 <div class="cd-col-form-input">
42 <select id="backend_service"
43 name="backend_service"
44 class="form-control custom-select"
45 formControlName="backend_service"
46 (change)="prePopulateId()">
47 <option *ngIf="services === null"
49 i18n>Loading...</option>
50 <option *ngIf="services !== null && services.length === 0"
52 i18n>-- No service available --</option>
53 <option *ngIf="services !== null && services.length > 0"
55 i18n>-- Select an existing RGW service --</option>
56 <option *ngFor="let service of services"
57 [value]="service.service_name">{{ service.service_name }}</option>
59 <span class="invalid-feedback"
60 *ngIf="serviceForm.showError('backend_service', frm, 'required')"
61 i18n>This field is required.</span>
66 <div class="form-group row">
68 class="cd-col-form-label"
69 [ngClass]="{'required': ['mds', 'rgw', 'nfs', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)}"
70 for="service_id">Id</label>
71 <div class="cd-col-form-input">
72 <input id="service_id"
75 formControlName="service_id">
76 <span class="invalid-feedback"
77 *ngIf="serviceForm.showError('service_id', frm, 'required')"
78 i18n>This field is required.</span>
79 <span class="invalid-feedback"
80 *ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')"
81 i18n>The value does not match the pattern <strong><service_id>[.<realm_name>.<zone_name>]</strong>.</span>
86 <div class="form-group row">
87 <div class="cd-col-form-offset">
88 <div class="custom-control custom-checkbox">
89 <input class="custom-control-input"
92 formControlName="unmanaged">
93 <label class="custom-control-label"
95 i18n>Unmanaged</label>
101 <div *ngIf="!serviceForm.controls.unmanaged.value"
102 class="form-group row">
103 <label class="cd-col-form-label"
105 i18n>Placement</label>
106 <div class="cd-col-form-input">
107 <select id="placement"
108 class="form-control custom-select"
109 formControlName="placement">
111 value="hosts">Hosts</option>
113 value="label">Label</option>
119 <div *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'label'"
120 class="form-group row">
122 class="cd-col-form-label"
123 for="label">Label</label>
124 <div class="cd-col-form-input">
128 formControlName="label"
129 [ngbTypeahead]="searchLabels"
130 (focus)="labelFocus.next($any($event).target.value)"
131 (click)="labelClick.next($any($event).target.value)">
132 <span class="invalid-feedback"
133 *ngIf="serviceForm.showError('label', frm, 'required')"
134 i18n>This field is required.</span>
139 <div *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'hosts'"
140 class="form-group row">
141 <label class="cd-col-form-label"
144 <div class="cd-col-form-input">
145 <cd-select-badges id="hosts"
146 [data]="serviceForm.controls.hosts.value"
147 [options]="hosts.options"
148 [messages]="hosts.messages">
154 <div *ngIf="!serviceForm.controls.unmanaged.value"
155 class="form-group row">
156 <label class="cd-col-form-label"
158 <span i18n>Count</span>
159 <cd-helper i18n>Only that number of daemons will be created.</cd-helper>
161 <div class="cd-col-form-input">
165 formControlName="count"
167 <span class="invalid-feedback"
168 *ngIf="serviceForm.showError('count', frm, 'min')"
169 i18n>The value must be at least 1.</span>
170 <span class="invalid-feedback"
171 *ngIf="serviceForm.showError('count', frm, 'pattern')"
172 i18n>The entered value needs to be a number.</span>
177 <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'rgw'">
178 <!-- rgw_frontend_port -->
179 <div class="form-group row">
181 class="cd-col-form-label"
182 for="rgw_frontend_port">Port</label>
183 <div class="cd-col-form-input">
184 <input id="rgw_frontend_port"
187 formControlName="rgw_frontend_port"
190 <span class="invalid-feedback"
191 *ngIf="serviceForm.showError('rgw_frontend_port', frm, 'pattern')"
192 i18n>The entered value needs to be a number.</span>
193 <span class="invalid-feedback"
194 *ngIf="serviceForm.showError('rgw_frontend_port', frm, 'min')"
195 i18n>The value must be at least 1.</span>
196 <span class="invalid-feedback"
197 *ngIf="serviceForm.showError('rgw_frontend_port', frm, 'max')"
198 i18n>The value cannot exceed 65535.</span>
204 <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
206 <div class="form-group row">
208 class="cd-col-form-label required"
209 for="pool">Pool</label>
210 <div class="cd-col-form-input">
213 class="form-control custom-select"
214 formControlName="pool">
215 <option *ngIf="pools === null"
217 i18n>Loading...</option>
218 <option *ngIf="pools !== null && pools.length === 0"
220 i18n>-- No pools available --</option>
221 <option *ngIf="pools !== null && pools.length > 0"
223 i18n>-- Select a pool --</option>
224 <option *ngFor="let pool of pools"
225 [value]="pool.pool_name">{{ pool.pool_name }}</option>
227 <span class="invalid-feedback"
228 *ngIf="serviceForm.showError('pool', frm, 'required')"
229 i18n>This field is required.</span>
233 <!-- trusted_ip_list -->
234 <div class="form-group row">
235 <label class="cd-col-form-label"
236 for="trusted_ip_list">
237 <span i18n>Trusted IPs</span>
239 <span i18n>Comma separated list of IP addresses.</span>
241 <span i18n>Please add the <b>Ceph Manager</b> IP addresses here, otherwise the iSCSI gateways can't be reached.</span>
244 <div class="cd-col-form-input">
245 <input id="trusted_ip_list"
248 formControlName="trusted_ip_list">
253 <div class="form-group row">
255 class="cd-col-form-label"
256 for="api_port">Port</label>
257 <div class="cd-col-form-input">
261 formControlName="api_port"
264 <span class="invalid-feedback"
265 *ngIf="serviceForm.showError('api_port', frm, 'pattern')"
266 i18n>The entered value needs to be a number.</span>
267 <span class="invalid-feedback"
268 *ngIf="serviceForm.showError('api_port', frm, 'min')"
269 i18n>The value must be at least 1.</span>
270 <span class="invalid-feedback"
271 *ngIf="serviceForm.showError('api_port', frm, 'max')"
272 i18n>The value cannot exceed 65535.</span>
277 <div class="form-group row">
279 class="cd-col-form-label"
280 [ngClass]="{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
281 for="api_user">User</label>
282 <div class="cd-col-form-input">
286 formControlName="api_user">
287 <span class="invalid-feedback"
288 *ngIf="serviceForm.showError('api_user', frm, 'required')"
289 i18n>This field is required.</span>
293 <!-- api_password -->
294 <div class="form-group row">
296 class="cd-col-form-label"
297 [ngClass]="{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
298 for="api_password">Password</label>
299 <div class="cd-col-form-input">
300 <div class="input-group">
301 <input id="api_password"
304 autocomplete="new-password"
305 formControlName="api_password">
306 <span class="input-group-append">
307 <button type="button"
308 class="btn btn-light"
309 cdPasswordButton="api_password">
311 <cd-copy-2-clipboard-button source="api_password">
312 </cd-copy-2-clipboard-button>
314 <span class="invalid-feedback"
315 *ngIf="serviceForm.showError('api_password', frm, 'required')"
316 i18n>This field is required.</span>
323 <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'ingress'">
325 <div class="form-group row">
326 <label class="cd-col-form-label"
327 [ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
329 <span i18n>Virtual IP</span>
331 <span i18n>The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.</span>
334 <div class="cd-col-form-input">
335 <input id="virtual_ip"
338 formControlName="virtual_ip">
339 <span class="invalid-feedback"
340 *ngIf="serviceForm.showError('virtual_ip', frm, 'required')"
341 i18n>This field is required.</span>
345 <!-- frontend_port -->
346 <div class="form-group row">
347 <label class="cd-col-form-label"
348 [ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
350 <span i18n>Frontend Port</span>
352 <span i18n>The port used to access the ingress service.</span>
355 <div class="cd-col-form-input">
356 <input id="frontend_port"
359 formControlName="frontend_port"
362 <span class="invalid-feedback"
363 *ngIf="serviceForm.showError('frontend_port', frm, 'pattern')"
364 i18n>The entered value needs to be a number.</span>
365 <span class="invalid-feedback"
366 *ngIf="serviceForm.showError('frontend_port', frm, 'min')"
367 i18n>The value must be at least 1.</span>
368 <span class="invalid-feedback"
369 *ngIf="serviceForm.showError('frontend_port', frm, 'max')"
370 i18n>The value cannot exceed 65535.</span>
371 <span class="invalid-feedback"
372 *ngIf="serviceForm.showError('frontend_port', frm, 'required')"
373 i18n>This field is required.</span>
377 <!-- monitor_port -->
378 <div class="form-group row">
379 <label class="cd-col-form-label"
380 [ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
382 <span i18n>Monitor Port</span>
384 <span i18n>The port used by haproxy for load balancer status.</span>
387 <div class="cd-col-form-input">
388 <input id="monitor_port"
391 formControlName="monitor_port"
394 <span class="invalid-feedback"
395 *ngIf="serviceForm.showError('monitor_port', frm, 'pattern')"
396 i18n>The entered value needs to be a number.</span>
397 <span class="invalid-feedback"
398 *ngIf="serviceForm.showError('monitor_port', frm, 'min')"
399 i18n>The value must be at least 1.</span>
400 <span class="invalid-feedback"
401 *ngIf="serviceForm.showError('monitor_port', frm, 'max')"
402 i18n>The value cannot exceed 65535.</span>
403 <span class="invalid-feedback"
404 *ngIf="serviceForm.showError('monitor_port', frm, 'required')"
405 i18n>This field is required.</span>
408 <!-- virtual_interface_networks -->
409 <div class="form-group row">
410 <label class="cd-col-form-label"
411 for="virtual_interface_networks">
412 <span i18n>CIDR Networks</span>
414 <span i18n>A list of networks to identify which network interface to use for the virtual IP address.</span>
417 <div class="cd-col-form-input">
418 <input id="virtual_interface_networks"
421 formControlName="virtual_interface_networks">
425 <!-- RGW, Ingress & iSCSI -->
426 <ng-container *ngIf="!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)">
428 <div class="form-group row">
429 <div class="cd-col-form-offset">
430 <div class="custom-control custom-checkbox">
431 <input class="custom-control-input"
434 formControlName="ssl">
435 <label class="custom-control-label"
443 <div *ngIf="serviceForm.controls.ssl.value"
444 class="form-group row">
445 <label class="cd-col-form-label"
447 <span i18n>Certificate</span>
448 <cd-helper i18n>The SSL certificate in PEM format.</cd-helper>
450 <div class="cd-col-form-input">
451 <textarea id="ssl_cert"
452 class="form-control resize-vertical text-monospace text-pre"
453 formControlName="ssl_cert"
457 (change)="fileUpload($event.target.files, 'ssl_cert')">
458 <span class="invalid-feedback"
459 *ngIf="serviceForm.showError('ssl_cert', frm, 'required')"
460 i18n>This field is required.</span>
461 <span class="invalid-feedback"
462 *ngIf="serviceForm.showError('ssl_cert', frm, 'pattern')"
463 i18n>Invalid SSL certificate.</span>
468 <div *ngIf="serviceForm.controls.ssl.value && serviceForm.controls.service_type.value !== 'rgw'"
469 class="form-group row">
470 <label class="cd-col-form-label"
472 <span i18n>Private key</span>
473 <cd-helper i18n>The SSL private key in PEM format.</cd-helper>
475 <div class="cd-col-form-input">
476 <textarea id="ssl_key"
477 class="form-control resize-vertical text-monospace text-pre"
478 formControlName="ssl_key"
482 (change)="fileUpload($event.target.files,'ssl_key')">
483 <span class="invalid-feedback"
484 *ngIf="serviceForm.showError('ssl_key', frm, 'required')"
485 i18n>This field is required.</span>
486 <span class="invalid-feedback"
487 *ngIf="serviceForm.showError('ssl_key', frm, 'pattern')"
488 i18n>Invalid SSL private key.</span>
494 <div class="modal-footer">
495 <div class="text-right">
496 <cd-form-button-panel (submitActionEvent)="onSubmit()"
498 [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>