Explore: time selector

* time selector for explore section
* mostly ported the angular time selector, but left out the timepicker
 (3rd-party angular component)
* can be initialised via url parameters (jump from panels to explore)
* refreshing not implemented for now
* moved the forward/backward nav buttons around the time selector
This commit is contained in:
David Kaltschmidt
2018-04-30 17:25:25 +02:00
parent 7a30f72902
commit 0d3f24ce54
8 changed files with 273 additions and 46 deletions

View File

@@ -324,7 +324,12 @@ class MetricsPanelCtrl extends PanelCtrl {
}
explore() {
const exploreState = encodePathComponent(JSON.stringify(this.datasource.getExploreState(this.panel)));
const range = this.timeSrv.timeRangeForUrl();
const state = {
...this.datasource.getExploreState(this.panel),
range,
};
const exploreState = encodePathComponent(JSON.stringify(state));
this.$location.url(`/explore/${exploreState}`);
}