mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
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:
@@ -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]);
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user