@@ -8,10 +8,6 @@ import {
8
8
Input ,
9
9
RadioButtonGroup ,
10
10
SecretInput ,
11
- FileUpload ,
12
- FileDropzone ,
13
- InlineLabel ,
14
- Label ,
15
11
Checkbox ,
16
12
} from '@grafana/ui' ;
17
13
import { DataSourcePluginOptionsEditorProps , SelectableValue } from '@grafana/data' ;
@@ -22,7 +18,7 @@ import {
22
18
ConnectionStringScheme ,
23
19
} from '../types' ;
24
20
25
- interface Props extends DataSourcePluginOptionsEditorProps < MongoDataSourceOptions , MongoDataSourceSecureJsonData > { }
21
+ interface Props extends DataSourcePluginOptionsEditorProps < MongoDataSourceOptions , MongoDataSourceSecureJsonData > { }
26
22
27
23
const mongoDBAuthMethods : SelectableValue [ ] = [
28
24
{ label : 'None' , value : MongoDBAuthMethod . NONE } ,
@@ -231,10 +227,50 @@ export function ConfigEditor(props: Props) {
231
227
232
228
{ jsonData . authType === MongoDBAuthMethod . TLS_SSL && (
233
229
< >
234
- < Label > Certificate Authority (.pem)</ Label >
235
- < FileDropzone options = { { multiple : false } } onLoad = { ( result ) => console . log ( result ) } />
236
- < Label > Client Certificate and Key (.pem)</ Label >
237
- < FileDropzone options = { { multiple : false } } onLoad = { ( result ) => console . log ( result ) } />
230
+ < Field label = "Certificate Authority" >
231
+ < Input
232
+ required
233
+ id = "config-editor-tls-ca"
234
+ value = { jsonData . caCertPath }
235
+ onChange = { ( evt : ChangeEvent < HTMLInputElement > ) => onOptionsChange ( {
236
+ ...options ,
237
+ jsonData : {
238
+ ...jsonData ,
239
+ caCertPath : evt . target . value ,
240
+ } ,
241
+ } ) }
242
+
243
+ > </ Input >
244
+ </ Field >
245
+ < Field label = "Client Certificate" description = "Path to public client certificate (.pem)" >
246
+ < Input
247
+ required
248
+ id = "config-editor-tls-cc"
249
+ value = { jsonData . clientCertPath }
250
+ onChange = { ( evt : ChangeEvent < HTMLInputElement > ) => onOptionsChange ( {
251
+ ...options ,
252
+ jsonData : {
253
+ ...jsonData ,
254
+ clientCertPath : evt . target . value ,
255
+ } ,
256
+ } ) }
257
+
258
+ > </ Input >
259
+ </ Field >
260
+ < Field label = "Client Key" description = "Path to private client key (.pem)" >
261
+ < Input
262
+ required
263
+ id = "config-editor-tls-ck"
264
+ value = { jsonData . clientKeyPath }
265
+ onChange = { ( evt : ChangeEvent < HTMLInputElement > ) => onOptionsChange ( {
266
+ ...options ,
267
+ jsonData : {
268
+ ...jsonData ,
269
+ clientKeyPath : evt . target . value ,
270
+ } ,
271
+ } ) }
272
+ > </ Input >
273
+ </ Field >
238
274
< Field label = "Client Key Password" >
239
275
< SecretInput
240
276
required
@@ -286,7 +322,8 @@ export function ConfigEditor(props: Props) {
286
322
description = "Disable the validation of the server certificates."
287
323
/>
288
324
</ >
289
- ) }
325
+ )
326
+ }
290
327
</ >
291
328
) ;
292
329
}
0 commit comments