mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
MixedDatasource: fix datasource selection after edit (#41178)
This commit is contained in:
parent
85f2c48448
commit
d360e48174
@ -22,7 +22,6 @@ import {
|
|||||||
DataQuery,
|
DataQuery,
|
||||||
DataSourceApi,
|
DataSourceApi,
|
||||||
DataSourceInstanceSettings,
|
DataSourceInstanceSettings,
|
||||||
DataSourceRef,
|
|
||||||
getDefaultTimeRange,
|
getDefaultTimeRange,
|
||||||
LoadingState,
|
LoadingState,
|
||||||
PanelData,
|
PanelData,
|
||||||
@ -89,10 +88,10 @@ export class QueryGroup extends PureComponent<Props, State> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ds = await this.dataSourceSrv.get(options.dataSource.name);
|
const ds = await this.dataSourceSrv.get(options.dataSource);
|
||||||
const dsSettings = this.dataSourceSrv.getInstanceSettings(options.dataSource.name);
|
const dsSettings = this.dataSourceSrv.getInstanceSettings(options.dataSource);
|
||||||
const defaultDataSource = await this.dataSourceSrv.get();
|
const defaultDataSource = await this.dataSourceSrv.get();
|
||||||
const datasource: DataSourceRef = { type: ds.type, uid: ds.uid };
|
const datasource = ds.getRef();
|
||||||
const queries = options.queries.map((q) => (q.datasource ? q : { ...q, datasource }));
|
const queries = options.queries.map((q) => (q.datasource ? q : { ...q, datasource }));
|
||||||
this.setState({ queries, dataSource: ds, dsSettings, defaultDataSource });
|
this.setState({ queries, dataSource: ds, dsSettings, defaultDataSource });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user