The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/public/app/plugins/datasource/cloudwatch/components/ConfigEditor/SecureSocksProxySettingsNew...

34 lines
1.1 KiB

import React from 'react';
import { DataSourceJsonData, DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { ConfigSection } from '@grafana/experimental';
import { Field, Switch } from '@grafana/ui';
export interface Props<T extends DataSourceJsonData>
extends Pick<DataSourcePluginOptionsEditorProps<T>, 'options' | 'onOptionsChange'> {}
export interface SecureSocksProxyConfig extends DataSourceJsonData {
enableSecureSocksProxy?: boolean;
}
export function SecureSocksProxySettingsNewStyling<T extends SecureSocksProxyConfig>({
options,
onOptionsChange,
}: Props<T>): JSX.Element {
return (
<ConfigSection title="Secure Socks Proxy">
<Field label="Enabled" description="Connect to this datasource via the secure socks proxy.">
<Switch
value={options.jsonData.enableSecureSocksProxy ?? false}
onChange={(event) =>
onOptionsChange({
...options,
jsonData: { ...options.jsonData, enableSecureSocksProxy: event.currentTarget.checked },
})
}
/>
</Field>
</ConfigSection>
);
}