-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
service-form.component.html
755 lines (733 loc) · 33.1 KB
/
service-form.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
<cd-modal [pageURL]="pageURL"
[modalRef]="activeModal">
<span class="modal-title"
i18n>{{ action | titlecase }} {{ resource | upperFirst }}</span>
<ng-container class="modal-content">
<form #frm="ngForm"
[formGroup]="serviceForm"
novalidate>
<div class="modal-body">
<!-- Service type -->
<div class="form-group row">
<label class="cd-col-form-label required"
for="service_type"
i18n>Type</label>
<div class="cd-col-form-input">
<select id="service_type"
name="service_type"
class="form-control"
formControlName="service_type"
(change)="getServiceIds($event.target.value)">
<option i18n
[ngValue]="null">-- Select a service type --</option>
<option *ngFor="let serviceType of serviceTypes"
[value]="serviceType">
{{ serviceType }}
</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_type', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- backend_service -->
<div *ngIf="serviceForm.controls.service_type.value === 'ingress'"
class="form-group row">
<label i18n
class="cd-col-form-label"
[ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
for="backend_service">Backend Service</label>
<div class="cd-col-form-input">
<select id="backend_service"
name="backend_service"
class="form-control"
formControlName="backend_service"
(change)="prePopulateId()">
<option *ngIf="services === null"
[ngValue]="null"
i18n>Loading...</option>
<option *ngIf="services !== null && services.length === 0"
[ngValue]="null"
i18n>-- No service available --</option>
<option *ngIf="services !== null && services.length > 0"
[ngValue]="null"
i18n>-- Select an existing service --</option>
<option *ngFor="let service of services"
[value]="service.service_name">{{ service.service_name }}</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('backend_service', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- Service id -->
<div class="form-group row"
*ngIf="serviceForm.controls.service_type.value !== 'snmp-gateway'">
<label i18n
class="cd-col-form-label"
[ngClass]="{'required': ['mds', 'rgw', 'nfs', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)}"
for="service_id">Id</label>
<div class="cd-col-form-input">
<input id="service_id"
class="form-control"
type="text"
formControlName="service_id">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_id', frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_id', frm, 'uniqueName')"
i18n>This service id is already in use.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')"
i18n>The value does not match the pattern <strong><service_id>[.<realm_name>.<zone_name>]</strong>.</span>
</div>
</div>
<!-- unmanaged -->
<div class="form-group row">
<div class="cd-col-form-offset">
<div class="custom-control custom-checkbox">
<input class="custom-control-input"
id="unmanaged"
type="checkbox"
formControlName="unmanaged">
<label class="custom-control-label"
for="unmanaged"
i18n>Unmanaged</label>
</div>
</div>
</div>
<!-- Placement -->
<div *ngIf="!serviceForm.controls.unmanaged.value"
class="form-group row">
<label class="cd-col-form-label"
for="placement"
i18n>Placement</label>
<div class="cd-col-form-input">
<select id="placement"
class="form-control"
formControlName="placement">
<option i18n
value="hosts">Hosts</option>
<option i18n
value="label">Label</option>
</select>
</div>
</div>
<!-- Label -->
<div *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'label'"
class="form-group row">
<label i18n
class="cd-col-form-label"
for="label">Label</label>
<div class="cd-col-form-input">
<input id="label"
class="form-control"
type="text"
formControlName="label"
[ngbTypeahead]="searchLabels"
(focus)="labelFocus.next($any($event).target.value)"
(click)="labelClick.next($any($event).target.value)">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('label', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- Hosts -->
<div *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.placement.value === 'hosts'"
class="form-group row">
<label class="cd-col-form-label"
for="hosts"
i18n>Hosts</label>
<div class="cd-col-form-input">
<cd-select-badges id="hosts"
[data]="serviceForm.controls.hosts.value"
[options]="hosts.options"
[messages]="hosts.messages">
</cd-select-badges>
</div>
</div>
<!-- count -->
<div *ngIf="!serviceForm.controls.unmanaged.value"
class="form-group row">
<label class="cd-col-form-label"
for="count">
<span i18n>Count</span>
<cd-helper i18n>Only that number of daemons will be created.</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="count"
class="form-control"
type="number"
formControlName="count"
min="1">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('count', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('count', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
</div>
</div>
<!-- RGW -->
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'rgw'">
<!-- rgw_frontend_port -->
<div class="form-group row">
<label i18n
class="cd-col-form-label"
for="rgw_frontend_port">Port</label>
<div class="cd-col-form-input">
<input id="rgw_frontend_port"
class="form-control"
type="number"
formControlName="rgw_frontend_port"
min="1"
max="65535">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('rgw_frontend_port', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('rgw_frontend_port', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('rgw_frontend_port', frm, 'max')"
i18n>The value cannot exceed 65535.</span>
</div>
</div>
</ng-container>
<!-- iSCSI -->
<!-- pool -->
<div class="form-group row"
*ngIf="serviceForm.controls.service_type.value === 'iscsi'">
<label i18n
class="cd-col-form-label required"
for="pool">Pool</label>
<div class="cd-col-form-input">
<select id="pool"
name="pool"
class="form-control"
formControlName="pool">
<option *ngIf="pools === null"
[ngValue]="null"
i18n>Loading...</option>
<option *ngIf="pools && pools.length === 0"
[ngValue]="null"
i18n>-- No pools available --</option>
<option *ngIf="pools && pools.length > 0"
[ngValue]="null"
i18n>-- Select a pool --</option>
<option *ngFor="let pool of pools"
[value]="pool.pool_name">{{ pool.pool_name }}</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('pool', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- fields in iSCSI which are hidden when unmanaged is true -->
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
<!-- trusted_ip_list -->
<div class="form-group row">
<label class="cd-col-form-label"
for="trusted_ip_list">
<span i18n>Trusted IPs</span>
<cd-helper>
<span i18n>Comma separated list of IP addresses.</span>
<br>
<span i18n>Please add the <b>Ceph Manager</b> IP addresses here, otherwise the iSCSI gateways can't be reached.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="trusted_ip_list"
class="form-control"
type="text"
formControlName="trusted_ip_list">
</div>
</div>
<!-- api_port -->
<div class="form-group row">
<label i18n
class="cd-col-form-label"
for="api_port">Port</label>
<div class="cd-col-form-input">
<input id="api_port"
class="form-control"
type="number"
formControlName="api_port"
min="1"
max="65535">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('api_port', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('api_port', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('api_port', frm, 'max')"
i18n>The value cannot exceed 65535.</span>
</div>
</div>
<!-- api_user -->
<div class="form-group row">
<label i18n
class="cd-col-form-label"
[ngClass]="{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
for="api_user">User</label>
<div class="cd-col-form-input">
<input id="api_user"
class="form-control"
type="text"
formControlName="api_user">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('api_user', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- api_password -->
<div class="form-group row">
<label i18n
class="cd-col-form-label"
[ngClass]="{'required': ['iscsi'].includes(serviceForm.controls.service_type.value)}"
for="api_password">Password</label>
<div class="cd-col-form-input">
<div class="input-group">
<input id="api_password"
class="form-control"
type="password"
autocomplete="new-password"
formControlName="api_password">
<span class="input-group-append">
<button type="button"
class="btn btn-light"
cdPasswordButton="api_password">
</button>
<cd-copy-2-clipboard-button source="api_password">
</cd-copy-2-clipboard-button>
</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('api_password', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
</div>
</ng-container>
<!-- Ingress -->
<ng-container *ngIf="serviceForm.controls.service_type.value === 'ingress'">
<!-- virtual_ip -->
<div class="form-group row">
<label class="cd-col-form-label"
[ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
for="virtual_ip">
<span i18n>Virtual IP</span>
<cd-helper>
<span i18n>The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="virtual_ip"
class="form-control"
type="text"
formControlName="virtual_ip">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('virtual_ip', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- frontend_port -->
<div class="form-group row">
<label class="cd-col-form-label"
[ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
for="frontend_port">
<span i18n>Frontend Port</span>
<cd-helper>
<span i18n>The port used to access the ingress service.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="frontend_port"
class="form-control"
type="number"
formControlName="frontend_port"
min="1"
max="65535">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('frontend_port', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('frontend_port', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('frontend_port', frm, 'max')"
i18n>The value cannot exceed 65535.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('frontend_port', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- monitor_port -->
<div class="form-group row">
<label class="cd-col-form-label"
[ngClass]="{'required': ['ingress'].includes(serviceForm.controls.service_type.value)}"
for="monitor_port">
<span i18n>Monitor Port</span>
<cd-helper>
<span i18n>The port used by haproxy for load balancer status.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="monitor_port"
class="form-control"
type="number"
formControlName="monitor_port"
min="1"
max="65535">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('monitor_port', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('monitor_port', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('monitor_port', frm, 'max')"
i18n>The value cannot exceed 65535.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('monitor_port', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- virtual_interface_networks -->
<div class="form-group row"
*ngIf="!serviceForm.controls.unmanaged.value">
<label class="cd-col-form-label"
for="virtual_interface_networks">
<span i18n>CIDR Networks</span>
<cd-helper>
<span i18n>A list of networks to identify which network interface to use for the virtual IP address.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="virtual_interface_networks"
class="form-control"
type="text"
formControlName="virtual_interface_networks">
</div>
</div>
</ng-container>
<!-- SNMP-Gateway -->
<ng-container *ngIf="serviceForm.controls.service_type.value === 'snmp-gateway'">
<!-- snmp-version -->
<div class="form-group row">
<label class="cd-col-form-label required"
for="snmp_version"
i18n>Version</label>
<div class="cd-col-form-input">
<select id="snmp_version"
name="snmp_version"
class="form-control"
formControlName="snmp_version"
(change)="clearValidations()">
<option i18n
[ngValue]="null">-- Select SNMP version --</option>
<option *ngFor="let snmpVersion of ['V2c', 'V3']"
[value]="snmpVersion">{{ snmpVersion }}</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_version', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- Destination -->
<div class="form-group row">
<label class="cd-col-form-label required"
for="snmp_destination">
<span i18n>Destination</span>
<cd-helper>
<span i18n>Must be of the format hostname:port.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="snmp_destination"
class="form-control"
type="text"
formControlName="snmp_destination">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_destination', frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_destination', frm, 'snmpDestinationPattern')"
i18n>The value does not match the pattern: <strong>hostname:port</strong></span>
</div>
</div>
<!-- Engine id for snmp V3 -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3'">
<label class="cd-col-form-label required"
for="engine_id">
<span i18n>Engine Id</span>
<cd-helper>
<span i18n>Unique identifier for the device (in hex).</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="engine_id"
class="form-control"
type="text"
formControlName="engine_id">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('engine_id', frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('engine_id', frm, 'snmpEngineIdPattern')"
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>
</div>
</div>
<!-- Auth protocol for snmp V3 -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3'">
<label class="cd-col-form-label required"
for="auth_protocol"
i18n>Auth Protocol</label>
<div class="cd-col-form-input">
<select id="auth_protocol"
name="auth_protocol"
class="form-control"
formControlName="auth_protocol">
<option i18n
[ngValue]="null">-- Select auth protocol --</option>
<option *ngFor="let authProtocol of ['SHA', 'MD5']"
[value]="authProtocol">
{{ authProtocol }}
</option>
</select>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('auth_protocol', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- Privacy protocol for snmp V3 -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3'">
<label class="cd-col-form-label"
for="privacy_protocol"
i18n>Privacy Protocol</label>
<div class="cd-col-form-input">
<select id="privacy_protocol"
name="privacy_protocol"
class="form-control"
formControlName="privacy_protocol">
<option i18n
[ngValue]="null">-- Select privacy protocol --</option>
<option *ngFor="let privacyProtocol of ['DES', 'AES']"
[value]="privacyProtocol">
{{ privacyProtocol }}
</option>
</select>
</div>
</div>
<!-- Credentials -->
<fieldset>
<legend i18n>Credentials</legend>
<!-- snmp v2c snmp_community -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V2c'">
<label class="cd-col-form-label required"
for="snmp_community">
<span i18n>SNMP Community</span>
</label>
<div class="cd-col-form-input">
<input id="snmp_community"
class="form-control"
type="text"
formControlName="snmp_community">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_community', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- snmp v3 auth username -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3'">
<label class="cd-col-form-label required"
for="snmp_v3_auth_username">
<span i18n>Username</span>
</label>
<div class="cd-col-form-input">
<input id="snmp_v3_auth_username"
class="form-control"
type="text"
formControlName="snmp_v3_auth_username">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_v3_auth_username', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- snmp v3 auth password -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3'">
<label class="cd-col-form-label required"
for="snmp_v3_auth_password">
<span i18n>Password</span>
</label>
<div class="cd-col-form-input">
<input id="snmp_v3_auth_password"
class="form-control"
type="password"
formControlName="snmp_v3_auth_password">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_v3_auth_password', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<!-- snmp v3 priv password -->
<div class="form-group row"
*ngIf="serviceForm.controls.snmp_version.value === 'V3' && serviceForm.controls.privacy_protocol.value !== null && serviceForm.controls.privacy_protocol.value !== undefined">
<label class="cd-col-form-label required"
for="snmp_v3_priv_password">
<span i18n>Encryption</span>
</label>
<div class="cd-col-form-input">
<input id="snmp_v3_priv_password"
class="form-control"
type="password"
formControlName="snmp_v3_priv_password">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('snmp_v3_priv_password', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
</fieldset>
</ng-container>
<!-- RGW, Ingress & iSCSI -->
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress'].includes(serviceForm.controls.service_type.value)">
<!-- ssl -->
<div class="form-group row">
<div class="cd-col-form-offset">
<div class="custom-control custom-checkbox">
<input class="custom-control-input"
id="ssl"
type="checkbox"
formControlName="ssl">
<label class="custom-control-label"
for="ssl"
i18n>SSL</label>
</div>
</div>
</div>
<!-- ssl_cert -->
<div *ngIf="serviceForm.controls.ssl.value"
class="form-group row">
<label class="cd-col-form-label"
for="ssl_cert">
<span i18n>Certificate</span>
<cd-helper i18n>The SSL certificate in PEM format.</cd-helper>
</label>
<div class="cd-col-form-input">
<textarea id="ssl_cert"
class="form-control resize-vertical text-monospace text-pre"
formControlName="ssl_cert"
rows="5">
</textarea>
<input type="file"
(change)="fileUpload($event.target.files, 'ssl_cert')">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('ssl_cert', frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('ssl_cert', frm, 'pattern')"
i18n>Invalid SSL certificate.</span>
</div>
</div>
<!-- ssl_key -->
<div *ngIf="serviceForm.controls.ssl.value && !(['rgw', 'ingress'].includes(serviceForm.controls.service_type.value))"
class="form-group row">
<label class="cd-col-form-label"
for="ssl_key">
<span i18n>Private key</span>
<cd-helper i18n>The SSL private key in PEM format.</cd-helper>
</label>
<div class="cd-col-form-input">
<textarea id="ssl_key"
class="form-control resize-vertical text-monospace text-pre"
formControlName="ssl_key"
rows="5">
</textarea>
<input type="file"
(change)="fileUpload($event.target.files,'ssl_key')">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('ssl_key', frm, 'required')"
i18n>This field is required.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('ssl_key', frm, 'pattern')"
i18n>Invalid SSL private key.</span>
</div>
</div>
</ng-container>
<!-- Grafana -->
<ng-container *ngIf="serviceForm.controls.service_type.value === 'grafana'">
<div class="form-group row">
<label class="cd-col-form-label"
for="grafana_port">
<span i18n>Grafana Port</span>
<cd-helper>
<span i18n>The default port used by grafana.</span>
</cd-helper>
</label>
<div class="cd-col-form-input">
<input id="grafana_port"
class="form-control"
type="number"
formControlName="grafana_port"
min="1"
max="65535">
<span class="invalid-feedback"
*ngIf="serviceForm.showError('grafana_port', frm, 'pattern')"
i18n>The entered value needs to be a number.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('grafana_port', frm, 'min')"
i18n>The value must be at least 1.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('grafana_port', frm, 'max')"
i18n>The value cannot exceed 65535.</span>
<span class="invalid-feedback"
*ngIf="serviceForm.showError('grafana_port', frm, 'required')"
i18n>This field is required.</span>
</div>
</div>
<div class="form-group row">
<label i18n
class="cd-col-form-label"
for="grafana_admin_password">
<span>Grafana Password</span>
<cd-helper>The password of the default Grafana Admin. Set once on first-run.</cd-helper>
</label>
<div class="cd-col-form-input">
<div class="input-group">
<input id="grafana_admin_password"
class="form-control"
type="password"
autocomplete="new-password"
[attr.disabled]="editing ? true:null"
formControlName="grafana_admin_password">
<span class="input-group-append">
<button type="button"
class="btn btn-light"
cdPasswordButton="grafana_admin_password">
</button>
<cd-copy-2-clipboard-button source="grafana_admin_password">
</cd-copy-2-clipboard-button>
</span>
</div>
</div>
</div>
</ng-container>
</div>
<div class="modal-footer">
<div class="text-right">
<cd-form-button-panel (submitActionEvent)="onSubmit()"
[form]="serviceForm"
[submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>
</div>
</div>
</form>
</ng-container>
</cd-modal>