Explore WIP

This commit is contained in:
David Kaltschmidt
2018-04-26 20:27:19 +02:00
parent 1dd4f03100
commit f1220fd2a4
31 changed files with 3685 additions and 1613 deletions
+7 -3
View File
@@ -1,8 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'mobx-react';
import coreModule from 'app/core/core_module';
import { store } from 'app/stores/store';
import { Provider } from 'mobx-react';
import { BackendSrv } from 'app/core/services/backend_srv';
import { DatasourceSrv } from 'app/features/plugins/datasource_srv';
function WrapInProvider(store, Component, props) {
return (
@@ -13,14 +16,15 @@ function WrapInProvider(store, Component, props) {
}
/** @ngInject */
export function reactContainer($route, $location, backendSrv) {
export function reactContainer($route, $location, backendSrv: BackendSrv, datasourceSrv: DatasourceSrv) {
return {
restrict: 'E',
template: '',
link(scope, elem) {
let component = $route.current.locals.component;
let component = $route.current.locals.component.default;
let props = {
backendSrv: backendSrv,
datasourceSrv: datasourceSrv,
};
ReactDOM.render(WrapInProvider(store, component, props), elem[0]);
+8
View File
@@ -1,7 +1,9 @@
import './dashboard_loaders';
import './ReactContainer';
import ServerStats from 'app/containers/ServerStats/ServerStats';
import AlertRuleList from 'app/containers/AlertRuleList/AlertRuleList';
// import Explore from 'app/containers/Explore/Explore';
import FolderSettings from 'app/containers/ManageDashboards/FolderSettings';
import FolderPermissions from 'app/containers/ManageDashboards/FolderPermissions';
@@ -109,6 +111,12 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
controller: 'FolderDashboardsCtrl',
controllerAs: 'ctrl',
})
.when('/explore', {
template: '<react-container />',
resolve: {
component: () => import(/* webpackChunkName: "explore" */ 'app/containers/Explore/Explore'),
},
})
.when('/org', {
templateUrl: 'public/app/features/org/partials/orgDetails.html',
controller: 'OrgDetailsCtrl',