@ -36,16 +36,16 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
} ;
} ;
} ;
} ;
const mediumWidth = 20 ;
const WIDTH_SHORT = 15 ;
const shortWidth = 15 ;
const WIDTH_MEDIUM = 22 ;
const longWidth = 40 ;
const WIDTH_LONG = 40 ;
return (
return (
< >
< >
< FieldSet label = "MySQL Connection" width = { 400 } >
< FieldSet label = "MySQL Connection" width = { 400 } >
< InlineField labelWidth = { shortWidth } label = "Host" >
< InlineField labelWidth = { WIDTH_SHORT } label = "Host" >
< Input
< Input
width = { longWidth }
width = { WIDTH_LONG }
name = "host"
name = "host"
type = "text"
type = "text"
value = { options . url || '' }
value = { options . url || '' }
@ -53,9 +53,9 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
onChange = { onDSOptionChanged ( 'url' ) }
onChange = { onDSOptionChanged ( 'url' ) }
> < / Input >
> < / Input >
< / InlineField >
< / InlineField >
< InlineField labelWidth = { shortWidth } label = "Database" >
< InlineField labelWidth = { WIDTH_SHORT } label = "Database" >
< Input
< Input
width = { longWidth }
width = { WIDTH_LONG }
name = "database"
name = "database"
value = { jsonData . database || '' }
value = { jsonData . database || '' }
placeholder = "database name"
placeholder = "database name"
@ -63,17 +63,17 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
> < / Input >
> < / Input >
< / InlineField >
< / InlineField >
< InlineFieldRow >
< InlineFieldRow >
< InlineField labelWidth = { shortWidth } label = "User" >
< InlineField labelWidth = { WIDTH_SHORT } label = "User" >
< Input
< Input
width = { shortWidth }
width = { WIDTH_SHORT }
value = { options . user || '' }
value = { options . user || '' }
placeholder = "user"
placeholder = "user"
onChange = { onDSOptionChanged ( 'user' ) }
onChange = { onDSOptionChanged ( 'user' ) }
> < / Input >
> < / Input >
< / InlineField >
< / InlineField >
< InlineField labelWidth = { shortWidth - 5 } label = "Password" >
< InlineField labelWidth = { WIDTH_SHORT - 5 } label = "Password" >
< SecretInput
< SecretInput
width = { shortWidth }
width = { WIDTH_SHORT }
placeholder = "Password"
placeholder = "Password"
isConfigured = { options . secureJsonFields && options . secureJsonFields . password }
isConfigured = { options . secureJsonFields && options . secureJsonFields . password }
onReset = { onResetPassword }
onReset = { onResetPassword }
@ -92,17 +92,22 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
< / span >
< / span >
}
}
label = "Session timezone"
label = "Session timezone"
labelWidth = { mediumWidth }
labelWidth = { WIDTH_MEDIUM }
>
>
< Input
< Input
width = { longWidth - 5 }
width = { WIDTH_LONG - 5 }
value = { jsonData . timezone || '' }
value = { jsonData . timezone || '' }
onChange = { onUpdateDatasourceJsonDataOption ( props , 'timezone' ) }
onChange = { onUpdateDatasourceJsonDataOption ( props , 'timezone' ) }
placeholder = "(default)"
placeholder = "(default)"
> < / Input >
> < / Input >
< / InlineField >
< / InlineField >
< InlineFieldRow >
< InlineFieldRow >
< InlineField labelWidth = { mediumWidth } htmlFor = "tlsAuth" label = "TLS Client Auth" >
< InlineField
labelWidth = { WIDTH_MEDIUM }
tooltip = "Enables TLS authentication using client cert configured in secure json data."
htmlFor = "tlsAuth"
label = "Use TLS Client Auth"
>
< InlineSwitch
< InlineSwitch
id = "tlsAuth"
id = "tlsAuth"
onChange = { onSwitchChanged ( 'tlsAuth' ) }
onChange = { onSwitchChanged ( 'tlsAuth' ) }
@ -110,8 +115,8 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
> < / InlineSwitch >
> < / InlineSwitch >
< / InlineField >
< / InlineField >
< InlineField
< InlineField
labelWidth = { mediumWidth }
labelWidth = { WIDTH_MEDIUM }
tooltip = "Needed for verifing self-signed TLS Certs"
tooltip = "Needed for verifing self-signed TLS Certs. "
htmlFor = "tlsCaCert"
htmlFor = "tlsCaCert"
label = "With CA Cert"
label = "With CA Cert"
>
>
@ -122,7 +127,12 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
> < / InlineSwitch >
> < / InlineSwitch >
< / InlineField >
< / InlineField >
< / InlineFieldRow >
< / InlineFieldRow >
< InlineField labelWidth = { mediumWidth } htmlFor = "skipTLSVerify" label = "Skip TLS Verify" >
< InlineField
labelWidth = { WIDTH_MEDIUM }
tooltip = "When enabled, skips verification of the MySql server's TLS certificate chain and host name."
htmlFor = "skipTLSVerify"
label = "Skip TLS Verification"
>
< InlineSwitch
< InlineSwitch
id = "skipTLSVerify"
id = "skipTLSVerify"
onChange = { onSwitchChanged ( 'tlsSkipVerify' ) }
onChange = { onSwitchChanged ( 'tlsSkipVerify' ) }
@ -143,7 +153,7 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
) : null }
) : null }
< ConnectionLimits
< ConnectionLimits
labelWidth = { shortWidth }
labelWidth = { WIDTH_SHORT }
jsonData = { jsonData }
jsonData = { jsonData }
onPropertyChanged = { ( property , value ) = > {
onPropertyChanged = { ( property , value ) = > {
updateDatasourcePluginJsonDataOption ( props , property , value ) ;
updateDatasourcePluginJsonDataOption ( props , property , value ) ;
@ -158,7 +168,7 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps<My
< code > 1 m < / code > if your data is written every minute .
< code > 1 m < / code > if your data is written every minute .
< / span >
< / span >
}
}
labelWidth = { mediumWidth }
labelWidth = { WIDTH_MEDIUM }
label = "Min time interval"
label = "Min time interval"
>
>
< Input
< Input