import React from 'react'; import { DataSourceJsonData, DataSourcePluginOptionsEditorProps, KeyValue, onUpdateDatasourceSecureJsonDataOption, updateDatasourcePluginResetOption, } from '@grafana/data'; import { InlineField, SecretTextArea } from '@grafana/ui'; export interface Props { editorProps: DataSourcePluginOptionsEditorProps; showCACert?: boolean; secureJsonFields?: KeyValue; labelWidth?: number; } export const TLSSecretsConfig = (props: Props) => { const { labelWidth, editorProps, showCACert } = props; const { secureJsonFields } = editorProps.options; return ( <> To authenticate with an TLS/SSL client certificate, provide the client certificate here.} labelWidth={labelWidth} label="TLS/SSL Client Certificate" > { updateDatasourcePluginResetOption(editorProps, 'tlsClientCert'); }} > {showCACert ? ( If the selected TLS/SSL mode requires a server root certificate, provide it here.} labelWidth={labelWidth} label="TLS/SSL Root Certificate" > { updateDatasourcePluginResetOption(editorProps, 'tlsCACert'); }} > ) : null} To authenticate with a client TLS/SSL certificate, provide the key here.} labelWidth={labelWidth} label="TLS/SSL Client Key" > { updateDatasourcePluginResetOption(editorProps, 'tlsClientKey'); }} > ); };