|
@@ -1,43 +1,12 @@
|
|
|
import './dashboard_loaders';
|
|
import './dashboard_loaders';
|
|
|
-import coreModule from 'app/core/core_module';
|
|
|
|
|
|
|
+import './ReactContainer';
|
|
|
|
|
+import { ServerStats } from 'app/containers/ServerStats/ServerStats';
|
|
|
|
|
+import { AlertRuleList } from 'app/containers/AlertRuleList/AlertRuleList';
|
|
|
|
|
|
|
|
/** @ngInject **/
|
|
/** @ngInject **/
|
|
|
-function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
|
|
|
|
+export function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
$locationProvider.html5Mode(true);
|
|
$locationProvider.html5Mode(true);
|
|
|
|
|
|
|
|
- var loadOrgBundle = {
|
|
|
|
|
- lazy: [
|
|
|
|
|
- '$q',
|
|
|
|
|
- '$route',
|
|
|
|
|
- '$rootScope',
|
|
|
|
|
- ($q, $route, $rootScope) => {
|
|
|
|
|
- return System.import('app/features/org/all');
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- var loadAdminBundle = {
|
|
|
|
|
- lazy: [
|
|
|
|
|
- '$q',
|
|
|
|
|
- '$route',
|
|
|
|
|
- '$rootScope',
|
|
|
|
|
- ($q, $route, $rootScope) => {
|
|
|
|
|
- return System.import('app/features/admin/admin');
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- var loadAlertingBundle = {
|
|
|
|
|
- lazy: [
|
|
|
|
|
- '$q',
|
|
|
|
|
- '$route',
|
|
|
|
|
- '$rootScope',
|
|
|
|
|
- ($q, $route, $rootScope) => {
|
|
|
|
|
- return System.import('app/features/alerting/all');
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
$routeProvider
|
|
$routeProvider
|
|
|
.when('/', {
|
|
.when('/', {
|
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
templateUrl: 'public/app/partials/dashboard.html',
|
|
@@ -111,110 +80,92 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
.when('/org', {
|
|
.when('/org', {
|
|
|
templateUrl: 'public/app/features/org/partials/orgDetails.html',
|
|
templateUrl: 'public/app/features/org/partials/orgDetails.html',
|
|
|
controller: 'OrgDetailsCtrl',
|
|
controller: 'OrgDetailsCtrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/new', {
|
|
.when('/org/new', {
|
|
|
templateUrl: 'public/app/features/org/partials/newOrg.html',
|
|
templateUrl: 'public/app/features/org/partials/newOrg.html',
|
|
|
controller: 'NewOrgCtrl',
|
|
controller: 'NewOrgCtrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/users', {
|
|
.when('/org/users', {
|
|
|
templateUrl: 'public/app/features/org/partials/orgUsers.html',
|
|
templateUrl: 'public/app/features/org/partials/orgUsers.html',
|
|
|
controller: 'OrgUsersCtrl',
|
|
controller: 'OrgUsersCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/users/invite', {
|
|
.when('/org/users/invite', {
|
|
|
templateUrl: 'public/app/features/org/partials/invite.html',
|
|
templateUrl: 'public/app/features/org/partials/invite.html',
|
|
|
controller: 'UserInviteCtrl',
|
|
controller: 'UserInviteCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/apikeys', {
|
|
.when('/org/apikeys', {
|
|
|
templateUrl: 'public/app/features/org/partials/orgApiKeys.html',
|
|
templateUrl: 'public/app/features/org/partials/orgApiKeys.html',
|
|
|
controller: 'OrgApiKeysCtrl',
|
|
controller: 'OrgApiKeysCtrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/teams', {
|
|
.when('/org/teams', {
|
|
|
templateUrl: 'public/app/features/org/partials/teams.html',
|
|
templateUrl: 'public/app/features/org/partials/teams.html',
|
|
|
controller: 'TeamsCtrl',
|
|
controller: 'TeamsCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/teams/new', {
|
|
.when('/org/teams/new', {
|
|
|
templateUrl: 'public/app/features/org/partials/create_team.html',
|
|
templateUrl: 'public/app/features/org/partials/create_team.html',
|
|
|
controller: 'CreateTeamCtrl',
|
|
controller: 'CreateTeamCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/org/teams/edit/:id', {
|
|
.when('/org/teams/edit/:id', {
|
|
|
templateUrl: 'public/app/features/org/partials/team_details.html',
|
|
templateUrl: 'public/app/features/org/partials/team_details.html',
|
|
|
controller: 'TeamDetailsCtrl',
|
|
controller: 'TeamDetailsCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/profile', {
|
|
.when('/profile', {
|
|
|
templateUrl: 'public/app/features/org/partials/profile.html',
|
|
templateUrl: 'public/app/features/org/partials/profile.html',
|
|
|
controller: 'ProfileCtrl',
|
|
controller: 'ProfileCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/profile/password', {
|
|
.when('/profile/password', {
|
|
|
templateUrl: 'public/app/features/org/partials/change_password.html',
|
|
templateUrl: 'public/app/features/org/partials/change_password.html',
|
|
|
controller: 'ChangePasswordCtrl',
|
|
controller: 'ChangePasswordCtrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/profile/select-org', {
|
|
.when('/profile/select-org', {
|
|
|
templateUrl: 'public/app/features/org/partials/select_org.html',
|
|
templateUrl: 'public/app/features/org/partials/select_org.html',
|
|
|
controller: 'SelectOrgCtrl',
|
|
controller: 'SelectOrgCtrl',
|
|
|
- resolve: loadOrgBundle,
|
|
|
|
|
})
|
|
})
|
|
|
// ADMIN
|
|
// ADMIN
|
|
|
.when('/admin', {
|
|
.when('/admin', {
|
|
|
templateUrl: 'public/app/features/admin/partials/admin_home.html',
|
|
templateUrl: 'public/app/features/admin/partials/admin_home.html',
|
|
|
controller: 'AdminHomeCtrl',
|
|
controller: 'AdminHomeCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/settings', {
|
|
.when('/admin/settings', {
|
|
|
templateUrl: 'public/app/features/admin/partials/settings.html',
|
|
templateUrl: 'public/app/features/admin/partials/settings.html',
|
|
|
controller: 'AdminSettingsCtrl',
|
|
controller: 'AdminSettingsCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/users', {
|
|
.when('/admin/users', {
|
|
|
templateUrl: 'public/app/features/admin/partials/users.html',
|
|
templateUrl: 'public/app/features/admin/partials/users.html',
|
|
|
controller: 'AdminListUsersCtrl',
|
|
controller: 'AdminListUsersCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/users/create', {
|
|
.when('/admin/users/create', {
|
|
|
templateUrl: 'public/app/features/admin/partials/new_user.html',
|
|
templateUrl: 'public/app/features/admin/partials/new_user.html',
|
|
|
controller: 'AdminEditUserCtrl',
|
|
controller: 'AdminEditUserCtrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/users/edit/:id', {
|
|
.when('/admin/users/edit/:id', {
|
|
|
templateUrl: 'public/app/features/admin/partials/edit_user.html',
|
|
templateUrl: 'public/app/features/admin/partials/edit_user.html',
|
|
|
controller: 'AdminEditUserCtrl',
|
|
controller: 'AdminEditUserCtrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/orgs', {
|
|
.when('/admin/orgs', {
|
|
|
templateUrl: 'public/app/features/admin/partials/orgs.html',
|
|
templateUrl: 'public/app/features/admin/partials/orgs.html',
|
|
|
controller: 'AdminListOrgsCtrl',
|
|
controller: 'AdminListOrgsCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/orgs/edit/:id', {
|
|
.when('/admin/orgs/edit/:id', {
|
|
|
templateUrl: 'public/app/features/admin/partials/edit_org.html',
|
|
templateUrl: 'public/app/features/admin/partials/edit_org.html',
|
|
|
controller: 'AdminEditOrgCtrl',
|
|
controller: 'AdminEditOrgCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/admin/stats', {
|
|
.when('/admin/stats', {
|
|
|
- templateUrl: 'public/app/features/admin/partials/stats.html',
|
|
|
|
|
- controller: 'AdminStatsCtrl',
|
|
|
|
|
- controllerAs: 'ctrl',
|
|
|
|
|
- resolve: loadAdminBundle,
|
|
|
|
|
|
|
+ template: '<react-container />',
|
|
|
|
|
+ resolve: {
|
|
|
|
|
+ component: () => ServerStats,
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
// LOGIN / SIGNUP
|
|
// LOGIN / SIGNUP
|
|
|
.when('/login', {
|
|
.when('/login', {
|
|
@@ -274,30 +225,31 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
|
|
|
templateUrl: 'public/app/features/alerting/partials/alert_list.html',
|
|
templateUrl: 'public/app/features/alerting/partials/alert_list.html',
|
|
|
controller: 'AlertListCtrl',
|
|
controller: 'AlertListCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAlertingBundle,
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .when('/alerting/list', {
|
|
|
|
|
+ template: '<react-container />',
|
|
|
|
|
+ reloadOnSearch: false,
|
|
|
|
|
+ resolve: {
|
|
|
|
|
+ component: () => AlertRuleList,
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
.when('/alerting/notifications', {
|
|
.when('/alerting/notifications', {
|
|
|
templateUrl: 'public/app/features/alerting/partials/notifications_list.html',
|
|
templateUrl: 'public/app/features/alerting/partials/notifications_list.html',
|
|
|
controller: 'AlertNotificationsListCtrl',
|
|
controller: 'AlertNotificationsListCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAlertingBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/alerting/notification/new', {
|
|
.when('/alerting/notification/new', {
|
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
|
|
controller: 'AlertNotificationEditCtrl',
|
|
controller: 'AlertNotificationEditCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAlertingBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.when('/alerting/notification/:id/edit', {
|
|
.when('/alerting/notification/:id/edit', {
|
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
|
templateUrl: 'public/app/features/alerting/partials/notification_edit.html',
|
|
|
controller: 'AlertNotificationEditCtrl',
|
|
controller: 'AlertNotificationEditCtrl',
|
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
- resolve: loadAlertingBundle,
|
|
|
|
|
})
|
|
})
|
|
|
.otherwise({
|
|
.otherwise({
|
|
|
templateUrl: 'public/app/partials/error.html',
|
|
templateUrl: 'public/app/partials/error.html',
|
|
|
controller: 'ErrorCtrl',
|
|
controller: 'ErrorCtrl',
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-coreModule.config(setupAngularRoutes);
|
|
|