grafana/public/app/routes/routes.ts

263 lines
8.9 KiB
TypeScript
Raw Normal View History

2017-12-20 05:33:33 -06:00
import './dashboard_loaders';
import './ReactContainer';
import { ServerStats } from 'app/containers/ServerStats/ServerStats';
import { AlertRuleList } from 'app/containers/AlertRuleList/AlertRuleList';
import { FolderSettings } from 'app/containers/ManageDashboards/FolderSettings';
2016-02-09 04:17:49 -06:00
/** @ngInject **/
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',
reloadOnSearch: false,
2017-12-20 05:33:33 -06:00
pageClass: 'page-dashboard',
})
2017-12-20 05:33:33 -06:00
.when('/dashboard/:type/:slug', {
templateUrl: 'public/app/partials/dashboard.html',
controller: 'LoadDashboardCtrl',
reloadOnSearch: false,
2017-12-20 05:33:33 -06:00
pageClass: 'page-dashboard',
})
2017-12-20 05:33:33 -06:00
.when('/dashboard-solo/:type/: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-20 05:33:33 -06:00
.when('/dashboard/new', {
templateUrl: 'public/app/partials/dashboard.html',
controller: 'NewDashboardCtrl',
reloadOnSearch: false,
2017-12-20 05:33:33 -06:00
pageClass: 'page-dashboard',
})
2017-12-20 05:33:33 -06:00
.when('/dashboard/import', {
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',
2018-01-18 10:42:40 -06:00
controllerAs: 'ctrl',
})
.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', {
templateUrl: 'public/app/features/dashboard/partials/dashboard_list.html',
controller: 'DashboardListCtrl',
controllerAs: 'ctrl',
})
.when('/dashboards/folder/new', {
templateUrl: 'public/app/features/dashboard/partials/create_folder.html',
controller: 'CreateFolderCtrl',
controllerAs: 'ctrl',
})
.when('/dashboards/folder/:folderId/:slug/permissions', {
templateUrl: 'public/app/features/dashboard/partials/folder_permissions.html',
2017-12-20 05:33:33 -06:00
controller: 'FolderPermissionsCtrl',
controllerAs: 'ctrl',
})
2017-12-20 05:33:33 -06:00
.when('/dashboards/folder/:folderId/:slug/settings', {
template: '<react-container />',
resolve: {
component: () => FolderSettings,
},
})
2017-12-20 05:33:33 -06:00
.when('/dashboards/folder/:folderId/:slug', {
templateUrl: 'public/app/features/dashboard/partials/folder_dashboards.html',
2017-12-20 05:33:33 -06:00
controller: 'FolderDashboardsCtrl',
controllerAs: 'ctrl',
})
.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', {
templateUrl: 'public/app/features/org/partials/teams.html',
controller: 'TeamsCtrl',
controllerAs: 'ctrl',
})
.when('/org/teams/new', {
templateUrl: 'public/app/features/org/partials/create_team.html',
controller: 'CreateTeamCtrl',
controllerAs: 'ctrl',
})
2017-12-20 05:33:33 -06:00
.when('/org/teams/edit/:id', {
templateUrl: 'public/app/features/org/partials/team_details.html',
controller: 'TeamDetailsCtrl',
controllerAs: 'ctrl',
})
.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',
})
// 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', {
template: '<react-container />',
resolve: {
component: () => ServerStats,
},
})
// 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', {
templateUrl: 'public/app/features/snapshot/partials/snapshots.html',
controller: 'SnapshotsCtrl',
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',
templateUrl: 'public/app/features/styleguide/styleguide.html',
})
.when('/alerting', {
redirectTo: '/alerting/list',
})
.when('/alerting/list', {
templateUrl: 'public/app/features/alerting/partials/alert_list.html',
controller: 'AlertListCtrl',
controllerAs: 'ctrl',
})
.when('/alerting/list', {
template: '<react-container />',
reloadOnSearch: false,
resolve: {
component: () => AlertRuleList,
},
})
2017-12-20 05:33:33 -06:00
.when('/alerting/notifications', {
templateUrl: 'public/app/features/alerting/partials/notifications_list.html',
2017-12-20 05:33:33 -06:00
controller: 'AlertNotificationsListCtrl',
controllerAs: 'ctrl',
})
2017-12-20 05:33:33 -06:00
.when('/alerting/notification/new', {
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
2017-12-20 05:33:33 -06:00
controller: 'AlertNotificationEditCtrl',
controllerAs: 'ctrl',
})
2017-12-20 05:33:33 -06:00
.when('/alerting/notification/:id/edit', {
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
2017-12-20 05:33:33 -06:00
controller: 'AlertNotificationEditCtrl',
controllerAs: 'ctrl',
})
.otherwise({
2017-12-20 05:33:33 -06:00
templateUrl: 'public/app/partials/error.html',
controller: 'ErrorCtrl',
});
2016-02-09 04:17:49 -06:00
}