2017-12-20 05:33:33 -06:00
|
|
|
import './dashboard_loaders';
|
2017-12-21 04:56:45 -06:00
|
|
|
import './ReactContainer';
|
2018-04-26 04:58:42 -05:00
|
|
|
|
2018-09-07 10:55:38 -05:00
|
|
|
import ServerStats from 'app/features/admin/ServerStats';
|
2018-09-02 09:11:21 -05:00
|
|
|
import AlertRuleList from 'app/features/alerting/AlertRuleList';
|
2018-04-18 08:01:36 -05:00
|
|
|
import FolderPermissions from 'app/containers/ManageDashboards/FolderPermissions';
|
2018-09-10 06:38:45 -05:00
|
|
|
import FolderSettings from 'app/containers/ManageDashboards/FolderSettings';
|
2018-07-11 13:23:07 -05:00
|
|
|
import TeamPages from 'app/containers/Teams/TeamPages';
|
|
|
|
import TeamList from 'app/containers/Teams/TeamList';
|
2016-02-09 04:17:49 -06:00
|
|
|
|
2018-08-31 09:40:43 -05:00
|
|
|
/** @ngInject */
|
2017-12-21 04:56:45 -06:00
|
|
|
export function setupAngularRoutes($routeProvider, $locationProvider) {
|
2016-02-09 04:17:49 -06:00
|
|
|
$locationProvider.html5Mode(true);
|
|
|
|
|
|
|
|
$routeProvider
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/', {
|
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
controller: 'LoadDashboardCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
reloadOnSearch: false,
|
2017-12-20 05:33:33 -06:00
|
|
|
pageClass: 'page-dashboard',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2018-01-30 17:26:26 -06:00
|
|
|
.when('/d/:uid/:slug', {
|
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
controller: 'LoadDashboardCtrl',
|
|
|
|
reloadOnSearch: false,
|
|
|
|
pageClass: 'page-dashboard',
|
|
|
|
})
|
2018-03-13 15:06:25 -05:00
|
|
|
.when('/d/:uid', {
|
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
controller: 'LoadDashboardCtrl',
|
|
|
|
reloadOnSearch: false,
|
|
|
|
pageClass: 'page-dashboard',
|
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/dashboard/:type/:slug', {
|
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
controller: 'LoadDashboardCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
reloadOnSearch: false,
|
2018-01-31 04:01:01 -06:00
|
|
|
pageClass: 'page-dashboard',
|
|
|
|
})
|
|
|
|
.when('/d-solo/:uid/:slug', {
|
|
|
|
templateUrl: 'public/app/features/panel/partials/soloPanel.html',
|
|
|
|
controller: 'SoloPanelCtrl',
|
|
|
|
reloadOnSearch: false,
|
2017-12-20 05:33:33 -06:00
|
|
|
pageClass: 'page-dashboard',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/dashboard-solo/:type/:slug', {
|
|
|
|
templateUrl: 'public/app/features/panel/partials/soloPanel.html',
|
|
|
|
controller: 'SoloPanelCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
reloadOnSearch: false,
|
2017-12-20 05:33:33 -06:00
|
|
|
pageClass: 'page-dashboard',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/dashboard/new', {
|
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
|
|
controller: 'NewDashboardCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
reloadOnSearch: false,
|
2017-12-20 05:33:33 -06:00
|
|
|
pageClass: 'page-dashboard',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/dashboard/import', {
|
2017-12-21 01:39:31 -06:00
|
|
|
templateUrl: 'public/app/features/dashboard/partials/dashboard_import.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'DashboardImportCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/datasources', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/ds_list.html',
|
|
|
|
controller: 'DataSourcesCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/datasources/edit/:id', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/ds_edit.html',
|
|
|
|
controller: 'DataSourceEditCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2018-01-18 10:42:40 -06:00
|
|
|
.when('/datasources/edit/:id/dashboards', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/ds_dashboards.html',
|
2018-01-18 11:17:58 -06:00
|
|
|
controller: 'DataSourceDashboardsCtrl',
|
2017-12-20 05:33:33 -06:00
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/datasources/new', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/ds_edit.html',
|
|
|
|
controller: 'DataSourceEditCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/dashboards', {
|
2018-09-10 06:59:31 -05:00
|
|
|
templateUrl: 'public/app/features/manage-dashboards/partials/dashboard_list.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'DashboardListCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/dashboards/folder/new', {
|
|
|
|
templateUrl: 'public/app/features/dashboard/partials/create_folder.html',
|
|
|
|
controller: 'CreateFolderCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2018-01-31 10:15:00 -06:00
|
|
|
.when('/dashboards/f/:uid/:slug/permissions', {
|
2018-01-16 04:28:14 -06:00
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
|
|
|
component: () => FolderPermissions,
|
|
|
|
},
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2018-01-31 10:15:00 -06:00
|
|
|
.when('/dashboards/f/:uid/:slug/settings', {
|
2018-01-11 08:42:45 -06:00
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
|
|
|
component: () => FolderSettings,
|
|
|
|
},
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2018-01-31 10:15:00 -06:00
|
|
|
.when('/dashboards/f/:uid/:slug', {
|
2017-12-21 01:39:31 -06:00
|
|
|
templateUrl: 'public/app/features/dashboard/partials/folder_dashboards.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'FolderDashboardsCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2018-03-13 15:32:37 -05:00
|
|
|
.when('/dashboards/f/:uid', {
|
|
|
|
templateUrl: 'public/app/features/dashboard/partials/folder_dashboards.html',
|
|
|
|
controller: 'FolderDashboardsCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2018-07-17 05:56:05 -05:00
|
|
|
.when('/explore', {
|
2018-04-26 04:58:42 -05:00
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
2018-05-30 06:13:29 -05:00
|
|
|
roles: () => ['Editor', 'Admin'],
|
2018-05-15 10:07:38 -05:00
|
|
|
component: () => import(/* webpackChunkName: "explore" */ 'app/containers/Explore/Wrapper'),
|
2018-04-26 04:58:42 -05:00
|
|
|
},
|
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/org', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/orgDetails.html',
|
|
|
|
controller: 'OrgDetailsCtrl',
|
|
|
|
})
|
|
|
|
.when('/org/new', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/newOrg.html',
|
|
|
|
controller: 'NewOrgCtrl',
|
|
|
|
})
|
|
|
|
.when('/org/users', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/orgUsers.html',
|
|
|
|
controller: 'OrgUsersCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/org/users/invite', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/invite.html',
|
|
|
|
controller: 'UserInviteCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/org/apikeys', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/orgApiKeys.html',
|
|
|
|
controller: 'OrgApiKeysCtrl',
|
|
|
|
})
|
|
|
|
.when('/org/teams', {
|
2018-07-11 13:23:07 -05:00
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
|
|
|
roles: () => ['Editor', 'Admin'],
|
|
|
|
component: () => TeamList,
|
|
|
|
},
|
2017-12-20 05:33:33 -06:00
|
|
|
})
|
2017-12-20 14:20:12 -06:00
|
|
|
.when('/org/teams/new', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/create_team.html',
|
|
|
|
controller: 'CreateTeamCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2018-07-11 13:23:07 -05:00
|
|
|
.when('/org/teams/edit/:id/:page?', {
|
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
|
|
|
roles: () => ['Admin'],
|
|
|
|
component: () => TeamPages,
|
|
|
|
},
|
2017-12-20 05:33:33 -06:00
|
|
|
})
|
|
|
|
.when('/profile', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/profile.html',
|
|
|
|
controller: 'ProfileCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/profile/password', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/change_password.html',
|
|
|
|
controller: 'ChangePasswordCtrl',
|
|
|
|
})
|
|
|
|
.when('/profile/select-org', {
|
|
|
|
templateUrl: 'public/app/features/org/partials/select_org.html',
|
|
|
|
controller: 'SelectOrgCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
|
|
|
// ADMIN
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/admin', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/admin_home.html',
|
|
|
|
controller: 'AdminHomeCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/admin/settings', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/settings.html',
|
|
|
|
controller: 'AdminSettingsCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/admin/users', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/users.html',
|
|
|
|
controller: 'AdminListUsersCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/admin/users/create', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/new_user.html',
|
|
|
|
controller: 'AdminEditUserCtrl',
|
|
|
|
})
|
|
|
|
.when('/admin/users/edit/:id', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/edit_user.html',
|
|
|
|
controller: 'AdminEditUserCtrl',
|
|
|
|
})
|
|
|
|
.when('/admin/orgs', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/orgs.html',
|
|
|
|
controller: 'AdminListOrgsCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/admin/orgs/edit/:id', {
|
|
|
|
templateUrl: 'public/app/features/admin/partials/edit_org.html',
|
|
|
|
controller: 'AdminEditOrgCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/admin/stats', {
|
2017-12-21 04:56:45 -06:00
|
|
|
template: '<react-container />',
|
|
|
|
resolve: {
|
|
|
|
component: () => ServerStats,
|
|
|
|
},
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
|
|
|
// LOGIN / SIGNUP
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/login', {
|
|
|
|
templateUrl: 'public/app/partials/login.html',
|
|
|
|
controller: 'LoginCtrl',
|
|
|
|
pageClass: 'login-page sidemenu-hidden',
|
|
|
|
})
|
|
|
|
.when('/invite/:code', {
|
|
|
|
templateUrl: 'public/app/partials/signup_invited.html',
|
|
|
|
controller: 'InvitedCtrl',
|
|
|
|
pageClass: 'sidemenu-hidden',
|
|
|
|
})
|
|
|
|
.when('/signup', {
|
|
|
|
templateUrl: 'public/app/partials/signup_step2.html',
|
|
|
|
controller: 'SignUpCtrl',
|
|
|
|
pageClass: 'sidemenu-hidden',
|
|
|
|
})
|
|
|
|
.when('/user/password/send-reset-email', {
|
|
|
|
templateUrl: 'public/app/partials/reset_password.html',
|
|
|
|
controller: 'ResetPasswordCtrl',
|
|
|
|
pageClass: 'sidemenu-hidden',
|
|
|
|
})
|
|
|
|
.when('/user/password/reset', {
|
|
|
|
templateUrl: 'public/app/partials/reset_password.html',
|
|
|
|
controller: 'ResetPasswordCtrl',
|
|
|
|
pageClass: 'sidemenu-hidden',
|
|
|
|
})
|
|
|
|
.when('/dashboard/snapshots', {
|
2018-09-10 06:59:31 -05:00
|
|
|
templateUrl: 'public/app/features/manage-dashboards/partials/snapshot_list.html',
|
|
|
|
controller: 'SnapshotListCtrl',
|
2017-12-20 05:33:33 -06:00
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/plugins', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/plugin_list.html',
|
|
|
|
controller: 'PluginListCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/plugins/:pluginId/edit', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/plugin_edit.html',
|
|
|
|
controller: 'PluginEditCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/plugins/:pluginId/page/:slug', {
|
|
|
|
templateUrl: 'public/app/features/plugins/partials/plugin_page.html',
|
|
|
|
controller: 'AppPageCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
|
|
|
.when('/styleguide/:page?', {
|
|
|
|
controller: 'StyleGuideCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
2018-09-10 06:38:45 -05:00
|
|
|
templateUrl: 'public/app/features/admin/partials/styleguide.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
})
|
|
|
|
.when('/alerting', {
|
|
|
|
redirectTo: '/alerting/list',
|
|
|
|
})
|
|
|
|
.when('/alerting/list', {
|
|
|
|
templateUrl: 'public/app/features/alerting/partials/alert_list.html',
|
|
|
|
controller: 'AlertListCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
})
|
2017-12-31 15:31:11 -06:00
|
|
|
.when('/alerting/list', {
|
2017-12-28 11:49:33 -06:00
|
|
|
template: '<react-container />',
|
2017-12-31 15:31:11 -06:00
|
|
|
reloadOnSearch: false,
|
2017-12-28 11:49:33 -06:00
|
|
|
resolve: {
|
|
|
|
component: () => AlertRuleList,
|
|
|
|
},
|
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/alerting/notifications', {
|
2017-12-21 01:39:31 -06:00
|
|
|
templateUrl: 'public/app/features/alerting/partials/notifications_list.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'AlertNotificationsListCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/alerting/notification/new', {
|
2017-12-21 01:39:31 -06:00
|
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'AlertNotificationEditCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
2017-12-20 05:33:33 -06:00
|
|
|
.when('/alerting/notification/:id/edit', {
|
2017-12-21 01:39:31 -06:00
|
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
2017-12-20 05:33:33 -06:00
|
|
|
controller: 'AlertNotificationEditCtrl',
|
|
|
|
controllerAs: 'ctrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
})
|
|
|
|
.otherwise({
|
2017-12-20 05:33:33 -06:00
|
|
|
templateUrl: 'public/app/partials/error.html',
|
|
|
|
controller: 'ErrorCtrl',
|
2017-12-19 09:06:54 -06:00
|
|
|
});
|
2016-02-09 04:17:49 -06:00
|
|
|
}
|