|
@@ -144,7 +144,7 @@ export function highlightLogsExpression(exploreId: ExploreId, expressions: strin
|
|
|
*/
|
|
*/
|
|
|
export function initializeExplore(
|
|
export function initializeExplore(
|
|
|
exploreId: ExploreId,
|
|
exploreId: ExploreId,
|
|
|
- datasource: string,
|
|
|
|
|
|
|
+ datasourceName: string,
|
|
|
queries: DataQuery[],
|
|
queries: DataQuery[],
|
|
|
range: RawTimeRange,
|
|
range: RawTimeRange,
|
|
|
containerWidth: number,
|
|
containerWidth: number,
|
|
@@ -164,7 +164,7 @@ export function initializeExplore(
|
|
|
payload: {
|
|
payload: {
|
|
|
exploreId,
|
|
exploreId,
|
|
|
containerWidth,
|
|
containerWidth,
|
|
|
- datasource,
|
|
|
|
|
|
|
+ datasourceName,
|
|
|
eventBridge,
|
|
eventBridge,
|
|
|
exploreDatasources,
|
|
exploreDatasources,
|
|
|
queries,
|
|
queries,
|
|
@@ -174,9 +174,9 @@ export function initializeExplore(
|
|
|
|
|
|
|
|
if (exploreDatasources.length >= 1) {
|
|
if (exploreDatasources.length >= 1) {
|
|
|
let instance;
|
|
let instance;
|
|
|
- if (datasource) {
|
|
|
|
|
|
|
+ if (datasourceName) {
|
|
|
try {
|
|
try {
|
|
|
- instance = await getDatasourceSrv().get(datasource);
|
|
|
|
|
|
|
+ instance = await getDatasourceSrv().get(datasourceName);
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
console.error(error);
|
|
|
}
|
|
}
|
|
@@ -185,6 +185,7 @@ export function initializeExplore(
|
|
|
if (!instance) {
|
|
if (!instance) {
|
|
|
instance = await getDatasourceSrv().get();
|
|
instance = await getDatasourceSrv().get();
|
|
|
}
|
|
}
|
|
|
|
|
+ dispatch(updateDatasourceInstance(exploreId, instance));
|
|
|
dispatch(loadDatasource(exploreId, instance));
|
|
dispatch(loadDatasource(exploreId, instance));
|
|
|
} else {
|
|
} else {
|
|
|
dispatch(loadDatasourceMissing(exploreId));
|
|
dispatch(loadDatasourceMissing(exploreId));
|
|
@@ -223,11 +224,11 @@ export const loadDatasourceMissing = (exploreId: ExploreId): LoadDatasourceMissi
|
|
|
/**
|
|
/**
|
|
|
* Start the async process of loading a datasource to display a loading indicator
|
|
* Start the async process of loading a datasource to display a loading indicator
|
|
|
*/
|
|
*/
|
|
|
-export const loadDatasourcePending = (exploreId: ExploreId, datasourceName: string): LoadDatasourcePendingAction => ({
|
|
|
|
|
|
|
+export const loadDatasourcePending = (exploreId: ExploreId, requestedDatasourceName: string): LoadDatasourcePendingAction => ({
|
|
|
type: ActionTypes.LoadDatasourcePending,
|
|
type: ActionTypes.LoadDatasourcePending,
|
|
|
payload: {
|
|
payload: {
|
|
|
exploreId,
|
|
exploreId,
|
|
|
- datasourceName,
|
|
|
|
|
|
|
+ requestedDatasourceName,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -260,7 +261,6 @@ export const loadDatasourceSuccess = (
|
|
|
StartPage,
|
|
StartPage,
|
|
|
datasourceInstance: instance,
|
|
datasourceInstance: instance,
|
|
|
history,
|
|
history,
|
|
|
- initialDatasource: instance.name,
|
|
|
|
|
initialQueries: queries,
|
|
initialQueries: queries,
|
|
|
showingStartPage: Boolean(StartPage),
|
|
showingStartPage: Boolean(StartPage),
|
|
|
supportsGraph,
|
|
supportsGraph,
|