##// END OF EJS Templates
components: user and alert channels components
ergo -
Show More
@@ -1,206 +1,210 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 'appenlight.components.eventBrowserView',
49 'appenlight.components.userProfileView',
49 'appenlight.components.userProfileView',
50 'appenlight.components.userIdentitiesView',
50 'appenlight.components.userIdentitiesView',
51 'appenlight.components.userPasswordView',
52 'appenlight.components.userAuthTokensView',
53 'appenlight.components.userAlertChannelsListView',
54 'appenlight.components.userAlertChannelsEmailNewView',
51 'appenlight.components.settingsView'
55 'appenlight.components.settingsView'
52 ]);
56 ]);
53 angular.module('appenlight.directives', [
57 angular.module('appenlight.directives', [
54 'appenlight.directives.c3chart',
58 'appenlight.directives.c3chart',
55 'appenlight.directives.confirmValidate',
59 'appenlight.directives.confirmValidate',
56 'appenlight.directives.focus',
60 'appenlight.directives.focus',
57 'appenlight.directives.formErrors',
61 'appenlight.directives.formErrors',
58 'appenlight.directives.humanFormat',
62 'appenlight.directives.humanFormat',
59 'appenlight.directives.isoToRelativeTime',
63 'appenlight.directives.isoToRelativeTime',
60 'appenlight.directives.permissionsForm',
64 'appenlight.directives.permissionsForm',
61 'appenlight.directives.smallReportGroupList',
65 'appenlight.directives.smallReportGroupList',
62 'appenlight.directives.smallReportList',
66 'appenlight.directives.smallReportList',
63 'appenlight.directives.pluginConfig',
67 'appenlight.directives.pluginConfig',
64 'appenlight.directives.recursive',
68 'appenlight.directives.recursive',
65 'appenlight.directives.reportAlertAction',
69 'appenlight.directives.reportAlertAction',
66 'appenlight.directives.postProcessAction',
70 'appenlight.directives.postProcessAction',
67 'appenlight.directives.rule',
71 'appenlight.directives.rule',
68 'appenlight.directives.ruleReadOnly'
72 'appenlight.directives.ruleReadOnly'
69 ]);
73 ]);
70 angular.module('appenlight.services', [
74 angular.module('appenlight.services', [
71 'appenlight.services.chartResultParser',
75 'appenlight.services.chartResultParser',
72 'appenlight.services.resources',
76 'appenlight.services.resources',
73 'appenlight.services.stateHolder',
77 'appenlight.services.stateHolder',
74 'appenlight.services.typeAheadTagHelper',
78 'appenlight.services.typeAheadTagHelper',
75 'appenlight.services.UUIDProvider'
79 'appenlight.services.UUIDProvider'
76 ]).value('version', '0.1');
80 ]).value('version', '0.1');
77
81
78
82
79 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
83 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
80 function(item){
84 function(item){
81 return item.config.angular_module
85 return item.config.angular_module
82 });
86 });
83 console.log(pluginsToLoad);
87 console.log(pluginsToLoad);
84 angular.module('appenlight.plugins', pluginsToLoad);
88 angular.module('appenlight.plugins', pluginsToLoad);
85
89
86 var app = angular.module('appenlight', [
90 var app = angular.module('appenlight', [
87 'appenlight.base',
91 'appenlight.base',
88 'appenlight.config',
92 'appenlight.config',
89 'appenlight.templates',
93 'appenlight.templates',
90 'appenlight.filters',
94 'appenlight.filters',
91 'appenlight.services',
95 'appenlight.services',
92 'appenlight.directives',
96 'appenlight.directives',
93 'appenlight.controllers',
97 'appenlight.controllers',
94 'appenlight.components',
98 'appenlight.components',
95 'appenlight.plugins'
99 'appenlight.plugins'
96 ]);
100 ]);
97
101
98 // needs manual execution because of plugin files
102 // needs manual execution because of plugin files
99 function kickstartAE(initialUserData) {
103 function kickstartAE(initialUserData) {
100 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
104 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
101 $locationProvider.html5Mode(true);
105 $locationProvider.html5Mode(true);
102 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
106 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
103 return {
107 return {
104 'response': function (response) {
108 'response': function (response) {
105 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
109 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
106 if (flashMessages && flashMessages.length > 0) {
110 if (flashMessages && flashMessages.length > 0) {
107 stateHolder.flashMessages.extend(flashMessages);
111 stateHolder.flashMessages.extend(flashMessages);
108 }
112 }
109 return response;
113 return response;
110 },
114 },
111 'responseError': function (rejection) {
115 'responseError': function (rejection) {
112 if (rejection.status > 299 && rejection.status !== 422) {
116 if (rejection.status > 299 && rejection.status !== 422) {
113 stateHolder.flashMessages.extend([{
117 stateHolder.flashMessages.extend([{
114 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
118 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
115 type: 'error'
119 type: 'error'
116 }]);
120 }]);
117 }
121 }
118 if (rejection.status == 0) {
122 if (rejection.status == 0) {
119 stateHolder.flashMessages.extend([{
123 stateHolder.flashMessages.extend([{
120 msg: 'Response timeout',
124 msg: 'Response timeout',
121 type: 'error'
125 type: 'error'
122 }]);
126 }]);
123 }
127 }
124 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
128 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
125 if (flashMessages && flashMessages.length > 0) {
129 if (flashMessages && flashMessages.length > 0) {
126 stateHolder.flashMessages.extend(flashMessages);
130 stateHolder.flashMessages.extend(flashMessages);
127 }
131 }
128
132
129 return $q.reject(rejection);
133 return $q.reject(rejection);
130 }
134 }
131 }
135 }
132 }]);
136 }]);
133
137
134 $uibTooltipProvider.options({appendToBody: true});
138 $uibTooltipProvider.options({appendToBody: true});
135
139
136 }]);
140 }]);
137
141
138
142
139 app.config(function ($provide) {
143 app.config(function ($provide) {
140 $provide.decorator("$exceptionHandler", function ($delegate) {
144 $provide.decorator("$exceptionHandler", function ($delegate) {
141 return function (exception, cause) {
145 return function (exception, cause) {
142 $delegate(exception, cause);
146 $delegate(exception, cause);
143 if (typeof AppEnlight !== 'undefined') {
147 if (typeof AppEnlight !== 'undefined') {
144 AppEnlight.grabError(exception);
148 AppEnlight.grabError(exception);
145 }
149 }
146 };
150 };
147 });
151 });
148 });
152 });
149
153
150 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
154 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
151 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
155 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
152 if (initialUserData){
156 if (initialUserData){
153 stateHolder.AeUser.update(initialUserData);
157 stateHolder.AeUser.update(initialUserData);
154 }
158 }
155 $rootScope.$state = $state;
159 $rootScope.$state = $state;
156 $rootScope.stateHolder = stateHolder;
160 $rootScope.stateHolder = stateHolder;
157 $rootScope.flash = stateHolder.flashMessages.list;
161 $rootScope.flash = stateHolder.flashMessages.list;
158 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
162 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
159 $rootScope.AeConfig = AeConfig;
163 $rootScope.AeConfig = AeConfig;
160
164
161 var transitionApp = function($transition$, $state) {
165 var transitionApp = function($transition$, $state) {
162 // redirect user to /register unless its one of open views
166 // redirect user to /register unless its one of open views
163 var isGuestState = [
167 var isGuestState = [
164 'report.view_detail',
168 'report.view_detail',
165 'report.view_group',
169 'report.view_group',
166 'dashboard.view'
170 'dashboard.view'
167 ].indexOf($transition$.to().name) !== -1;
171 ].indexOf($transition$.to().name) !== -1;
168
172
169 var path = $window.location.pathname;
173 var path = $window.location.pathname;
170 // strip trailing slash
174 // strip trailing slash
171 if (path.substr(path.length - 1) === '/') {
175 if (path.substr(path.length - 1) === '/') {
172 path = path.substr(0, path.length - 1);
176 path = path.substr(0, path.length - 1);
173 }
177 }
174 var isOpenView = false;
178 var isOpenView = false;
175 var openViews = [
179 var openViews = [
176 AeConfig.urls.otherRoutes.lostPassword,
180 AeConfig.urls.otherRoutes.lostPassword,
177 AeConfig.urls.otherRoutes.lostPasswordGenerate
181 AeConfig.urls.otherRoutes.lostPasswordGenerate
178 ];
182 ];
179 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
183 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
180 _.each(openViews, function (url) {
184 _.each(openViews, function (url) {
181 var url = '/' + url.split('/').slice(3).join('/');
185 var url = '/' + url.split('/').slice(3).join('/');
182 if (url === path) {
186 if (url === path) {
183 isOpenView = true;
187 isOpenView = true;
184 }
188 }
185 });
189 });
186 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
190 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
187 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
191 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
188 console.log('redirect to register');
192 console.log('redirect to register');
189 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
193 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
190 // fix infinite digest here
194 // fix infinite digest here
191 $rootScope.$on('$locationChangeStart',
195 $rootScope.$on('$locationChangeStart',
192 function(event, toState, toParams, fromState, fromParams, options){
196 function(event, toState, toParams, fromState, fromParams, options){
193 event.preventDefault();
197 event.preventDefault();
194 $window.location = newLocation;
198 $window.location = newLocation;
195 });
199 });
196 $window.location = newLocation;
200 $window.location = newLocation;
197 return false;
201 return false;
198 }
202 }
199 return false;
203 return false;
200 }
204 }
201 return true;
205 return true;
202 };
206 };
203 $transitions.onBefore({}, transitionApp);
207 $transitions.onBefore({}, transitionApp);
204
208
205 }]);
209 }]);
206 }
210 }
@@ -1,30 +1,31 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.components.settingsView', [])
20 angular.module('appenlight.components.settingsView', [])
21 .component('settingsView', {
21 .component('settingsView', {
22 templateUrl: 'components/views/settings-view/settings-view.html',
22 templateUrl: 'components/views/settings-view/settings-view.html',
23 controller: SettingsViewController
23 controller: SettingsViewController
24 });
24 });
25
25
26 SettingsViewController.$inject = [];
26 SettingsViewController.$inject = ['$state'];
27
27
28 function SettingsViewController() {
28 function SettingsViewController($state) {
29 this.$state = $state;
29 console.info('SettingsViewController');
30 console.info('SettingsViewController');
30 }
31 }
@@ -1,30 +1,30 b''
1 <ng-include src="'templates/loader.html'" ng-if="email.loading.email"></ng-include>
1 <ng-include src="'templates/loader.html'" ng-if="$ctrl.loading.email"></ng-include>
2
2
3 <div ng-show="!email.loading.email">
3 <div ng-show="!$ctrl.loading.email">
4
4
5 <div class="panel panel-default">
5 <div class="panel panel-default">
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
7 <div class="panel-body">
7 <div class="panel-body">
8 <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>
8 <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>
9 <form class="form-horizontal" name="email.channelForm" ng-submit="email.createChannel()">
9 <form class="form-horizontal" name="$ctrl.channelForm" ng-submit="$ctrl.createChannel()">
10 <div class="form-group" id="row-email">
10 <div class="form-group" id="row-email">
11 <data-form-errors errors="email.channelForm.ae_validation.email"></data-form-errors>
11 <data-form-errors errors="$ctrl.channelForm.ae_validation.email"></data-form-errors>
12 <label id="label-email" class="control-label col-sm-4 col-lg-3">
12 <label id="label-email" class="control-label col-sm-4 col-lg-3">
13 Email Address
13 Email Address
14 <span class="required">*</span>
14 <span class="required">*</span>
15 </label>
15 </label>
16 <div class="col-sm-8 col-lg-9">
16 <div class="col-sm-8 col-lg-9">
17 <input class="form-control" type="text" ng-model="email.form.email">
17 <input class="form-control" type="text" ng-model="$ctrl.form.email">
18 </div>
18 </div>
19 </div>
19 </div>
20 <div class="form-group">
20 <div class="form-group">
21 <label for="submit" class="control-label col-sm-4 col-lg-3">
21 <label for="submit" class="control-label col-sm-4 col-lg-3">
22 </label>
22 </label>
23 <div class="col-sm-8 col-lg-9">
23 <div class="col-sm-8 col-lg-9">
24 <input class="form-control btn btn-primary" name="submit" type="submit" value="Add email channel">
24 <input class="form-control btn btn-primary" name="submit" type="submit" value="Add email channel">
25 </div>
25 </div>
26 </div>
26 </div>
27 </form>
27 </form>
28 </div>
28 </div>
29 </div>
29 </div>
30 </div>
30 </div>
@@ -1,46 +1,49 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')
20 angular.module('appenlight.components.userAlertChannelsEmailNewView', [])
21 .controller('AlertChannelsEmailController', AlertChannelsEmailController)
21 .component('userAlertChannelsEmailNewView', {
22 templateUrl: 'components/views/user-alert-channel-email-new-view/user-alert-channel-email-new-view.html',
23 controller: AlertChannelsEmailController
24 });
22
25
23 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
26 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
24
27
25 function AlertChannelsEmailController($state, userSelfPropertyResource) {
28 function AlertChannelsEmailController($state, userSelfPropertyResource) {
26 console.debug('AlertChannelsEmailController');
29 console.debug('AlertChannelsEmailController');
27 var vm = this;
30 var vm = this;
28 vm.loading = {email: false};
31 vm.loading = {email: false};
29 vm.form = {};
32 vm.form = {};
30
33
31 vm.createChannel = function () {
34 vm.createChannel = function () {
32 vm.loading.email = true;
35 vm.loading.email = true;
33 console.log('createChannel');
36 console.log('createChannel');
34 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
37 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
35 //vm.loading.email = false;
38 //vm.loading.email = false;
36 //setServerValidation(vm.channelForm);
39 //setServerValidation(vm.channelForm);
37 //vm.form = {};
40 //vm.form = {};
38 $state.go('user.alert_channels.list');
41 $state.go('user.alert_channels.list');
39 }, function (response) {
42 }, function (response) {
40 if (response.status == 422) {
43 if (response.status == 422) {
41 setServerValidation(vm.channelForm, response.data);
44 setServerValidation(vm.channelForm, response.data);
42 }
45 }
43 vm.loading.email = false;
46 vm.loading.email = false;
44 });
47 });
45 }
48 }
46 }
49 }
@@ -1,63 +1,63 b''
1 <ng-include src="'templates/loader.html'" ng-if="channels.loading.channels || channels.loading.applications"></ng-include>
1 <ng-include src="'templates/loader.html'" ng-if="$ctrl.loading.channels || $ctrl.loading.applications"></ng-include>
2
2
3 <div ng-if="!channels.loading.channels && !channels.loading.applications && !channels.loading.actions">
3 <div ng-if="!$ctrl.loading.channels && !$ctrl.loading.applications && !$ctrl.loading.actions">
4
4
5 <div class="panel panel-default">
5 <div class="panel panel-default">
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
7 <div class="panel-body">
7 <div class="panel-body">
8 <h1>Report alert rules</h1>
8 <h1>Report alert rules</h1>
9 <p>
9 <p>
10 <a class="btn btn-info" ng-click="channels.addAction()"><span class="fa fa-plus-circle"></span> Add top-level rule</a>
10 <a class="btn btn-info" ng-click="$ctrl.addAction()"><span class="fa fa-plus-circle"></span> Add top-level rule</a>
11 </p>
11 </p>
12
12
13 <report-alert-action action="action" rule-definitions="channels.ruleDefinitions"
13 <report-alert-action action="action" rule-definitions="$ctrl.ruleDefinitions"
14 possible-channels="channels.alertChannels"
14 possible-channels="$ctrl.alertChannels"
15 actions="channels.alertActions" applications="channels.applications"
15 actions="$ctrl.alertActions" applications="$ctrl.applications"
16 ng-repeat="action in channels.alertActions | filter: {type:'report'}"></report-alert-action>
16 ng-repeat="action in $ctrl.alertActions | filter: {type:'report'}"></report-alert-action>
17
17
18 </div>
18 </div>
19 </div>
19 </div>
20
20
21 <div class="panel panel-default">
21 <div class="panel panel-default">
22 <div class="panel-body">
22 <div class="panel-body">
23 <h1>Alert channels</h1>
23 <h1>Alert channels</h1>
24
24
25 <p>Here you can configure your <em>alert channels</em>.</p>
25 <p>Here you can configure your <em>alert channels</em>.</p>
26
26
27 <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>
27 <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>
28
28
29 <div class="alert alert-success">You can add more integrations that support different alert channels via application management panel.</div>
29 <div class="alert alert-success">You can add more integrations that support different alert channels via application management panel.</div>
30
30
31 <table class="table table-striped">
31 <table class="table table-striped">
32 <tr ng-repeat="channel in channels.alertChannels" class="animate-repeat">
32 <tr ng-repeat="channel in $ctrl.alertChannels" class="animate-repeat">
33 <td><strong>{{ channel.channel_visible_value }}</strong></td>
33 <td><strong>{{ channel.channel_visible_value }}</strong></td>
34 <td class="text-right">
34 <td class="text-right">
35 <span class="btn btn-default" data-uib-tooltip="Channel is {{ channel.channel_validated? '' :'NOT' }} validated" tooltip-append-to-body="true"
35 <span class="btn btn-default" data-uib-tooltip="Channel is {{ channel.channel_validated? '' :'NOT' }} validated" tooltip-append-to-body="true"
36 ng-class="{dim:!channel.channel_validated}">
36 ng-class="{dim:!channel.channel_validated}">
37 <span class="fa" ng-class="{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}"></span>
37 <span class="fa" ng-class="{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}"></span>
38 </span>
38 </span>
39 <a class="btn btn-default" data-uib-tooltip="Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel"
39 <a class="btn btn-default" data-uib-tooltip="Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel"
40 ng-click="channels.updateChannel(channel,'send_alerts')" ng-class="{dim:!channel.send_alerts}" tooltip-append-to-body="true">
40 ng-click="$ctrl.updateChannel(channel,'send_alerts')" ng-class="{dim:!channel.send_alerts}" tooltip-append-to-body="true">
41 <span class="fa fa-rss"></span> Alerts
41 <span class="fa fa-rss"></span> Alerts
42 </a>
42 </a>
43 <a class="btn btn-default" data-uib-tooltip="Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel"
43 <a class="btn btn-default" data-uib-tooltip="Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel"
44 ng-click="channels.updateChannel(channel,'daily_digest')" ng-class="{dim:!channel.daily_digest}" tooltip-append-to-body="true">
44 ng-click="$ctrl.updateChannel(channel,'daily_digest')" ng-class="{dim:!channel.daily_digest}" tooltip-append-to-body="true">
45 <span class="fa fa-envelope"></span> Daily digests
45 <span class="fa fa-envelope"></span> Daily digests
46 </a>
46 </a>
47
47
48 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
48 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
49 <a class="btn btn-default" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span> Remove</a>
49 <a class="btn btn-default" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span> Remove</a>
50 <ul class="dropdown-menu">
50 <ul class="dropdown-menu">
51 <li><a>No</a></li>
51 <li><a>No</a></li>
52 <li><a ng-click="channels.removeChannel(channel)">Yes</a></li>
52 <li><a ng-click="$ctrl.removeChannel(channel)">Yes</a></li>
53 </ul>
53 </ul>
54 </span>
54 </span>
55
55
56 </td>
56 </td>
57 </tr>
57 </tr>
58 </table>
58 </table>
59
59
60 </div>
60 </div>
61 </div>
61 </div>
62
62
63 </div>
63 </div>
@@ -1,130 +1,134 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('AlertChannelsController', AlertChannelsController);
20 angular.module('appenlight.components.userAlertChannelsListView', [])
21 .component('userAlertChannelsListView', {
22 templateUrl: 'components/views/user-alert-channels-list-view/user-alert-channels-list-view.html',
23 controller: userAlertChannelsListViewController
24 });
21
25
22 AlertChannelsController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
26 userAlertChannelsListViewController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
23
27
24 function AlertChannelsController(userSelfPropertyResource, applicationsNoIdResource) {
28 function userAlertChannelsListViewController(userSelfPropertyResource, applicationsNoIdResource) {
25 console.debug('AlertChannelsController');
29 console.debug('AlertChannelsController');
26 var vm = this;
30 var vm = this;
27 vm.loading = {channels: true, applications: true, actions:true};
31 vm.loading = {channels: true, applications: true, actions:true};
28
32
29 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
33 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
30 function (data) {
34 function (data) {
31 vm.loading.channels = false;
35 vm.loading.channels = false;
32 });
36 });
33
37
34 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
38 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
35 function (data) {
39 function (data) {
36 vm.loading.actions = false;
40 vm.loading.actions = false;
37 });
41 });
38
42
39 vm.applications = applicationsNoIdResource.query({permission: 'view'},
43 vm.applications = applicationsNoIdResource.query({permission: 'view'},
40 function (data) {
44 function (data) {
41 vm.loading.applications = false;
45 vm.loading.applications = false;
42 });
46 });
43
47
44 var allOps = {
48 var allOps = {
45 'eq': 'Equal',
49 'eq': 'Equal',
46 'ne': 'Not equal',
50 'ne': 'Not equal',
47 'ge': 'Greater or equal',
51 'ge': 'Greater or equal',
48 'gt': 'Greater than',
52 'gt': 'Greater than',
49 'le': 'Lesser or equal',
53 'le': 'Lesser or equal',
50 'lt': 'Lesser than',
54 'lt': 'Lesser than',
51 'startswith': 'Starts with',
55 'startswith': 'Starts with',
52 'endswith': 'Ends with',
56 'endswith': 'Ends with',
53 'contains': 'Contains'
57 'contains': 'Contains'
54 };
58 };
55
59
56 var fieldOps = {};
60 var fieldOps = {};
57 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
61 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
58 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
62 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
59 fieldOps['duration'] = ['ge', 'le'];
63 fieldOps['duration'] = ['ge', 'le'];
60 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
64 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
61 'contains'];
65 'contains'];
62 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
66 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
63 'contains'];
67 'contains'];
64 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
68 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
65 'contains'];
69 'contains'];
66 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
70 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
67 'contains'];
71 'contains'];
68 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
72 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
69
73
70 var possibleFields = {
74 var possibleFields = {
71 '__AND__': 'All met (composite rule)',
75 '__AND__': 'All met (composite rule)',
72 '__OR__': 'One met (composite rule)',
76 '__OR__': 'One met (composite rule)',
73 '__NOT__': 'Not met (composite rule)',
77 '__NOT__': 'Not met (composite rule)',
74 'http_status': 'HTTP Status',
78 'http_status': 'HTTP Status',
75 'duration': 'Request duration',
79 'duration': 'Request duration',
76 'group:priority': 'Group -> Priority',
80 'group:priority': 'Group -> Priority',
77 'url_domain': 'Domain',
81 'url_domain': 'Domain',
78 'url_path': 'URL Path',
82 'url_path': 'URL Path',
79 'error': 'Error',
83 'error': 'Error',
80 'tags:server_name': 'Tag -> Server name',
84 'tags:server_name': 'Tag -> Server name',
81 'group:occurences': 'Group -> Occurences'
85 'group:occurences': 'Group -> Occurences'
82 };
86 };
83
87
84 vm.ruleDefinitions = {
88 vm.ruleDefinitions = {
85 fieldOps: fieldOps,
89 fieldOps: fieldOps,
86 allOps: allOps,
90 allOps: allOps,
87 possibleFields: possibleFields
91 possibleFields: possibleFields
88 };
92 };
89
93
90 vm.addAction = function (channel) {
94 vm.addAction = function (channel) {
91 console.log('test');
95 console.log('test');
92 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
96 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
93 vm.alertActions.push(data);
97 vm.alertActions.push(data);
94 }, function (response) {
98 }, function (response) {
95 if (response.status == 422) {
99 if (response.status == 422) {
96 console.log('scope', response);
100 console.log('scope', response);
97 }
101 }
98 });
102 });
99 };
103 };
100
104
101 vm.updateChannel = function (channel, subKey) {
105 vm.updateChannel = function (channel, subKey) {
102 var params = {
106 var params = {
103 key: 'alert_channels',
107 key: 'alert_channels',
104 channel_name: channel['channel_name'],
108 channel_name: channel['channel_name'],
105 channel_value: channel['channel_value']
109 channel_value: channel['channel_value']
106 };
110 };
107 var toUpdate = {};
111 var toUpdate = {};
108 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
112 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
109 toUpdate[subKey] = !channel[subKey];
113 toUpdate[subKey] = !channel[subKey];
110 }
114 }
111 userSelfPropertyResource.update(params, toUpdate, function (data) {
115 userSelfPropertyResource.update(params, toUpdate, function (data) {
112 _.extend(channel, data);
116 _.extend(channel, data);
113 });
117 });
114 };
118 };
115
119
116 vm.removeChannel = function (channel) {
120 vm.removeChannel = function (channel) {
117 console.log(channel);
121 console.log(channel);
118 userSelfPropertyResource.delete({
122 userSelfPropertyResource.delete({
119 key: 'alert_channels',
123 key: 'alert_channels',
120 channel_name: channel.channel_name,
124 channel_name: channel.channel_name,
121 channel_value: channel.channel_value
125 channel_value: channel.channel_value
122 }, function () {
126 }, function () {
123 vm.alertChannels = _.filter(vm.alertChannels, function(item){
127 vm.alertChannels = _.filter(vm.alertChannels, function(item){
124 return item != channel;
128 return item != channel;
125 });
129 });
126 });
130 });
127
131
128 }
132 }
129
133
130 }
134 }
@@ -1,83 +1,83 b''
1 <ng-include src="'templates/loader.html'" ng-if="auth_tokens.loading.tokens"></ng-include>
1 <ng-include src="'templates/loader.html'" ng-if="$ctrl.loading.tokens"></ng-include>
2
2
3 <div ng-show="!auth_tokens.loading.tokens">
3 <div ng-show="!$ctrl.loading.tokens">
4
4
5 <div class="panel panel-default">
5 <div class="panel panel-default">
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
7
7
8 <div class="panel-body">
8 <div class="panel-body">
9
9
10 <div class="alert alert-success">You can use those tokens to authenticate yourself when performing various API calls</div>
10 <div class="alert alert-success">You can use those tokens to authenticate yourself when performing various API calls</div>
11
11
12 <hr/>
12 <hr/>
13
13
14 <form method="post" class="form-inline" name="auth_tokens.TokenForm" ng-submit="auth_tokens.addToken()" novalidate>
14 <form method="post" class="form-inline" name="$ctrl.TokenForm" ng-submit="$ctrl.addToken()" novalidate>
15 <data-form-errors errors="auth_tokens.TokenForm.ae_validation.description"></data-form-errors>
15 <data-form-errors errors="$ctrl.TokenForm.ae_validation.description"></data-form-errors>
16 <data-form-errors errors="auth_tokens.TokenForm.ae_validation.expires"></data-form-errors>
16 <data-form-errors errors="$ctrl.TokenForm.ae_validation.expires"></data-form-errors>
17 <div class="form-group">
17 <div class="form-group">
18 <label>
18 <label>
19 Description
19 Description
20 </label>
20 </label>
21 <input class="form-control" name="description" placeholder="Token description" type="text" ng-model="auth_tokens.form.description">
21 <input class="form-control" name="description" placeholder="Token description" type="text" ng-model="$ctrl.form.description">
22 </div>
22 </div>
23 <div class="form-group">
23 <div class="form-group">
24 <label>
24 <label>
25 Expires
25 Expires
26 </label>
26 </label>
27 <select class="form-control" ng-model="auth_tokens.form.expires" ng-options="i.key as i.label for i in auth_tokens.expireOptions | objectToOrderedArray:'minutes'">
27 <select class="form-control" ng-model="$ctrl.form.expires" ng-options="i.key as i.label for i in $ctrl.expireOptions | objectToOrderedArray:'minutes'">
28 <option value="">Never</option>
28 <option value="">Never</option>
29 </select>
29 </select>
30 </div>
30 </div>
31 <div class="form-group">
31 <div class="form-group">
32 <label class="control-label col-sm-4 col-lg-3">
32 <label class="control-label col-sm-4 col-lg-3">
33 </label>
33 </label>
34 <input class="form-control btn btn-primary" name="submit" type="submit" value="Create Token">
34 <input class="form-control btn btn-primary" name="submit" type="submit" value="Create Token">
35 </div>
35 </div>
36 </form>
36 </form>
37
37
38 </div>
38 </div>
39
39
40
40
41 </div>
41 </div>
42
42
43 <div class="panel panel-default">
43 <div class="panel panel-default">
44 <table st-table="displayedCollection" st-safe-src="auth_tokens.tokens" class="table table-striped">
44 <table st-table="displayedCollection" st-safe-src="$ctrl.tokens" class="table table-striped">
45 <caption>Your current tokens</caption>
45 <caption>Your current tokens</caption>
46 <thead>
46 <thead>
47 <tr>
47 <tr>
48 <th st-sort="description"><a>Description</a></th>
48 <th st-sort="description"><a>Description</a></th>
49 <th class="created"><a>Created</a></th>
49 <th class="created"><a>Created</a></th>
50 <th class="expires"><a>Expires</a></th>
50 <th class="expires"><a>Expires</a></th>
51 <th class="options"></th>
51 <th class="options"></th>
52 </tr>
52 </tr>
53 <tr>
53 <tr>
54 <th><input st-search="description" placeholder="search for description" class="form-control" type="search" st-delay="1"/></th>
54 <th><input st-search="description" placeholder="search for description" class="form-control" type="search" st-delay="1"/></th>
55 <th></th>
55 <th></th>
56 <th></th>
56 <th></th>
57 <th></th>
57 <th></th>
58 </tr>
58 </tr>
59 </thead>
59 </thead>
60 <tbody>
60 <tbody>
61
61
62 <tr ng-repeat="token in displayedCollection">
62 <tr ng-repeat="token in displayedCollection">
63 <td><p>{{token.description}}</p>
63 <td><p>{{token.description}}</p>
64 <pre ng-init="token.limit = 8" ng-mouseover="token.limit = 99" ng-mouseleave="token.limit = 8">{{token.token| limitTo:token.limit}}...</pre>
64 <pre ng-init="token.limit = 8" ng-mouseover="token.limit = 99" ng-mouseleave="token.limit = 8">{{token.token| limitTo:token.limit}}...</pre>
65 </td>
65 </td>
66 <td><span data-uib-tooltip="{{token.creation_date}}">{{token.creation_date | isoToRelativeTime}}</span></td>
66 <td><span data-uib-tooltip="{{token.creation_date}}">{{token.creation_date | isoToRelativeTime}}</span></td>
67 <td><span ng-if="token.expires" data-uib-tooltip="{{token.expires}}">{{token.expires | isoToRelativeTime}}</span>
67 <td><span ng-if="token.expires" data-uib-tooltip="{{token.expires}}">{{token.expires | isoToRelativeTime}}</span>
68 <span ng-if="!token.expires">Never</span></td>
68 <span ng-if="!token.expires">Never</span></td>
69 <td>
69 <td>
70 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
70 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
71 <a class="btn btn-danger" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span></a>
71 <a class="btn btn-danger" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span></a>
72 <ul class="dropdown-menu">
72 <ul class="dropdown-menu">
73 <li><a>No</a></li>
73 <li><a>No</a></li>
74 <li><a ng-click="auth_tokens.removeToken(token)">Yes</a></li>
74 <li><a ng-click="$ctrl.removeToken(token)">Yes</a></li>
75 </ul>
75 </ul>
76 </span>
76 </span>
77 </td>
77 </td>
78 </tr>
78 </tr>
79 </tbody>
79 </tbody>
80 </table>
80 </table>
81 </div>
81 </div>
82
82
83 </div>
83 </div>
@@ -1,63 +1,69 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('UserAuthTokensController', UserAuthTokensController);
20 angular.module('appenlight.components.userAuthTokensView', [])
21 .component('userAuthTokensView', {
22 templateUrl: 'components/views/user-auth-tokens-view/user-auth-tokens-view.html',
23 controller: userAuthTokensViewController
24 });
21
25
22 UserAuthTokensController.$inject = ['$filter', 'userSelfPropertyResource', 'AeConfig'];
26 userAuthTokensViewController.$inject = ['userSelfPropertyResource', 'AeConfig'];
23
27
24 function UserAuthTokensController($filter, userSelfPropertyResource, AeConfig) {
28 function userAuthTokensViewController(userSelfPropertyResource, AeConfig) {
25 console.debug('UserAuthTokensController');
29 console.debug('userAuthTokensViewController');
26 var vm = this;
30 var vm = this;
27 vm.loading = {tokens: true};
31 vm.loading = {tokens: true};
28
32
29 vm.expireOptions = AeConfig.timeOptions;
33 vm.expireOptions = AeConfig.timeOptions;
30
34
31 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
35 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
32 function (data) {
36 function (data) {
33 vm.loading.tokens = false;
37 vm.loading.tokens = false;
34 });
38 });
35
39
36 vm.addToken = function () {
40 vm.addToken = function () {
37 vm.loading.tokens = true;
41 vm.loading.tokens = true;
38 userSelfPropertyResource.save({key: 'auth_tokens'},
42 userSelfPropertyResource.save({key: 'auth_tokens'},
39 vm.form,
43 vm.form,
40 function (data) {
44 function (data) {
41 vm.loading.tokens = false;
45 vm.loading.tokens = false;
42 setServerValidation(vm.TokenForm);
46 setServerValidation(vm.TokenForm);
43 vm.form = {};
47 vm.form = {};
44 vm.tokens.push(data);
48 vm.tokens.push(data);
45 }, function (response) {
49 }, function (response) {
46 vm.loading.tokens = false;
50 vm.loading.tokens = false;
47 if (response.status == 422) {
51 if (response.status == 422) {
48 setServerValidation(vm.TokenForm, response.data);
52 setServerValidation(vm.TokenForm, response.data);
49 }
53 }
50 })
54 })
51 }
55 };
52
56
53 vm.removeToken = function (token) {
57 vm.removeToken = function (token) {
54 userSelfPropertyResource.delete({key: 'auth_tokens',
58 userSelfPropertyResource.delete({
55 token:token.token},
59 key: 'auth_tokens',
60 token: token.token
61 },
56 function () {
62 function () {
57 var index = vm.tokens.indexOf(token);
63 var index = vm.tokens.indexOf(token);
58 if (index !== -1) {
64 if (index !== -1) {
59 vm.tokens.splice(index, 1);
65 vm.tokens.splice(index, 1);
60 }
66 }
61 })
67 })
62 }
68 }
63 }
69 }
@@ -1,50 +1,50 b''
1 <ng-include src="'templates/loader.html'" ng-if="password.loading.password"></ng-include>
1 <ng-include src="'templates/loader.html'" ng-if="$ctrl.loading.password"></ng-include>
2
2
3 <div ng-show="!password.loading.password">
3 <div ng-show="!$ctrl.loading.password">
4
4
5 <div class="panel panel-default">
5 <div class="panel panel-default">
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
6 <div class="panel-heading" ng-include="'templates/user/breadcrumbs.html'"></div>
7 <div class="panel-body">
7 <div class="panel-body">
8
8
9 <form class="form-horizontal" name="password.passwordForm" ng-submit="password.updatePassword()">
9 <form class="form-horizontal" name="$ctrl.passwordForm" ng-submit="$ctrl.updatePassword()">
10 <div class="form-group" id="row-old_password">
10 <div class="form-group" id="row-old_password">
11 <data-form-errors errors="password.passwordForm.ae_validation.old_password"></data-form-errors>
11 <data-form-errors errors="$ctrl.passwordForm.ae_validation.old_password"></data-form-errors>
12 <label for="old_password" id="label-old_password" class="control-label col-sm-4 col-lg-3">
12 <label for="old_password" id="label-old_password" class="control-label col-sm-4 col-lg-3">
13 Old Password
13 Old Password
14 <span class="required">*</span>
14 <span class="required">*</span>
15 </label>
15 </label>
16 <div class="col-sm-8 col-lg-9">
16 <div class="col-sm-8 col-lg-9">
17 <input class="form-control" id="old_password" name="old_password" type="password" ng-model="password.form.old_password">
17 <input class="form-control" id="old_password" name="old_password" type="password" ng-model="$ctrl.form.old_password">
18 </div>
18 </div>
19 </div>
19 </div>
20 <div class="form-group" id="row-new_password">
20 <div class="form-group" id="row-new_password">
21 <data-form-errors errors="password.passwordForm.ae_validation.new_password"></data-form-errors>
21 <data-form-errors errors="$ctrl.passwordForm.ae_validation.new_password"></data-form-errors>
22 <label for="new_password" id="label-new_password" class="control-label col-sm-4 col-lg-3">
22 <label for="new_password" id="label-new_password" class="control-label col-sm-4 col-lg-3">
23 New Password
23 New Password
24 <span class="required">*</span>
24 <span class="required">*</span>
25 </label>
25 </label>
26 <div class="col-sm-8 col-lg-9">
26 <div class="col-sm-8 col-lg-9">
27 <input class="form-control" id="new_password" name="new_password" type="password" ng-model="password.form.new_password">
27 <input class="form-control" id="new_password" name="new_password" type="password" ng-model="$ctrl.form.new_password">
28 </div>
28 </div>
29 </div>
29 </div>
30 <div class="form-group" id="row-new_password_confirm">
30 <div class="form-group" id="row-new_password_confirm">
31 <data-form-errors errors="password.passwordForm.ae_validation.new_password_confirm"></data-form-errors>
31 <data-form-errors errors="$ctrl.passwordForm.ae_validation.new_password_confirm"></data-form-errors>
32 <label for="new_password_confirm" id="label-new_password_confirm" class="control-label col-sm-4 col-lg-3">
32 <label for="new_password_confirm" id="label-new_password_confirm" class="control-label col-sm-4 col-lg-3">
33 Confirm Password
33 Confirm Password
34 <span class="required">*</span>
34 <span class="required">*</span>
35 </label>
35 </label>
36 <div class="col-sm-8 col-lg-9">
36 <div class="col-sm-8 col-lg-9">
37 <input class="form-control" id="new_password_confirm" name="new_password_confirm" type="password" ng-model="password.form.new_password_confirm">
37 <input class="form-control" id="new_password_confirm" name="new_password_confirm" type="password" ng-model="$ctrl.form.new_password_confirm">
38 </div>
38 </div>
39 </div>
39 </div>
40 <div class="form-group" id="row-submit">
40 <div class="form-group" id="row-submit">
41 <label for="submit" id="label-submit" class="control-label col-sm-4 col-lg-3"></label>
41 <label for="submit" id="label-submit" class="control-label col-sm-4 col-lg-3"></label>
42 <div class="col-sm-8 col-lg-9">
42 <div class="col-sm-8 col-lg-9">
43 <input class="form-control SubmitField btn btn-primary" id="submit" name="submit" type="submit" value="Change Password">
43 <input class="form-control SubmitField btn btn-primary" id="submit" name="submit" type="submit" value="Change Password">
44 </div>
44 </div>
45 </div>
45 </div>
46 </form>
46 </form>
47
47
48 </div>
48 </div>
49 </div>
49 </div>
50 </div>
50 </div>
@@ -1,47 +1,50 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')
20 angular.module('appenlight.components.userPasswordView', [])
21 .controller('UserPasswordController', UserPasswordController)
21 .component('userPasswordView', {
22 templateUrl: 'components/views/user-password-view/user-password-view.html',
23 controller: UserPasswordViewController
24 });
22
25
23 UserPasswordController.$inject = ['userSelfPropertyResource'];
26 UserPasswordViewController.$inject = ['userSelfPropertyResource'];
24
27
25 function UserPasswordController(userSelfPropertyResource) {
28 function UserPasswordViewController(userSelfPropertyResource) {
26 console.debug('UserPasswordController');
29 console.debug('UserPasswordViewController');
27 var vm = this;
30 var vm = this;
28 vm.loading = {password: false};
31 vm.loading = {password: false};
29 vm.form = {};
32 vm.form = {};
30
33
31 vm.updatePassword = function () {
34 vm.updatePassword = function () {
32 vm.loading.password = true;
35 vm.loading.password = true;
33 console.log('updatePassword');
36 console.log('updatePassword');
34 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
37 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
35 vm.loading.password = false;
38 vm.loading.password = false;
36 vm.form = {};
39 vm.form = {};
37 setServerValidation(vm.passwordForm);
40 setServerValidation(vm.passwordForm);
38 }, function (response) {
41 }, function (response) {
39 if (response.status == 422) {
42 if (response.status == 422) {
40 console.log('vm',vm);
43 console.log('vm', vm);
41 setServerValidation(vm.passwordForm, response.data);
44 setServerValidation(vm.passwordForm, response.data);
42 console.log(response.data);
45 console.log(response.data);
43 }
46 }
44 vm.loading.password = false;
47 vm.loading.password = false;
45 });
48 });
46 }
49 }
47 }
50 }
@@ -1,244 +1,240 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 component: 'eventBrowserView'
64 component: 'eventBrowserView'
65 });
65 });
66 $stateProvider.state('admin', {
66 $stateProvider.state('admin', {
67 url: '/ui/admin',
67 url: '/ui/admin',
68 templateUrl: 'templates/admin/parent_view.html'
68 templateUrl: 'templates/admin/parent_view.html'
69 });
69 });
70 $stateProvider.state('admin.user', {
70 $stateProvider.state('admin.user', {
71 abstract: true,
71 abstract: true,
72 url: '/user',
72 url: '/user',
73 templateUrl: 'templates/admin/users/parent_view.html'
73 templateUrl: 'templates/admin/users/parent_view.html'
74 });
74 });
75 $stateProvider.state('admin.user.list', {
75 $stateProvider.state('admin.user.list', {
76 url: '/list',
76 url: '/list',
77 templateUrl: 'templates/admin/users/users_list.html',
77 templateUrl: 'templates/admin/users/users_list.html',
78 controller: 'AdminUsersController as users'
78 controller: 'AdminUsersController as users'
79 });
79 });
80 $stateProvider.state('admin.user.create', {
80 $stateProvider.state('admin.user.create', {
81 url: '/create',
81 url: '/create',
82 templateUrl: 'templates/admin/users/users_create.html',
82 templateUrl: 'templates/admin/users/users_create.html',
83 controller: 'AdminUsersCreateController as user'
83 controller: 'AdminUsersCreateController as user'
84 });
84 });
85 $stateProvider.state('admin.user.update', {
85 $stateProvider.state('admin.user.update', {
86 url: '/{userId}/update',
86 url: '/{userId}/update',
87 templateUrl: 'templates/admin/users/users_create.html',
87 templateUrl: 'templates/admin/users/users_create.html',
88 controller: 'AdminUsersCreateController as user'
88 controller: 'AdminUsersCreateController as user'
89 });
89 });
90
90
91
91
92 $stateProvider.state('admin.group', {
92 $stateProvider.state('admin.group', {
93 abstract: true,
93 abstract: true,
94 url: '/group',
94 url: '/group',
95 templateUrl: 'templates/admin/groups/parent_view.html'
95 templateUrl: 'templates/admin/groups/parent_view.html'
96 });
96 });
97 $stateProvider.state('admin.group.list', {
97 $stateProvider.state('admin.group.list', {
98 url: '/list',
98 url: '/list',
99 templateUrl: 'templates/admin/groups/groups_list.html',
99 templateUrl: 'templates/admin/groups/groups_list.html',
100 controller: 'AdminGroupsController as groups'
100 controller: 'AdminGroupsController as groups'
101 });
101 });
102 $stateProvider.state('admin.group.create', {
102 $stateProvider.state('admin.group.create', {
103 url: '/create',
103 url: '/create',
104 templateUrl: 'templates/admin/groups/groups_create.html',
104 templateUrl: 'templates/admin/groups/groups_create.html',
105 controller: 'AdminGroupsCreateController as group'
105 controller: 'AdminGroupsCreateController as group'
106 });
106 });
107 $stateProvider.state('admin.group.update', {
107 $stateProvider.state('admin.group.update', {
108 url: '/{groupId}/update',
108 url: '/{groupId}/update',
109 templateUrl: 'templates/admin/groups/groups_create.html',
109 templateUrl: 'templates/admin/groups/groups_create.html',
110 controller: 'AdminGroupsCreateController as group'
110 controller: 'AdminGroupsCreateController as group'
111 });
111 });
112
112
113 $stateProvider.state('admin.application', {
113 $stateProvider.state('admin.application', {
114 abstract: true,
114 abstract: true,
115 url: '/application',
115 url: '/application',
116 templateUrl: 'templates/admin/users/parent_view.html'
116 templateUrl: 'templates/admin/users/parent_view.html'
117 });
117 });
118
118
119 $stateProvider.state('admin.application.list', {
119 $stateProvider.state('admin.application.list', {
120 url: '/list',
120 url: '/list',
121 templateUrl: 'templates/admin/applications/applications_list.html',
121 templateUrl: 'templates/admin/applications/applications_list.html',
122 controller: 'AdminApplicationsListController as applications'
122 controller: 'AdminApplicationsListController as applications'
123 });
123 });
124
124
125 $stateProvider.state('admin.partitions', {
125 $stateProvider.state('admin.partitions', {
126 url: '/partitions',
126 url: '/partitions',
127 templateUrl: 'templates/admin/partitions.html',
127 templateUrl: 'templates/admin/partitions.html',
128 controller: 'AdminPartitionsController as partitions'
128 controller: 'AdminPartitionsController as partitions'
129 });
129 });
130 $stateProvider.state('admin.system', {
130 $stateProvider.state('admin.system', {
131 url: '/system',
131 url: '/system',
132 templateUrl: 'templates/admin/system.html',
132 templateUrl: 'templates/admin/system.html',
133 controller: 'AdminSystemController as system'
133 controller: 'AdminSystemController as system'
134 });
134 });
135
135
136 $stateProvider.state('admin.configs', {
136 $stateProvider.state('admin.configs', {
137 abstract: true,
137 abstract: true,
138 url: '/configs',
138 url: '/configs',
139 templateUrl: 'templates/admin/configs/parent_view.html'
139 templateUrl: 'templates/admin/configs/parent_view.html'
140 });
140 });
141
141
142 $stateProvider.state('admin.configs.list', {
142 $stateProvider.state('admin.configs.list', {
143 url: '/list',
143 url: '/list',
144 templateUrl: 'templates/admin/configs/edit.html',
144 templateUrl: 'templates/admin/configs/edit.html',
145 controller: 'ConfigsListController as configs'
145 controller: 'ConfigsListController as configs'
146 });
146 });
147
147
148 $stateProvider.state('user', {
148 $stateProvider.state('user', {
149 url: '/ui/user',
149 url: '/ui/user',
150 component: 'settingsView'
150 component: 'settingsView'
151 });
151 });
152
152
153 $stateProvider.state('user.profile', {
153 $stateProvider.state('user.profile', {
154 abstract: true,
154 abstract: true,
155 template: '<ui-view></ui-view>'
155 template: '<ui-view></ui-view>'
156 });
156 });
157 $stateProvider.state('user.profile.edit', {
157 $stateProvider.state('user.profile.edit', {
158 url: '/profile',
158 url: '/profile',
159 component: 'userProfileView'
159 component: 'userProfileView'
160 });
160 });
161
161
162
162
163 $stateProvider.state('user.profile.password', {
163 $stateProvider.state('user.profile.password', {
164 url: '/password',
164 url: '/password',
165 templateUrl: 'templates/user/profile_password.html',
165 component: 'userPasswordView'
166 controller: 'UserPasswordController as password'
167 });
166 });
168
167
169 $stateProvider.state('user.profile.identities', {
168 $stateProvider.state('user.profile.identities', {
170 url: '/identities',
169 url: '/identities',
171 component: 'userIdentitiesView'
170 component: 'userIdentitiesView'
172 });
171 });
173
172
174 $stateProvider.state('user.profile.auth_tokens', {
173 $stateProvider.state('user.profile.auth_tokens', {
175 url: '/auth_tokens',
174 url: '/auth_tokens',
176 templateUrl: 'templates/user/auth_tokens.html',
175 component: 'userAuthTokensView'
177 controller: 'UserAuthTokensController as auth_tokens'
178 });
176 });
179
177
180 $stateProvider.state('user.alert_channels', {
178 $stateProvider.state('user.alert_channels', {
181 abstract: true,
179 abstract: true,
182 url: '/alert_channels',
180 url: '/alert_channels',
183 templateUrl: 'templates/user/alert_channels.html'
181 template: '<ui-view></ui-view>'
184 });
182 });
185
183
186 $stateProvider.state('user.alert_channels.list', {
184 $stateProvider.state('user.alert_channels.list', {
187 url: '/list',
185 url: '/list',
188 templateUrl: 'templates/user/alert_channels_list.html',
186 component: 'userAlertChannelsListView'
189 controller: 'AlertChannelsController as channels'
190 });
187 });
191
188
192 $stateProvider.state('user.alert_channels.email', {
189 $stateProvider.state('user.alert_channels.email', {
193 url: '/email',
190 url: '/email',
194 templateUrl: 'templates/user/alert_channels_email.html',
191 component: 'userAlertChannelsEmailNewView'
195 controller: 'AlertChannelsEmailController as email'
196 });
192 });
197
193
198 $stateProvider.state('applications', {
194 $stateProvider.state('applications', {
199 abstract: true,
195 abstract: true,
200 url: '/ui/applications',
196 url: '/ui/applications',
201 templateUrl: 'templates/applications/parent_view.html'
197 templateUrl: 'templates/applications/parent_view.html'
202 });
198 });
203
199
204 $stateProvider.state('applications.list', {
200 $stateProvider.state('applications.list', {
205 url: '/list',
201 url: '/list',
206 templateUrl: 'templates/applications/list.html',
202 templateUrl: 'templates/applications/list.html',
207 controller: 'ApplicationsListController as applications'
203 controller: 'ApplicationsListController as applications'
208 });
204 });
209 $stateProvider.state('applications.update', {
205 $stateProvider.state('applications.update', {
210 url: '/{resourceId}/update',
206 url: '/{resourceId}/update',
211 templateUrl: 'templates/applications/applications_update.html',
207 templateUrl: 'templates/applications/applications_update.html',
212 controller: 'ApplicationsUpdateController as application'
208 controller: 'ApplicationsUpdateController as application'
213 });
209 });
214
210
215 $stateProvider.state('applications.integrations', {
211 $stateProvider.state('applications.integrations', {
216 url: '/{resourceId}/integrations',
212 url: '/{resourceId}/integrations',
217 templateUrl: 'templates/applications/integrations.html',
213 templateUrl: 'templates/applications/integrations.html',
218 controller: 'IntegrationsListController as integrations',
214 controller: 'IntegrationsListController as integrations',
219 data: {
215 data: {
220 resource: null
216 resource: null
221 }
217 }
222 });
218 });
223
219
224 $stateProvider.state('applications.purge_logs', {
220 $stateProvider.state('applications.purge_logs', {
225 url: '/purge_logs',
221 url: '/purge_logs',
226 templateUrl: 'templates/applications/applications_purge_logs.html',
222 templateUrl: 'templates/applications/applications_purge_logs.html',
227 controller: 'ApplicationsPurgeLogsController as applications_purge'
223 controller: 'ApplicationsPurgeLogsController as applications_purge'
228 });
224 });
229
225
230 $stateProvider.state('applications.integrations.edit', {
226 $stateProvider.state('applications.integrations.edit', {
231 url: '/{integration}',
227 url: '/{integration}',
232 templateUrl: function ($stateParams) {
228 templateUrl: function ($stateParams) {
233 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
229 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
234 },
230 },
235 controller: 'IntegrationController as integration'
231 controller: 'IntegrationController as integration'
236 });
232 });
237
233
238 $stateProvider.state('tests', {
234 $stateProvider.state('tests', {
239 url: '/ui/tests',
235 url: '/ui/tests',
240 templateUrl: 'templates/user/alert_channels_test.html',
236 templateUrl: 'templates/user/alert_channels_test.html',
241 controller: 'AlertChannelsTestController as test_action'
237 controller: 'AlertChannelsTestController as test_action'
242 });
238 });
243
239
244 }]);
240 }]);
@@ -1,12 +1,11 b''
1 <ol class="breadcrumb" ng-show="$state.includes('user.profile')">
1 <ol class="breadcrumb" ng-show="$state.includes('user.profile')">
2 <li>Settings</li>
2 <li>Settings</li>
3 <li ng-show="$state.includes('user.profile.edit')" ng-class="{bold:$state.is('user.profile.edit')}">User Profile</li>
3 <li ng-show="$state.includes('user.profile.edit')" ng-class="{bold:$state.is('user.profile.edit')}">User Profile</li>
4 <li ng-show="$state.includes('user.profile.password')" ng-class="{bold:$state.is('user.profile.password')}">Password</li>
4 <li ng-show="$state.includes('user.profile.password')" ng-class="{bold:$state.is('user.profile.password')}">Password</li>
5 <li ng-show="$state.includes('user.profile.identities')" ng-class="{bold:$state.is('user.profile.identities')}">Identities</li>
5 <li ng-show="$state.includes('user.profile.identities')" ng-class="{bold:$state.is('user.profile.identities')}">Identities</li>
6 </ol>
6 </ol>
7
8 <ol class="breadcrumb" ng-show="$state.includes('user.alert_channels')">
7 <ol class="breadcrumb" ng-show="$state.includes('user.alert_channels')">
9 <li>Notifications</li>
8 <li>Notifications</li>
10 <li ng-show="$state.includes('user.alert_channels.list')" ng-class="{bold:$state.is('user.alert_channels.list')}">Alert Channels</li>
9 <li ng-show="$state.includes('user.alert_channels.list')" ng-class="{bold:$state.is('user.alert_channels.list')}">Alert Channels</li>
11 <li ng-show="$state.includes('user.alert_channels.email')" ng-class="{bold:$state.is('user.alert_channels.email')}">Create email channel</li>
10 <li ng-show="$state.includes('user.alert_channels.email')" ng-class="{bold:$state.is('user.alert_channels.email')}">Create email channel</li>
12 </ol>
11 </ol>
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now