mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: add UI for more supported datasources with secure socks proxy feature toggle (#61962)
This commit is contained in:
committed by
GitHub
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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -185,6 +185,7 @@ export {
|
||||
export { ErrorWithStack } from './ErrorBoundary/ErrorWithStack';
|
||||
export { DataSourceHttpSettings } from './DataSourceSettings/DataSourceHttpSettings';
|
||||
export { AlertingSettings } from './DataSourceSettings/AlertingSettings';
|
||||
export { SecureSocksProxySettings } from './DataSourceSettings/SecureSocksProxySettings';
|
||||
export { TLSAuthSettings } from './DataSourceSettings/TLSAuthSettings';
|
||||
export { CertificationKey } from './DataSourceSettings/CertificationKey';
|
||||
export { Spinner } from './Spinner/Spinner';
|
||||
|
||||
Reference in New Issue
Block a user