1212 < input type = "checkbox" id = "node-config-input-tls" style = "display:inline-block; width:auto; vertical-align:top;" >
1313 < label for = "node-config-input-tls" style = "width:auto !important;" > Encrypt connection to database</ label >
1414 </ div >
15+ < div class = "form-row" >
16+ < label for = "node-config-input-rejectUnauthorized" > </ label >
17+ < input type = "checkbox" id = "node-config-input-rejectUnauthorized"
18+ style = "display:inline-block; width:auto; vertical-align:top;" >
19+ < label for = "node-config-input-rejectUnauthorized" style = "width:auto !important;" > Verify certificate
20+ (recommended)</ label >
21+ </ div >
22+ < div class = "form-row" >
23+ < label for = "node-config-input-caCertificate" > < i class = "fa fa-certificate" > </ i > CA-Cert.</ label >
24+ < input type = "text" id = "node-config-input-caCertificate" >
25+ </ div >
26+ < div class = "form-row" >
27+ < label for = "node-config-input-cert" > < i class = "fa fa-certificate" > </ i > Cert</ label >
28+ < input type = "text" id = "node-config-input-cert" >
29+ </ div >
30+ < div class = "form-row" >
31+ < label for = "node-config-input-key" > < i class = "fa fa-key" > </ i > Key</ label >
32+ < input type = "text" id = "node-config-input-key" >
33+ </ div >
1534 < div class = "form-row" >
1635 < label for = "node-config-input-user" > < i class = "fa fa-user" > </ i > User</ label >
1736 < input type = "text" id = "node-config-input-user" >
4968 value : true ,
5069 required : true
5170 } ,
71+ rejectUnauthorized : {
72+ value : true ,
73+ required : true
74+ } ,
75+ caCertificate : {
76+ value : "" ,
77+ required : false
78+ } ,
79+ cert : {
80+ value : "" ,
81+ required : false
82+ } ,
83+ key : {
84+ value : "" ,
85+ required : false
86+ } ,
5287 database : {
5388 value : "" ,
5489 required : true
65100 // Note: label (and probably labelStyle) have to be a classical function (not an arrow function)
66101 label : function ( ) {
67102 return this . name || this . database
103+ } ,
104+ oneditprepare : function ( ) {
105+ function toggleTlsFields ( show ) {
106+ $ ( "#node-config-input-caCertificate" ) . closest ( 'div' ) . toggle ( show ) ;
107+ $ ( "#node-config-input-cert" ) . closest ( 'div' ) . toggle ( show ) ;
108+ $ ( "#node-config-input-key" ) . closest ( 'div' ) . toggle ( show ) ;
109+ $ ( "#node-config-input-rejectUnauthorized" ) . closest ( 'div' ) . toggle ( show ) ;
110+ }
111+
112+ const tlsCheckbox = $ ( "#node-config-input-tls" ) ;
113+ tlsCheckbox . on ( 'change' , function ( ) {
114+ toggleTlsFields ( this . checked ) ;
115+ } ) ;
116+
117+ toggleTlsFields ( tlsCheckbox . prop ( 'checked' ) ) ;
68118 }
69119 } ) ;
70120</ script >
@@ -162,4 +212,4 @@ <h3>References</h3>
162212 return this . name ? 'node_label_italic' : ''
163213 }
164214 } ) ;
165- </ script >
215+ </ script >
0 commit comments