|
|
|
@ -43,7 +43,7 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan
|
|
|
|
|
const refId = queries[0].refId; |
|
|
|
|
const rawSql = queries[0].rawSql; |
|
|
|
|
const uid = queries[0].datasource.uid; |
|
|
|
|
|
|
|
|
|
// TODO: it works only with sql (rawSql will be empty in prometheus)
|
|
|
|
|
const isDatasourceExist = _.some( |
|
|
|
|
datasources, |
|
|
|
|
(ds: DatasourceTableRowConfig) => |
|
|
|
@ -52,7 +52,6 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan
|
|
|
|
|
if (isDatasourceExist) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const newConfig = createDatasourceConfig({ datasource, refId, rawSql, uid }, timestampRange); |
|
|
|
|
setDatasources([...datasources, newConfig]); |
|
|
|
|
}, |
|
|
|
|