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