mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 13:09:22 -06:00
Dashboards: Fixes view & edit keyboard shortcuts when grafana is behind a subpath (#93955)
DashboardScene: Fixes view & edit keyboard shortcuts when grafana is behind a subpath
This commit is contained in:
parent
e6c962e37c
commit
1c14c85b97
@ -1,4 +1,4 @@
|
||||
import { SetPanelAttentionEvent } from '@grafana/data';
|
||||
import { locationUtil, SetPanelAttentionEvent } from '@grafana/data';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { sceneGraph, VizPanel } from '@grafana/scenes';
|
||||
import appEvents from 'app/core/app_events';
|
||||
@ -43,7 +43,8 @@ export function setupKeyboardShortcuts(scene: DashboardScene) {
|
||||
key: 'v',
|
||||
onTrigger: withFocusedPanel(scene, (vizPanel: VizPanel) => {
|
||||
if (!scene.state.viewPanelScene) {
|
||||
locationService.push(getViewPanelUrl(vizPanel));
|
||||
const url = locationUtil.stripBaseFromUrl(getViewPanelUrl(vizPanel));
|
||||
locationService.push(url);
|
||||
}
|
||||
}),
|
||||
});
|
||||
@ -173,7 +174,8 @@ export function setupKeyboardShortcuts(scene: DashboardScene) {
|
||||
if (sceneRoot instanceof DashboardScene) {
|
||||
const panelId = getPanelIdForVizPanel(vizPanel);
|
||||
if (!scene.state.editPanel) {
|
||||
locationService.push(getEditPanelUrl(panelId));
|
||||
const url = locationUtil.stripBaseFromUrl(getEditPanelUrl(panelId));
|
||||
locationService.push(url);
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user