Commit 7f0802a9 by Giordano Ricci Committed by GitHub

Elasticsearch: Deprecate browser access mode (#29649)

* Elasticsearch: Show deprecation warning when selecting browser access mode

* Docs: Show deprecation warning for Elasticsearch Browser access mode
parent 58b63a16
...@@ -35,6 +35,8 @@ All requests will be made from the browser to Grafana backend/server which in tu ...@@ -35,6 +35,8 @@ All requests will be made from the browser to Grafana backend/server which in tu
### Browser (Direct) access ### 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. 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 If you select Browser access you must update your Elasticsearch configuration to allow other domains to access
......
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { DataSourceHttpSettings } from '@grafana/ui'; import { Alert, DataSourceHttpSettings } from '@grafana/ui';
import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { ElasticsearchOptions } from '../types'; import { ElasticsearchOptions } from '../types';
import { defaultMaxConcurrentShardRequests, ElasticDetails } from './ElasticDetails'; import { defaultMaxConcurrentShardRequests, ElasticDetails } from './ElasticDetails';
...@@ -30,6 +30,12 @@ export const ConfigEditor = (props: Props) => { ...@@ -30,6 +30,12 @@ export const ConfigEditor = (props: Props) => {
return ( 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 <DataSourceHttpSettings
defaultUrl={'http://localhost:9200'} defaultUrl={'http://localhost:9200'}
dataSourceConfig={options} dataSourceConfig={options}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment