mirror of https://github.com/grafana/grafana
Plugins: add UI for more supported datasources with secure socks proxy feature toggle (#61962)
parent
0c8a2bbfd5
commit
0a1f31814a
@ -0,0 +1,45 @@ |
||||
import React from 'react'; |
||||
|
||||
import { DataSourceJsonData, DataSourcePluginOptionsEditorProps } from '@grafana/data'; |
||||
|
||||
import { InlineSwitch } from '../../components/Switch/Switch'; |
||||
import { InlineField } from '../Forms/InlineField'; |
||||
|
||||
export interface Props<T extends DataSourceJsonData> |
||||
extends Pick<DataSourcePluginOptionsEditorProps<T>, 'options' | 'onOptionsChange'> {} |
||||
|
||||
export interface SecureSocksProxyConfig extends DataSourceJsonData { |
||||
enableSecureSocksProxy?: boolean; |
||||
} |
||||
|
||||
export function SecureSocksProxySettings<T extends SecureSocksProxyConfig>({ |
||||
options, |
||||
onOptionsChange, |
||||
}: Props<T>): JSX.Element { |
||||
return ( |
||||
<> |
||||
<h3 className="page-heading">Secure Socks Proxy</h3> |
||||
<div className="gf-form-group"> |
||||
<div className="gf-form-inline"> |
||||
<div className="gf-form"> |
||||
<InlineField |
||||
labelWidth={26} |
||||
label="Enabled" |
||||
tooltip="Connect to this datasource via the secure socks proxy." |
||||
> |
||||
<InlineSwitch |
||||
value={options.jsonData.enableSecureSocksProxy ?? false} |
||||
onChange={(event) => |
||||
onOptionsChange({ |
||||
...options, |
||||
jsonData: { ...options.jsonData, enableSecureSocksProxy: event!.currentTarget.checked }, |
||||
}) |
||||
} |
||||
/> |
||||
</InlineField> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</> |
||||
); |
||||
} |
Loading…
Reference in new issue