Elasticsearch: Deprecate browser access mode (#29649)

* Elasticsearch: Show deprecation warning when selecting browser access mode

* Docs: Show deprecation warning for Elasticsearch Browser access mode
This commit is contained in:
Giordano Ricci 2020-12-09 13:27:40 +00:00 committed by GitHub
parent 58b63a1678
commit 7f0802a9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -35,6 +35,8 @@ All requests will be made from the browser to Grafana backend/server which in tu
### Browser (Direct) access
> **Warning:** Browser (Direct) access is deprecated and will be removed in a future release.
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.
If you select Browser access you must update your Elasticsearch configuration to allow other domains to access

View File

@ -1,5 +1,5 @@
import React, { useEffect } from 'react';
import { DataSourceHttpSettings } from '@grafana/ui';
import { Alert, DataSourceHttpSettings } from '@grafana/ui';
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { ElasticsearchOptions } from '../types';
import { defaultMaxConcurrentShardRequests, ElasticDetails } from './ElasticDetails';
@ -30,6 +30,12 @@ export const ConfigEditor = (props: Props) => {
return (
<>
{options.access === 'direct' && (
<Alert title="Deprecation Notice" severity="warning">
Browser access mode in the Elasticsearch datasource is deprecated and will be removed in a future release.
</Alert>
)}
<DataSourceHttpSettings
defaultUrl={'http://localhost:9200'}
dataSourceConfig={options}