mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: add UI toggle for additional datasources for secure socks proxy (#64934)
This commit is contained in:
parent
02a8f62021
commit
ae38501675
@ -2,7 +2,8 @@ import React, { PureComponent } from 'react';
|
|||||||
|
|
||||||
import { DataSourcePluginOptionsEditorProps, SelectableValue, updateDatasourcePluginOption } from '@grafana/data';
|
import { DataSourcePluginOptionsEditorProps, SelectableValue, updateDatasourcePluginOption } from '@grafana/data';
|
||||||
import { getBackendSrv, getTemplateSrv, isFetchError, TemplateSrv } from '@grafana/runtime';
|
import { getBackendSrv, getTemplateSrv, isFetchError, TemplateSrv } from '@grafana/runtime';
|
||||||
import { Alert } from '@grafana/ui';
|
import { Alert, SecureSocksProxySettings } from '@grafana/ui';
|
||||||
|
import { config } from 'app/core/config';
|
||||||
|
|
||||||
import ResponseParser from '../azure_monitor/response_parser';
|
import ResponseParser from '../azure_monitor/response_parser';
|
||||||
import { AzureDataSourceJsonData, AzureDataSourceSecureJsonData, AzureDataSourceSettings } from '../types';
|
import { AzureDataSourceJsonData, AzureDataSourceSecureJsonData, AzureDataSourceSettings } from '../types';
|
||||||
@ -84,7 +85,7 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { options } = this.props;
|
const { options, onOptionsChange } = this.props;
|
||||||
const { error } = this.state;
|
const { error } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -96,6 +97,9 @@ export class ConfigEditor extends PureComponent<Props, State> {
|
|||||||
{error.details && <details style={{ whiteSpace: 'pre-wrap' }}>{error.details}</details>}
|
{error.details && <details style={{ whiteSpace: 'pre-wrap' }}>{error.details}</details>}
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
|
{config.featureToggles.secureSocksDatasourceProxy && (
|
||||||
|
<SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ import React, { PureComponent } from 'react';
|
|||||||
|
|
||||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||||
import { ConnectionConfig } from '@grafana/google-sdk';
|
import { ConnectionConfig } from '@grafana/google-sdk';
|
||||||
|
import { SecureSocksProxySettings } from '@grafana/ui';
|
||||||
|
import { config } from 'app/core/config';
|
||||||
|
|
||||||
import { CloudMonitoringOptions, CloudMonitoringSecureJsonData } from '../../types';
|
import { CloudMonitoringOptions, CloudMonitoringSecureJsonData } from '../../types';
|
||||||
|
|
||||||
@ -9,9 +11,13 @@ export type Props = DataSourcePluginOptionsEditorProps<CloudMonitoringOptions, C
|
|||||||
|
|
||||||
export class ConfigEditor extends PureComponent<Props> {
|
export class ConfigEditor extends PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
|
const { options, onOptionsChange } = this.props;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ConnectionConfig {...this.props}></ConnectionConfig>
|
<ConnectionConfig {...this.props}></ConnectionConfig>
|
||||||
|
{config.featureToggles.secureSocksDatasourceProxy && (
|
||||||
|
<SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||||
import { DataSourceHttpSettings } from '@grafana/ui';
|
import { DataSourceHttpSettings, SecureSocksProxySettings } from '@grafana/ui';
|
||||||
|
import { config } from 'app/core/config';
|
||||||
|
|
||||||
import { ParcaDataSourceOptions } from './types';
|
import { ParcaDataSourceOptions } from './types';
|
||||||
|
|
||||||
@ -18,6 +19,9 @@ export const ConfigEditor = (props: Props) => {
|
|||||||
showAccessOptions={false}
|
showAccessOptions={false}
|
||||||
onChange={onOptionsChange}
|
onChange={onOptionsChange}
|
||||||
/>
|
/>
|
||||||
|
{config.featureToggles.secureSocksDatasourceProxy && (
|
||||||
|
<SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
||||||
import { DataSourceHttpSettings, EventsWithValidation, LegacyForms, regexValidation } from '@grafana/ui';
|
import {
|
||||||
|
DataSourceHttpSettings,
|
||||||
|
EventsWithValidation,
|
||||||
|
LegacyForms,
|
||||||
|
regexValidation,
|
||||||
|
SecureSocksProxySettings,
|
||||||
|
} from '@grafana/ui';
|
||||||
|
import { config } from 'app/core/config';
|
||||||
|
|
||||||
import { PhlareDataSourceOptions } from './types';
|
import { PhlareDataSourceOptions } from './types';
|
||||||
|
|
||||||
@ -19,6 +26,9 @@ export const ConfigEditor = (props: Props) => {
|
|||||||
onChange={onOptionsChange}
|
onChange={onOptionsChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{config.featureToggles.secureSocksDatasourceProxy && (
|
||||||
|
<SecureSocksProxySettings options={options} onOptionsChange={onOptionsChange} />
|
||||||
|
)}
|
||||||
<h3 className="page-heading">Querying</h3>
|
<h3 className="page-heading">Querying</h3>
|
||||||
<div className="gf-form-group">
|
<div className="gf-form-group">
|
||||||
<div className="gf-form-inline">
|
<div className="gf-form-inline">
|
||||||
|
Loading…
Reference in New Issue
Block a user