Explore: Add entry to panel menu to jump to Explore

* panel container menu gets new Explore entry (between Edit and Share)
* entry only shows if datasource has `supportsExplore` set to true (set
 for Prometheus only for now)
* click on Explore entry changes url to `/explore/state` via location provider
* `state` is a JSON representation of the panel queries
* datasources implement `getExploreState()` how to turn a panel config into explore initial
 state
* Explore can parse the state and initialize its query expressions
* ReactContainer now forwards route parameters as props to component
* `pluginlist` and `singlestat` panel subclasses needed to be adapted because
 `panel_ctrl` now has the location provider as a property already
This commit is contained in:
David Kaltschmidt
2018-04-30 17:44:28 +02:00
parent 0fc4da810f
commit 05b0bfafe4
8 changed files with 63 additions and 9 deletions
+1
View File
@@ -29,6 +29,7 @@ export function reactContainer($route, $location, backendSrv: BackendSrv, dataso
const props = {
backendSrv: backendSrv,
datasourceSrv: datasourceSrv,
routeParams: $route.current.params,
};
ReactDOM.render(WrapInProvider(store, component, props), elem[0]);
+1 -1
View File
@@ -111,7 +111,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
controller: 'FolderDashboardsCtrl',
controllerAs: 'ctrl',
})
.when('/explore', {
.when('/explore/:initial?', {
template: '<react-container />',
resolve: {
component: () => import(/* webpackChunkName: "explore" */ 'app/containers/Explore/Explore'),