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:
Ivana Huckova
2019-09-27 10:17:07 +02:00
committed by David
parent 234a2c599d
commit 40fbea977e
4 changed files with 10 additions and 10 deletions

View File

@@ -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));
}
}
});

View File

@@ -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(