|
@@ -2,6 +2,7 @@ import './dashboard_loaders';
|
|
|
import './ReactContainer';
|
|
import './ReactContainer';
|
|
|
import { applyRouteRegistrationHandlers } from './registry';
|
|
import { applyRouteRegistrationHandlers } from './registry';
|
|
|
|
|
|
|
|
|
|
+// Pages
|
|
|
import ServerStats from 'app/features/admin/ServerStats';
|
|
import ServerStats from 'app/features/admin/ServerStats';
|
|
|
import AlertRuleList from 'app/features/alerting/AlertRuleList';
|
|
import AlertRuleList from 'app/features/alerting/AlertRuleList';
|
|
|
import TeamPages from 'app/features/teams/TeamPages';
|
|
import TeamPages from 'app/features/teams/TeamPages';
|
|
@@ -23,6 +24,9 @@ import SoloPanelPage from '../features/dashboard/containers/SoloPanelPage';
|
|
|
import DashboardPage from '../features/dashboard/containers/DashboardPage';
|
|
import DashboardPage from '../features/dashboard/containers/DashboardPage';
|
|
|
import config from 'app/core/config';
|
|
import config from 'app/core/config';
|
|
|
|
|
|
|
|
|
|
+// Types
|
|
|
|
|
+import { DashboardRouteInfo } from 'app/types';
|
|
|
|
|
+
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
|
export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
$locationProvider.html5Mode(true);
|
|
$locationProvider.html5Mode(true);
|
|
@@ -31,6 +35,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/', {
|
|
.when('/', {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'page-dashboard',
|
|
pageClass: 'page-dashboard',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Home,
|
|
|
reloadOnSearch: false,
|
|
reloadOnSearch: false,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => DashboardPage,
|
|
component: () => DashboardPage,
|
|
@@ -39,6 +44,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/d/:uid/:slug', {
|
|
.when('/d/:uid/:slug', {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'page-dashboard',
|
|
pageClass: 'page-dashboard',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Normal,
|
|
|
reloadOnSearch: false,
|
|
reloadOnSearch: false,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => DashboardPage,
|
|
component: () => DashboardPage,
|
|
@@ -48,6 +54,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'page-dashboard',
|
|
pageClass: 'page-dashboard',
|
|
|
reloadOnSearch: false,
|
|
reloadOnSearch: false,
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Normal,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => DashboardPage,
|
|
component: () => DashboardPage,
|
|
|
},
|
|
},
|
|
@@ -55,6 +62,16 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/dashboard/:type/:slug', {
|
|
.when('/dashboard/:type/:slug', {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'page-dashboard',
|
|
pageClass: 'page-dashboard',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Old,
|
|
|
|
|
+ reloadOnSearch: false,
|
|
|
|
|
+ resolve: {
|
|
|
|
|
+ component: () => DashboardPage,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ .when('/dashboard/new', {
|
|
|
|
|
+ template: '<react-container />',
|
|
|
|
|
+ pageClass: 'page-dashboard',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.New,
|
|
|
reloadOnSearch: false,
|
|
reloadOnSearch: false,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => DashboardPage,
|
|
component: () => DashboardPage,
|
|
@@ -63,6 +80,7 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/d-solo/:uid/:slug', {
|
|
.when('/d-solo/:uid/:slug', {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'dashboard-solo',
|
|
pageClass: 'dashboard-solo',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Normal,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => SoloPanelPage,
|
|
component: () => SoloPanelPage,
|
|
|
},
|
|
},
|
|
@@ -70,16 +88,11 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/dashboard-solo/:type/:slug', {
|
|
.when('/dashboard-solo/:type/:slug', {
|
|
|
template: '<react-container />',
|
|
template: '<react-container />',
|
|
|
pageClass: 'dashboard-solo',
|
|
pageClass: 'dashboard-solo',
|
|
|
|
|
+ routeInfo: DashboardRouteInfo.Old,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
component: () => SoloPanelPage,
|
|
component: () => SoloPanelPage,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
- .when('/dashboard/new', {
|
|
|
|
|
- templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
|
- controller: 'NewDashboardCtrl',
|
|
|
|
|
- reloadOnSearch: false,
|
|
|
|
|
- pageClass: 'page-dashboard',
|
|
|
|
|
- })
|
|
|
|
|
.when('/dashboard/import', {
|
|
.when('/dashboard/import', {
|
|
|
templateUrl: 'public/app/features/manage-dashboards/partials/dashboard_import.html',
|
|
templateUrl: 'public/app/features/manage-dashboards/partials/dashboard_import.html',
|
|
|
controller: DashboardImportCtrl,
|
|
controller: DashboardImportCtrl,
|