mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
enable goto explore from query panel editor for all datasources
This commit is contained in:
parent
3efaf52049
commit
18b39967fc
@ -57,12 +57,19 @@ export async function getExploreUrl(
|
||||
}
|
||||
}
|
||||
|
||||
if (exploreDatasource && exploreDatasource.meta.explore) {
|
||||
if (panelDatasource) {
|
||||
const range = timeSrv.timeRangeForUrl();
|
||||
const state = {
|
||||
...exploreDatasource.getExploreState(exploreTargets),
|
||||
range,
|
||||
let state: Partial<ExploreUrlState> = { range };
|
||||
if (exploreDatasource.getExploreState) {
|
||||
state = { ...state, ...exploreDatasource.getExploreState(exploreTargets) };
|
||||
} else {
|
||||
state = {
|
||||
...state,
|
||||
datasource: panelDatasource.name,
|
||||
queries: exploreTargets.map(t => ({ ...t, datasource: panelDatasource.name })),
|
||||
};
|
||||
}
|
||||
|
||||
const exploreState = JSON.stringify(state);
|
||||
url = renderUrl('/explore', { state: exploreState });
|
||||
}
|
||||
|
@ -233,12 +233,7 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
|
||||
getAdditionalMenuItems() {
|
||||
const items = [];
|
||||
if (
|
||||
config.exploreEnabled &&
|
||||
this.contextSrv.isEditor &&
|
||||
this.datasource &&
|
||||
(this.datasource.meta.explore || this.datasource.meta.id === 'mixed')
|
||||
) {
|
||||
if (config.exploreEnabled && this.contextSrv.isEditor && this.datasource) {
|
||||
items.push({
|
||||
text: 'Explore',
|
||||
click: 'ctrl.explore();',
|
||||
|
Loading…
Reference in New Issue
Block a user