mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Take root_url setting into account when redirecting from dashboard to explore (#19447)
* Explore: Take root_url setting into account when redirecting from dashboard to explore * Explore: Move adding of subath to getExploreUrl function * Explore: Fix explore redirect for key bindings
This commit is contained in:
@@ -3,6 +3,7 @@ import _ from 'lodash';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { getExploreUrl } from 'app/core/utils/explore';
|
||||
import locationUtil from 'app/core/utils/location_util';
|
||||
import { store } from 'app/store/store';
|
||||
|
||||
import Mousetrap from 'mousetrap';
|
||||
@@ -220,8 +221,10 @@ export class KeybindingSrv {
|
||||
const panel = dashboard.getPanelById(dashboard.meta.focusPanelId);
|
||||
const datasource = await this.datasourceSrv.get(panel.datasource);
|
||||
const url = await getExploreUrl(panel, panel.targets, datasource, this.datasourceSrv, this.timeSrv);
|
||||
if (url) {
|
||||
this.$timeout(() => this.$location.url(url));
|
||||
const urlWithoutBase = locationUtil.stripBaseFromUrl(url);
|
||||
|
||||
if (urlWithoutBase) {
|
||||
this.$timeout(() => this.$location.url(urlWithoutBase));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -90,7 +90,8 @@ export async function getExploreUrl(
|
||||
const exploreState = JSON.stringify({ ...state, originPanelId: panel.id });
|
||||
url = renderUrl('/explore', { left: exploreState });
|
||||
}
|
||||
return url;
|
||||
const finalUrl = config.appSubUrl + url;
|
||||
return finalUrl;
|
||||
}
|
||||
|
||||
export function buildQueryTransaction(
|
||||
|
||||
Reference in New Issue
Block a user