Hotkeys: Make time range permanent (#43802)

Typing `t a` in Explore or Dashboards will turn a relative time like "Last 1 hour"
into an absolute range to make the URL permanent, so that when sharing it others
will see the same data.

- registered `t a` in key service
- new `AbsoluteTimeEvent` dispatch via global event bus
- dashboard times handled in TimeSrv
- Explore times handled in Explore.tsx and Explore's time reducer

I could not find an easy way to combine time handling for Exlore and Dashboard in one place.
This commit is contained in:
David
2022-01-07 16:51:29 +01:00
committed by GitHub
parent 79d10c6903
commit a08e0581de
7 changed files with 72 additions and 2 deletions

View File

@@ -144,6 +144,10 @@ export class ShiftTimeEvent extends BusEventWithPayload<ShiftTimeEventPayload> {
static type = 'shift-time';
}
export class AbsoluteTimeEvent extends BusEventBase {
static type = 'absolute-time';
}
export class RemovePanelEvent extends BusEventWithPayload<number> {
static type = 'remove-panel';
}