##// END OF EJS Templates
event browser: turn into component
ergo -
Show More
@@ -1,202 +1,203 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 'use strict';
20 'use strict';
21
21
22 // Declare app level module which depends on filters, and services
22 // Declare app level module which depends on filters, and services
23 angular.module('appenlight.base', [
23 angular.module('appenlight.base', [
24 'ngRoute',
24 'ngRoute',
25 'ui.router',
25 'ui.router',
26 'ui.router.router',
26 'ui.router.router',
27 'underscore',
27 'underscore',
28 'ui.bootstrap',
28 'ui.bootstrap',
29 'ngResource',
29 'ngResource',
30 'ngAnimate',
30 'ngAnimate',
31 'ngCookies',
31 'ngCookies',
32 'smart-table',
32 'smart-table',
33 'angular-toArrayFilter',
33 'angular-toArrayFilter',
34 'mentio'
34 'mentio'
35 ]);
35 ]);
36
36
37 angular.module('appenlight.filters', []);
37 angular.module('appenlight.filters', []);
38 angular.module('appenlight.templates', []);
38 angular.module('appenlight.templates', []);
39 angular.module('appenlight.controllers', [
39 angular.module('appenlight.controllers', [
40 'appenlight.base'
40 'appenlight.base'
41 ]);
41 ]);
42 angular.module('appenlight.components', [
42 angular.module('appenlight.components', [
43 'appenlight.components.channelstream',
43 'appenlight.components.channelstream',
44 'appenlight.components.appenlightApp',
44 'appenlight.components.appenlightApp',
45 'appenlight.components.appenlightHeader',
45 'appenlight.components.appenlightHeader',
46 'appenlight.components.indexDashboardView',
46 'appenlight.components.indexDashboardView',
47 'appenlight.components.logsBrowserView',
47 'appenlight.components.logsBrowserView',
48 'appenlight.components.eventBrowserView'
48 ]);
49 ]);
49 angular.module('appenlight.directives', [
50 angular.module('appenlight.directives', [
50 'appenlight.directives.c3chart',
51 'appenlight.directives.c3chart',
51 'appenlight.directives.confirmValidate',
52 'appenlight.directives.confirmValidate',
52 'appenlight.directives.focus',
53 'appenlight.directives.focus',
53 'appenlight.directives.formErrors',
54 'appenlight.directives.formErrors',
54 'appenlight.directives.humanFormat',
55 'appenlight.directives.humanFormat',
55 'appenlight.directives.isoToRelativeTime',
56 'appenlight.directives.isoToRelativeTime',
56 'appenlight.directives.permissionsForm',
57 'appenlight.directives.permissionsForm',
57 'appenlight.directives.smallReportGroupList',
58 'appenlight.directives.smallReportGroupList',
58 'appenlight.directives.smallReportList',
59 'appenlight.directives.smallReportList',
59 'appenlight.directives.pluginConfig',
60 'appenlight.directives.pluginConfig',
60 'appenlight.directives.recursive',
61 'appenlight.directives.recursive',
61 'appenlight.directives.reportAlertAction',
62 'appenlight.directives.reportAlertAction',
62 'appenlight.directives.postProcessAction',
63 'appenlight.directives.postProcessAction',
63 'appenlight.directives.rule',
64 'appenlight.directives.rule',
64 'appenlight.directives.ruleReadOnly'
65 'appenlight.directives.ruleReadOnly'
65 ]);
66 ]);
66 angular.module('appenlight.services', [
67 angular.module('appenlight.services', [
67 'appenlight.services.chartResultParser',
68 'appenlight.services.chartResultParser',
68 'appenlight.services.resources',
69 'appenlight.services.resources',
69 'appenlight.services.stateHolder',
70 'appenlight.services.stateHolder',
70 'appenlight.services.typeAheadTagHelper',
71 'appenlight.services.typeAheadTagHelper',
71 'appenlight.services.UUIDProvider'
72 'appenlight.services.UUIDProvider'
72 ]).value('version', '0.1');
73 ]).value('version', '0.1');
73
74
74
75
75 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
76 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
76 function(item){
77 function(item){
77 return item.config.angular_module
78 return item.config.angular_module
78 });
79 });
79 console.log(pluginsToLoad);
80 console.log(pluginsToLoad);
80 angular.module('appenlight.plugins', pluginsToLoad);
81 angular.module('appenlight.plugins', pluginsToLoad);
81
82
82 var app = angular.module('appenlight', [
83 var app = angular.module('appenlight', [
83 'appenlight.base',
84 'appenlight.base',
84 'appenlight.config',
85 'appenlight.config',
85 'appenlight.templates',
86 'appenlight.templates',
86 'appenlight.filters',
87 'appenlight.filters',
87 'appenlight.services',
88 'appenlight.services',
88 'appenlight.directives',
89 'appenlight.directives',
89 'appenlight.controllers',
90 'appenlight.controllers',
90 'appenlight.components',
91 'appenlight.components',
91 'appenlight.plugins'
92 'appenlight.plugins'
92 ]);
93 ]);
93
94
94 // needs manual execution because of plugin files
95 // needs manual execution because of plugin files
95 function kickstartAE(initialUserData) {
96 function kickstartAE(initialUserData) {
96 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
97 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
97 $locationProvider.html5Mode(true);
98 $locationProvider.html5Mode(true);
98 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
99 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
99 return {
100 return {
100 'response': function (response) {
101 'response': function (response) {
101 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
102 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
102 if (flashMessages && flashMessages.length > 0) {
103 if (flashMessages && flashMessages.length > 0) {
103 stateHolder.flashMessages.extend(flashMessages);
104 stateHolder.flashMessages.extend(flashMessages);
104 }
105 }
105 return response;
106 return response;
106 },
107 },
107 'responseError': function (rejection) {
108 'responseError': function (rejection) {
108 if (rejection.status > 299 && rejection.status !== 422) {
109 if (rejection.status > 299 && rejection.status !== 422) {
109 stateHolder.flashMessages.extend([{
110 stateHolder.flashMessages.extend([{
110 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
111 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
111 type: 'error'
112 type: 'error'
112 }]);
113 }]);
113 }
114 }
114 if (rejection.status == 0) {
115 if (rejection.status == 0) {
115 stateHolder.flashMessages.extend([{
116 stateHolder.flashMessages.extend([{
116 msg: 'Response timeout',
117 msg: 'Response timeout',
117 type: 'error'
118 type: 'error'
118 }]);
119 }]);
119 }
120 }
120 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
121 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
121 if (flashMessages && flashMessages.length > 0) {
122 if (flashMessages && flashMessages.length > 0) {
122 stateHolder.flashMessages.extend(flashMessages);
123 stateHolder.flashMessages.extend(flashMessages);
123 }
124 }
124
125
125 return $q.reject(rejection);
126 return $q.reject(rejection);
126 }
127 }
127 }
128 }
128 }]);
129 }]);
129
130
130 $uibTooltipProvider.options({appendToBody: true});
131 $uibTooltipProvider.options({appendToBody: true});
131
132
132 }]);
133 }]);
133
134
134
135
135 app.config(function ($provide) {
136 app.config(function ($provide) {
136 $provide.decorator("$exceptionHandler", function ($delegate) {
137 $provide.decorator("$exceptionHandler", function ($delegate) {
137 return function (exception, cause) {
138 return function (exception, cause) {
138 $delegate(exception, cause);
139 $delegate(exception, cause);
139 if (typeof AppEnlight !== 'undefined') {
140 if (typeof AppEnlight !== 'undefined') {
140 AppEnlight.grabError(exception);
141 AppEnlight.grabError(exception);
141 }
142 }
142 };
143 };
143 });
144 });
144 });
145 });
145
146
146 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
147 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
147 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
148 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
148 if (initialUserData){
149 if (initialUserData){
149 stateHolder.AeUser.update(initialUserData);
150 stateHolder.AeUser.update(initialUserData);
150 }
151 }
151 $rootScope.$state = $state;
152 $rootScope.$state = $state;
152 $rootScope.stateHolder = stateHolder;
153 $rootScope.stateHolder = stateHolder;
153 $rootScope.flash = stateHolder.flashMessages.list;
154 $rootScope.flash = stateHolder.flashMessages.list;
154 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
155 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
155 $rootScope.AeConfig = AeConfig;
156 $rootScope.AeConfig = AeConfig;
156
157
157 var transitionApp = function($transition$, $state) {
158 var transitionApp = function($transition$, $state) {
158 // redirect user to /register unless its one of open views
159 // redirect user to /register unless its one of open views
159 var isGuestState = [
160 var isGuestState = [
160 'report.view_detail',
161 'report.view_detail',
161 'report.view_group',
162 'report.view_group',
162 'dashboard.view'
163 'dashboard.view'
163 ].indexOf($transition$.to().name) !== -1;
164 ].indexOf($transition$.to().name) !== -1;
164
165
165 var path = $window.location.pathname;
166 var path = $window.location.pathname;
166 // strip trailing slash
167 // strip trailing slash
167 if (path.substr(path.length - 1) === '/') {
168 if (path.substr(path.length - 1) === '/') {
168 path = path.substr(0, path.length - 1);
169 path = path.substr(0, path.length - 1);
169 }
170 }
170 var isOpenView = false;
171 var isOpenView = false;
171 var openViews = [
172 var openViews = [
172 AeConfig.urls.otherRoutes.lostPassword,
173 AeConfig.urls.otherRoutes.lostPassword,
173 AeConfig.urls.otherRoutes.lostPasswordGenerate
174 AeConfig.urls.otherRoutes.lostPasswordGenerate
174 ];
175 ];
175 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
176 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
176 _.each(openViews, function (url) {
177 _.each(openViews, function (url) {
177 var url = '/' + url.split('/').slice(3).join('/');
178 var url = '/' + url.split('/').slice(3).join('/');
178 if (url === path) {
179 if (url === path) {
179 isOpenView = true;
180 isOpenView = true;
180 }
181 }
181 });
182 });
182 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
183 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
183 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
184 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
184 console.log('redirect to register');
185 console.log('redirect to register');
185 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
186 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
186 // fix infinite digest here
187 // fix infinite digest here
187 $rootScope.$on('$locationChangeStart',
188 $rootScope.$on('$locationChangeStart',
188 function(event, toState, toParams, fromState, fromParams, options){
189 function(event, toState, toParams, fromState, fromParams, options){
189 event.preventDefault();
190 event.preventDefault();
190 $window.location = newLocation;
191 $window.location = newLocation;
191 });
192 });
192 $window.location = newLocation;
193 $window.location = newLocation;
193 return false;
194 return false;
194 }
195 }
195 return false;
196 return false;
196 }
197 }
197 return true;
198 return true;
198 };
199 };
199 $transitions.onBefore({}, transitionApp);
200 $transitions.onBefore({}, transitionApp);
200
201
201 }]);
202 }]);
202 }
203 }
@@ -1,43 +1,43 b''
1 <div class="panel panel-default">
1 <div class="panel panel-default">
2 <div class="panel-body">
2 <div class="panel-body">
3
3
4 <h1>Event history</h1>
4 <h1>Event history</h1>
5
5
6 <table class="table table-striped event-table">
6 <table class="table table-striped event-table">
7 <tr ng-repeat="event in events.events track by event.id">
7 <tr ng-repeat="event in $ctrl.events track by event.id">
8 <td class="text-center icons">
8 <td class="text-center icons">
9 <span ng-if="event.event_type === 1" class="fa fa-exclamation-triangle fa-2x" style="color:orangered"></span>
9 <span ng-if="event.event_type === 1" class="fa fa-exclamation-triangle fa-2x" style="color:orangered"></span>
10 <span ng-if="event.event_type === 3" class="fa fa-clock-o fa-2x" style="color:darkorange"></span>
10 <span ng-if="event.event_type === 3" class="fa fa-clock-o fa-2x" style="color:darkorange"></span>
11 <span ng-if="event.event_type === 7" class="fa fa-question-circle fa-2x" style="color:dimgrey"></span>
11 <span ng-if="event.event_type === 7" class="fa fa-question-circle fa-2x" style="color:dimgrey"></span>
12 <span ng-if="event.event_type === 9" class="fa fa-line-chart fa-2x" style="color:green"></span>
12 <span ng-if="event.event_type === 9" class="fa fa-line-chart fa-2x" style="color:green"></span>
13 </td>
13 </td>
14 <td>
14 <td>
15 <p>For <strong>{{ event.resource_name }}</strong></p>
15 <p>For <strong>{{ event.resource_name }}</strong></p>
16
16
17 <p>{{ event.text }}</p>
17 <p>{{ event.text }}</p>
18 <small class="date" data-uib-tooltip="{{event.start_date}}"> created:
18 <small class="date" data-uib-tooltip="{{event.start_date}}"> created:
19 <iso-to-relative-time time="{{event.start_date}}"/>
19 <iso-to-relative-time time="{{event.start_date}}"/>
20 </small>
20 </small>
21 <small class="date" ng-show="event.end_date" data-uib-tooltip="{{event.end_date}}"> | closed:
21 <small class="date" ng-show="event.end_date" data-uib-tooltip="{{event.end_date}}"> | closed:
22 <iso-to-relative-time time="{{event.end_date}}"/>
22 <iso-to-relative-time time="{{event.end_date}}"/>
23 </small>
23 </small>
24 </td>
24 </td>
25 <td class="options">
25 <td class="options">
26
26
27 <span class="dropdown pull-right" ng-if="event.status === 1" data-uib-dropdown on-toggle="toggled(open)">
27 <span class="dropdown pull-right" ng-if="event.status === 1" data-uib-dropdown on-toggle="toggled(open)">
28 <a class="dropdown-toggle btn btn-danger" data-uib-dropdown-toggle>
28 <a class="dropdown-toggle btn btn-danger" data-uib-dropdown-toggle>
29 <span class="fa fa-exclamation-circle"></span>
29 <span class="fa fa-exclamation-circle"></span>
30 </a>
30 </a>
31 <ul class="dropdown-menu">
31 <ul class="dropdown-menu">
32 <li>
32 <li>
33 <a ng-click="events.closeEvent(event)">Close event</a>
33 <a ng-click="$ctrl.closeEvent(event)">Close event</a>
34 <a>Do nothing</a>
34 <a>Do nothing</a>
35 </li>
35 </li>
36 </ul>
36 </ul>
37 </span>
37 </span>
38
38
39 </td>
39 </td>
40 </tr>
40 </tr>
41 </table>
41 </table>
42 </div>
42 </div>
43 </div>
43 </div>
@@ -1,44 +1,48 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.controllers').controller('EventsController', EventsController);
20 angular.module('appenlight.components.eventBrowserView', [])
21 .component('eventBrowserView', {
22 templateUrl: 'components/views/event-browser/event-browser.html',
23 controller: EventBrowserController
24 });
21
25
22 EventsController.$inject = ['eventsNoIdResource', 'eventsResource'];
26 EventBrowserController.$inject = ['eventsNoIdResource', 'eventsResource'];
23
27
24 function EventsController(eventsNoIdResource, eventsResource) {
28 function EventBrowserController(eventsNoIdResource, eventsResource) {
25 console.info('EventsController');
29 console.info('EventBrowserController');
26 var vm = this;
30 var vm = this;
27
31
28 vm.loading = {events: true};
32 vm.loading = {events: true};
29
33
30 vm.events = eventsNoIdResource.query(
34 vm.events = eventsNoIdResource.query(
31 {key: 'events'},
35 {key: 'events'},
32 function (data) {
36 function (data) {
33 vm.loading.events = false;
37 vm.loading.events = false;
34 });
38 });
35
39
36
40
37 vm.closeEvent = function (event) {
41 vm.closeEvent = function (event) {
38 console.log('closeEvent');
42 console.log('closeEvent');
39 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
43 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
40 event.status = 0;
44 event.status = 0;
41 });
45 });
42 }
46 }
43
47
44 }
48 }
@@ -1,248 +1,247 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
20 angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
21
21
22 $urlRouterProvider.otherwise('/ui');
22 $urlRouterProvider.otherwise('/ui');
23
23
24 $stateProvider.state('logs', {
24 $stateProvider.state('logs', {
25 url: '/ui/logs?resource',
25 url: '/ui/logs?resource',
26 component: 'logsBrowserView'
26 component: 'logsBrowserView'
27 });
27 });
28
28
29 $stateProvider.state('front_dashboard', {
29 $stateProvider.state('front_dashboard', {
30 url: '/ui',
30 url: '/ui',
31 component: 'indexDashboardView'
31 component: 'indexDashboardView'
32 });
32 });
33
33
34 $stateProvider.state('report', {
34 $stateProvider.state('report', {
35 abstract: true,
35 abstract: true,
36 url: '/ui/report',
36 url: '/ui/report',
37 templateUrl: 'templates/reports/parent_view.html'
37 templateUrl: 'templates/reports/parent_view.html'
38 });
38 });
39
39
40 $stateProvider.state('report.list', {
40 $stateProvider.state('report.list', {
41 url: '?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
41 url: '?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
42 templateUrl: 'templates/reports/list.html',
42 templateUrl: 'templates/reports/list.html',
43 controller: 'ReportsListController as reports_list'
43 controller: 'ReportsListController as reports_list'
44 });
44 });
45
45
46 $stateProvider.state('report.list_slow', {
46 $stateProvider.state('report.list_slow', {
47 url: '/list_slow?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
47 url: '/list_slow?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
48 templateUrl: 'templates/reports/list_slow.html',
48 templateUrl: 'templates/reports/list_slow.html',
49 controller: 'ReportsListSlowController as reports_list'
49 controller: 'ReportsListSlowController as reports_list'
50 });
50 });
51
51
52 $stateProvider.state('report.view_detail', {
52 $stateProvider.state('report.view_detail', {
53 url: '/:groupId/:reportId',
53 url: '/:groupId/:reportId',
54 templateUrl: 'templates/reports/view.html',
54 templateUrl: 'templates/reports/view.html',
55 controller: 'ReportsViewController as report'
55 controller: 'ReportsViewController as report'
56 });
56 });
57 $stateProvider.state('report.view_group', {
57 $stateProvider.state('report.view_group', {
58 url: '/:groupId',
58 url: '/:groupId',
59 templateUrl: 'templates/reports/view.html',
59 templateUrl: 'templates/reports/view.html',
60 controller: 'ReportsViewController as report'
60 controller: 'ReportsViewController as report'
61 });
61 });
62 $stateProvider.state('events', {
62 $stateProvider.state('events', {
63 url: '/ui/events',
63 url: '/ui/events',
64 templateUrl: 'templates/events.html',
64 component: 'eventBrowserView'
65 controller: 'EventsController as events'
66 });
65 });
67 $stateProvider.state('admin', {
66 $stateProvider.state('admin', {
68 url: '/ui/admin',
67 url: '/ui/admin',
69 templateUrl: 'templates/admin/parent_view.html'
68 templateUrl: 'templates/admin/parent_view.html'
70 });
69 });
71 $stateProvider.state('admin.user', {
70 $stateProvider.state('admin.user', {
72 abstract: true,
71 abstract: true,
73 url: '/user',
72 url: '/user',
74 templateUrl: 'templates/admin/users/parent_view.html'
73 templateUrl: 'templates/admin/users/parent_view.html'
75 });
74 });
76 $stateProvider.state('admin.user.list', {
75 $stateProvider.state('admin.user.list', {
77 url: '/list',
76 url: '/list',
78 templateUrl: 'templates/admin/users/users_list.html',
77 templateUrl: 'templates/admin/users/users_list.html',
79 controller: 'AdminUsersController as users'
78 controller: 'AdminUsersController as users'
80 });
79 });
81 $stateProvider.state('admin.user.create', {
80 $stateProvider.state('admin.user.create', {
82 url: '/create',
81 url: '/create',
83 templateUrl: 'templates/admin/users/users_create.html',
82 templateUrl: 'templates/admin/users/users_create.html',
84 controller: 'AdminUsersCreateController as user'
83 controller: 'AdminUsersCreateController as user'
85 });
84 });
86 $stateProvider.state('admin.user.update', {
85 $stateProvider.state('admin.user.update', {
87 url: '/{userId}/update',
86 url: '/{userId}/update',
88 templateUrl: 'templates/admin/users/users_create.html',
87 templateUrl: 'templates/admin/users/users_create.html',
89 controller: 'AdminUsersCreateController as user'
88 controller: 'AdminUsersCreateController as user'
90 });
89 });
91
90
92
91
93 $stateProvider.state('admin.group', {
92 $stateProvider.state('admin.group', {
94 abstract: true,
93 abstract: true,
95 url: '/group',
94 url: '/group',
96 templateUrl: 'templates/admin/groups/parent_view.html'
95 templateUrl: 'templates/admin/groups/parent_view.html'
97 });
96 });
98 $stateProvider.state('admin.group.list', {
97 $stateProvider.state('admin.group.list', {
99 url: '/list',
98 url: '/list',
100 templateUrl: 'templates/admin/groups/groups_list.html',
99 templateUrl: 'templates/admin/groups/groups_list.html',
101 controller: 'AdminGroupsController as groups'
100 controller: 'AdminGroupsController as groups'
102 });
101 });
103 $stateProvider.state('admin.group.create', {
102 $stateProvider.state('admin.group.create', {
104 url: '/create',
103 url: '/create',
105 templateUrl: 'templates/admin/groups/groups_create.html',
104 templateUrl: 'templates/admin/groups/groups_create.html',
106 controller: 'AdminGroupsCreateController as group'
105 controller: 'AdminGroupsCreateController as group'
107 });
106 });
108 $stateProvider.state('admin.group.update', {
107 $stateProvider.state('admin.group.update', {
109 url: '/{groupId}/update',
108 url: '/{groupId}/update',
110 templateUrl: 'templates/admin/groups/groups_create.html',
109 templateUrl: 'templates/admin/groups/groups_create.html',
111 controller: 'AdminGroupsCreateController as group'
110 controller: 'AdminGroupsCreateController as group'
112 });
111 });
113
112
114 $stateProvider.state('admin.application', {
113 $stateProvider.state('admin.application', {
115 abstract: true,
114 abstract: true,
116 url: '/application',
115 url: '/application',
117 templateUrl: 'templates/admin/users/parent_view.html'
116 templateUrl: 'templates/admin/users/parent_view.html'
118 });
117 });
119
118
120 $stateProvider.state('admin.application.list', {
119 $stateProvider.state('admin.application.list', {
121 url: '/list',
120 url: '/list',
122 templateUrl: 'templates/admin/applications/applications_list.html',
121 templateUrl: 'templates/admin/applications/applications_list.html',
123 controller: 'AdminApplicationsListController as applications'
122 controller: 'AdminApplicationsListController as applications'
124 });
123 });
125
124
126 $stateProvider.state('admin.partitions', {
125 $stateProvider.state('admin.partitions', {
127 url: '/partitions',
126 url: '/partitions',
128 templateUrl: 'templates/admin/partitions.html',
127 templateUrl: 'templates/admin/partitions.html',
129 controller: 'AdminPartitionsController as partitions'
128 controller: 'AdminPartitionsController as partitions'
130 });
129 });
131 $stateProvider.state('admin.system', {
130 $stateProvider.state('admin.system', {
132 url: '/system',
131 url: '/system',
133 templateUrl: 'templates/admin/system.html',
132 templateUrl: 'templates/admin/system.html',
134 controller: 'AdminSystemController as system'
133 controller: 'AdminSystemController as system'
135 });
134 });
136
135
137 $stateProvider.state('admin.configs', {
136 $stateProvider.state('admin.configs', {
138 abstract: true,
137 abstract: true,
139 url: '/configs',
138 url: '/configs',
140 templateUrl: 'templates/admin/configs/parent_view.html'
139 templateUrl: 'templates/admin/configs/parent_view.html'
141 });
140 });
142
141
143 $stateProvider.state('admin.configs.list', {
142 $stateProvider.state('admin.configs.list', {
144 url: '',
143 url: '',
145 templateUrl: 'templates/admin/configs/edit.html',
144 templateUrl: 'templates/admin/configs/edit.html',
146 controller: 'ConfigsListController as configs'
145 controller: 'ConfigsListController as configs'
147 });
146 });
148
147
149 $stateProvider.state('user', {
148 $stateProvider.state('user', {
150 url: '/ui/user',
149 url: '/ui/user',
151 templateUrl: 'templates/user/parent_view.html'
150 templateUrl: 'templates/user/parent_view.html'
152 });
151 });
153
152
154 $stateProvider.state('user.profile', {
153 $stateProvider.state('user.profile', {
155 abstract: true,
154 abstract: true,
156 url: '/profile',
155 url: '/profile',
157 templateUrl: 'templates/user/profile.html'
156 templateUrl: 'templates/user/profile.html'
158 });
157 });
159 $stateProvider.state('user.profile.edit', {
158 $stateProvider.state('user.profile.edit', {
160 url: '',
159 url: '',
161 templateUrl: 'templates/user/profile_edit.html',
160 templateUrl: 'templates/user/profile_edit.html',
162 controller: 'UserProfileController as profile'
161 controller: 'UserProfileController as profile'
163 });
162 });
164
163
165
164
166 $stateProvider.state('user.profile.password', {
165 $stateProvider.state('user.profile.password', {
167 url: '/password',
166 url: '/password',
168 templateUrl: 'templates/user/profile_password.html',
167 templateUrl: 'templates/user/profile_password.html',
169 controller: 'UserPasswordController as password'
168 controller: 'UserPasswordController as password'
170 });
169 });
171
170
172 $stateProvider.state('user.profile.identities', {
171 $stateProvider.state('user.profile.identities', {
173 url: '/identities',
172 url: '/identities',
174 templateUrl: 'templates/user/profile_identities.html',
173 templateUrl: 'templates/user/profile_identities.html',
175 controller: 'UserIdentitiesController as identities'
174 controller: 'UserIdentitiesController as identities'
176 });
175 });
177
176
178 $stateProvider.state('user.profile.auth_tokens', {
177 $stateProvider.state('user.profile.auth_tokens', {
179 url: '/auth_tokens',
178 url: '/auth_tokens',
180 templateUrl: 'templates/user/auth_tokens.html',
179 templateUrl: 'templates/user/auth_tokens.html',
181 controller: 'UserAuthTokensController as auth_tokens'
180 controller: 'UserAuthTokensController as auth_tokens'
182 });
181 });
183
182
184 $stateProvider.state('user.alert_channels', {
183 $stateProvider.state('user.alert_channels', {
185 abstract: true,
184 abstract: true,
186 url: '/alert_channels',
185 url: '/alert_channels',
187 templateUrl: 'templates/user/alert_channels.html'
186 templateUrl: 'templates/user/alert_channels.html'
188 });
187 });
189
188
190 $stateProvider.state('user.alert_channels.list', {
189 $stateProvider.state('user.alert_channels.list', {
191 url: '',
190 url: '',
192 templateUrl: 'templates/user/alert_channels_list.html',
191 templateUrl: 'templates/user/alert_channels_list.html',
193 controller: 'AlertChannelsController as channels'
192 controller: 'AlertChannelsController as channels'
194 });
193 });
195
194
196 $stateProvider.state('user.alert_channels.email', {
195 $stateProvider.state('user.alert_channels.email', {
197 url: '/email',
196 url: '/email',
198 templateUrl: 'templates/user/alert_channels_email.html',
197 templateUrl: 'templates/user/alert_channels_email.html',
199 controller: 'AlertChannelsEmailController as email'
198 controller: 'AlertChannelsEmailController as email'
200 });
199 });
201
200
202 $stateProvider.state('applications', {
201 $stateProvider.state('applications', {
203 abstract: true,
202 abstract: true,
204 url: '/ui/applications',
203 url: '/ui/applications',
205 templateUrl: 'templates/applications/parent_view.html'
204 templateUrl: 'templates/applications/parent_view.html'
206 });
205 });
207
206
208 $stateProvider.state('applications.list', {
207 $stateProvider.state('applications.list', {
209 url: '',
208 url: '',
210 templateUrl: 'templates/applications/list.html',
209 templateUrl: 'templates/applications/list.html',
211 controller: 'ApplicationsListController as applications'
210 controller: 'ApplicationsListController as applications'
212 });
211 });
213 $stateProvider.state('applications.update', {
212 $stateProvider.state('applications.update', {
214 url: '/{resourceId}/update',
213 url: '/{resourceId}/update',
215 templateUrl: 'templates/applications/applications_update.html',
214 templateUrl: 'templates/applications/applications_update.html',
216 controller: 'ApplicationsUpdateController as application'
215 controller: 'ApplicationsUpdateController as application'
217 });
216 });
218
217
219 $stateProvider.state('applications.integrations', {
218 $stateProvider.state('applications.integrations', {
220 url: '/{resourceId}/integrations',
219 url: '/{resourceId}/integrations',
221 templateUrl: 'templates/applications/integrations.html',
220 templateUrl: 'templates/applications/integrations.html',
222 controller: 'IntegrationsListController as integrations',
221 controller: 'IntegrationsListController as integrations',
223 data: {
222 data: {
224 resource: null
223 resource: null
225 }
224 }
226 });
225 });
227
226
228 $stateProvider.state('applications.purge_logs', {
227 $stateProvider.state('applications.purge_logs', {
229 url: '/purge_logs',
228 url: '/purge_logs',
230 templateUrl: 'templates/applications/applications_purge_logs.html',
229 templateUrl: 'templates/applications/applications_purge_logs.html',
231 controller: 'ApplicationsPurgeLogsController as applications_purge'
230 controller: 'ApplicationsPurgeLogsController as applications_purge'
232 });
231 });
233
232
234 $stateProvider.state('applications.integrations.edit', {
233 $stateProvider.state('applications.integrations.edit', {
235 url: '/{integration}',
234 url: '/{integration}',
236 templateUrl: function ($stateParams) {
235 templateUrl: function ($stateParams) {
237 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
236 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
238 },
237 },
239 controller: 'IntegrationController as integration'
238 controller: 'IntegrationController as integration'
240 });
239 });
241
240
242 $stateProvider.state('tests', {
241 $stateProvider.state('tests', {
243 url: '/ui/tests',
242 url: '/ui/tests',
244 templateUrl: 'templates/user/alert_channels_test.html',
243 templateUrl: 'templates/user/alert_channels_test.html',
245 controller: 'AlertChannelsTestController as test_action'
244 controller: 'AlertChannelsTestController as test_action'
246 });
245 });
247
246
248 }]);
247 }]);
General Comments 0
You need to be logged in to leave comments. Login now