Show More
@@ -2709,7 +2709,6 b" angular.module('appenlight.plugins', pluginsToLoad);" | |||
|
2709 | 2709 | var app = angular.module('appenlight', [ |
|
2710 | 2710 | 'appenlight.base', |
|
2711 | 2711 | 'appenlight.config', |
|
2712 | 'appenlight.user', | |
|
2713 | 2712 | 'appenlight.templates', |
|
2714 | 2713 | 'appenlight.filters', |
|
2715 | 2714 | 'appenlight.services', |
@@ -2718,10 +2717,8 b" var app = angular.module('appenlight', [" | |||
|
2718 | 2717 | 'appenlight.plugins' |
|
2719 | 2718 | ]); |
|
2720 | 2719 | |
|
2721 | function kickstartAE() { | |
|
2722 | ||
|
2723 | ||
|
2724 | ||
|
2720 | // needs manual execution because of plugin files | |
|
2721 | function kickstartAE(initialUserData) { | |
|
2725 | 2722 | app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) { |
|
2726 | 2723 | $locationProvider.html5Mode(true); |
|
2727 | 2724 | $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) { |
@@ -2773,14 +2770,14 b' function kickstartAE() {' | |||
|
2773 | 2770 | }); |
|
2774 | 2771 | }); |
|
2775 | 2772 | |
|
2776 |
app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig', |
|
|
2777 |
function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig |
|
|
2773 | app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig', | |
|
2774 | function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) { | |
|
2775 | stateHolder.AeUser = buildUser(initialUserData || {"user_name": null, "id": null}); | |
|
2778 | 2776 | $rootScope.$state = $state; |
|
2779 | 2777 | $rootScope.stateHolder = stateHolder; |
|
2780 | 2778 | $rootScope.flash = stateHolder.flashMessages.list; |
|
2781 | 2779 | $rootScope.closeAlert = stateHolder.flashMessages.closeAlert; |
|
2782 | 2780 | $rootScope.AeConfig = AeConfig; |
|
2783 | $rootScope.AeUser = AeUser; | |
|
2784 | 2781 | |
|
2785 | 2782 | var transitionApp = function($transition$, $state) { |
|
2786 | 2783 | // redirect user to /register unless its one of open views |
@@ -2807,14 +2804,22 b' function kickstartAE() {' | |||
|
2807 | 2804 | isOpenView = true; |
|
2808 | 2805 | } |
|
2809 | 2806 | }); |
|
2810 | if (AeUser.id === null && !isGuestState && !isOpenView) { | |
|
2807 | if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) { | |
|
2811 | 2808 | if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) { |
|
2812 | 2809 | |
|
2813 |
|
|
|
2810 | var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location); | |
|
2811 | // fix infinite digest here | |
|
2812 | $rootScope.$on('$locationChangeStart', | |
|
2813 | function(event, toState, toParams, fromState, fromParams, options){ | |
|
2814 | event.preventDefault(); | |
|
2815 | $window.location = newLocation; | |
|
2816 | }); | |
|
2817 | $window.location = newLocation; | |
|
2814 | 2818 | return false; |
|
2815 | 2819 | } |
|
2816 | 2820 | return false; |
|
2817 | 2821 | } |
|
2822 | return true; | |
|
2818 | 2823 | }; |
|
2819 | 2824 | $transitions.onBefore({}, transitionApp); |
|
2820 | 2825 | |
@@ -4853,20 +4858,20 b' function kickstartAE() {' | |||
|
4853 | 4858 | "<div class=\"row\">\n" + |
|
4854 | 4859 | " <div class=\"col-sm-12 dashboard\" id=\"content\">\n" + |
|
4855 | 4860 | "\n" + |
|
4856 | " <div ng-if=\"!AeUser.applications.length\">\n" + | |
|
4861 | " <div ng-if=\"!stateHolder.AeUser.applications.length\">\n" + | |
|
4857 | 4862 | "\n" + |
|
4858 | 4863 | " <div ng-include=\"'templates/quickstart.html'\"></div>\n" + |
|
4859 | 4864 | "\n" + |
|
4860 | 4865 | " </div>\n" + |
|
4861 | 4866 | "\n" + |
|
4862 | " <div ng-if=\"AeUser.applications.length\">\n" + | |
|
4867 | " <div ng-if=\"stateHolder.AeUser.applications.length\">\n" + | |
|
4863 | 4868 | "\n" + |
|
4864 | 4869 | " <div class=\"row\">\n" + |
|
4865 | 4870 | " <div class=\"col-sm-6\">\n" + |
|
4866 | 4871 | " <div class=\"panel panel-default\">\n" + |
|
4867 | 4872 | " <div class=\"panel-body\">\n" + |
|
4868 | 4873 | " <form class=\"graph-type form-inline\">\n" + |
|
4869 | " <select ng-model=\"index.resource\" ng-options=\"r.resource_id as r.resource_name for r in AeUser.applications\" ng-change=\"index.updateSearchParams()\"\n" + | |
|
4874 | " <select ng-model=\"index.resource\" ng-options=\"r.resource_id as r.resource_name for r in stateHolder.AeUser.applications\" ng-change=\"index.updateSearchParams()\"\n" + | |
|
4870 | 4875 | " class=\"SelectField form-control input-sm slim-input\"></select>\n" + |
|
4871 | 4876 | "\n" + |
|
4872 | 4877 | " <select class=\"SelectField form-control input-sm slim-input\" ng-model=\"index.timeSpan\"\n" + |
@@ -6138,7 +6143,7 b' function kickstartAE() {' | |||
|
6138 | 6143 | "\n" + |
|
6139 | 6144 | "<div ng-if=\"report.report !== null && !report.is_loading.report\">\n" + |
|
6140 | 6145 | "\n" + |
|
6141 | " <div ng-if=\"AeUser.id\" class=\"row\">\n" + | |
|
6146 | " <div ng-if=\"stateHolder.AeUser.id\" class=\"row\">\n" + | |
|
6142 | 6147 | " <div class=\"col-lg-12\">\n" + |
|
6143 | 6148 | " <a onclick=\"window.history.back()\" class=\"btn btn-default\" ng-if=\"report.window.history.length > 2\"><span class=\"fa fa-arrow-circle-o-left\"></span>\n" + |
|
6144 | 6149 | " Go back</a>\n" + |
@@ -7684,9 +7689,9 b' function AdminUsersController(usersResource) {' | |||
|
7684 | 7689 | angular.module('appenlight.controllers') |
|
7685 | 7690 | .controller('ApplicationsUpdateController', ApplicationsUpdateController) |
|
7686 | 7691 | |
|
7687 |
ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', ' |
|
|
7692 | ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder']; | |
|
7688 | 7693 | |
|
7689 |
function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, |
|
|
7694 | function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) { | |
|
7690 | 7695 | 'use strict'; |
|
7691 | 7696 | |
|
7692 | 7697 | var vm = this; |
@@ -7732,9 +7737,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat' | |||
|
7732 | 7737 | vm.loading.application = true; |
|
7733 | 7738 | if (vm.resource.resource_id === null) { |
|
7734 | 7739 | applicationsNoIdResource.save(null, vm.resource, function (data) { |
|
7735 | ||
|
7736 | AeUser.addApplication(data); | |
|
7737 | ||
|
7740 | stateHolder.AeUser.addApplication(data); | |
|
7738 | 7741 | $state.go('applications.update', {resourceId: data.resource_id}); |
|
7739 | 7742 | setServerValidation(vm.BasicForm); |
|
7740 | 7743 | }, function (response) { |
@@ -7801,9 +7804,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat' | |||
|
7801 | 7804 | key: 'delete_resource' |
|
7802 | 7805 | }, vm.formDeleteModel, |
|
7803 | 7806 | function (data) { |
|
7804 | ||
|
7805 | AeUser.removeApplicationById(vm.resource.resource_id); | |
|
7806 | ||
|
7807 | stateHolder.AeUser.removeApplicationById(vm.resource.resource_id); | |
|
7807 | 7808 | $state.go('applications.list'); |
|
7808 | 7809 | }, |
|
7809 | 7810 | function (response) { |
@@ -8120,9 +8121,9 b' function EventsController(eventsNoIdResource, eventsResource) {' | |||
|
8120 | 8121 | angular.module('appenlight.controllers') |
|
8121 | 8122 | .controller('IndexDashboardController', IndexDashboardController); |
|
8122 | 8123 | |
|
8123 |
IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig' |
|
|
8124 | IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig']; | |
|
8124 | 8125 | |
|
8125 |
function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig |
|
|
8126 | function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig) { | |
|
8126 | 8127 | var vm = this; |
|
8127 | 8128 | stateHolder.section = 'dashboard'; |
|
8128 | 8129 | vm.timeOptions = {}; |
@@ -8133,7 +8134,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
8133 | 8134 | } |
|
8134 | 8135 | }); |
|
8135 | 8136 | vm.urls = AeConfig.urls; |
|
8136 | vm.applications = AeUser.applications_map; | |
|
8137 | vm.applications = stateHolder.AeUser.applications_map; | |
|
8137 | 8138 | vm.show_dashboard = false; |
|
8138 | 8139 | vm.resource = null; |
|
8139 | 8140 | vm.graphType = {selected: null}; |
@@ -8527,7 +8528,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
8527 | 8528 | }); |
|
8528 | 8529 | |
|
8529 | 8530 | vm.determineStartState = function () { |
|
8530 | if (AeUser.applications.length) { | |
|
8531 | if (stateHolder.AeUser.applications.length) { | |
|
8531 | 8532 | vm.resource = Number($location.search().resource); |
|
8532 | 8533 | |
|
8533 | 8534 | if (!vm.resource){ |
@@ -8538,7 +8539,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
8538 | 8539 | vm.resource = cookieResource; |
|
8539 | 8540 | } |
|
8540 | 8541 | else{ |
|
8541 | vm.resource = AeUser.applications[0].resource_id; | |
|
8542 | vm.resource = stateHolder.AeUser.applications[0].resource_id; | |
|
8542 | 8543 | } |
|
8543 | 8544 | } |
|
8544 | 8545 | } |
@@ -8782,7 +8783,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
8782 | 8783 | ; |
|
8783 | 8784 | } |
|
8784 | 8785 | |
|
8785 | if (AeUser.applications.length){ | |
|
8786 | if (stateHolder.AeUser.applications.length){ | |
|
8786 | 8787 | vm.show_dashboard = true; |
|
8787 | 8788 | vm.determineStartState(); |
|
8788 | 8789 | vm.refreshData(); |
@@ -8821,13 +8822,13 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
8821 | 8822 | angular.module('appenlight.controllers') |
|
8822 | 8823 | .controller('HeaderCtrl', HeaderCtrl); |
|
8823 | 8824 | |
|
8824 |
HeaderCtrl.$inject = ['$state', 'stateHolder' |
|
|
8825 | HeaderCtrl.$inject = ['$state', 'stateHolder']; | |
|
8825 | 8826 | |
|
8826 |
function HeaderCtrl($state, stateHolder |
|
|
8827 | function HeaderCtrl($state, stateHolder) { | |
|
8827 | 8828 | var vm = this; |
|
8828 | 8829 | vm.stateHolder = stateHolder; |
|
8829 | vm.assignedReports = AeUser.assigned_reports; | |
|
8830 | vm.latestEvents = AeUser.latest_events; | |
|
8830 | vm.assignedReports = stateHolder.AeUser.assigned_reports; | |
|
8831 | vm.latestEvents = stateHolder.AeUser.latest_events; | |
|
8831 | 8832 | vm.activeEvents = 0; |
|
8832 | 8833 | _.each(vm.latestEvents, function (event) { |
|
8833 | 8834 | if (event.status === 1 && event.end_date === null) { |
@@ -9193,9 +9194,9 b' function JiraIntegrationCtrl($uibModalInstance, $state, report, integrationName,' | |||
|
9193 | 9194 | |
|
9194 | 9195 | angular.module('appenlight.controllers').controller('LogsController', LogsController); |
|
9195 | 9196 | |
|
9196 |
LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource' |
|
|
9197 | LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource']; | |
|
9197 | 9198 | |
|
9198 |
function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource |
|
|
9199 | function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource) { | |
|
9199 | 9200 | var vm = this; |
|
9200 | 9201 | vm.logEventsChartConfig = { |
|
9201 | 9202 | data: { |
@@ -9257,7 +9258,7 b' function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logs' | |||
|
9257 | 9258 | }; |
|
9258 | 9259 | vm.today(); |
|
9259 | 9260 | |
|
9260 | vm.applications = AeUser.applications_map; | |
|
9261 | vm.applications = stateHolder.AeUser.applications_map; | |
|
9261 | 9262 | vm.logsPage = []; |
|
9262 | 9263 | vm.itemCount = 0; |
|
9263 | 9264 | vm.itemsPerPage = 250; |
@@ -9645,11 +9646,11 b" angular.module('appenlight.controllers')" | |||
|
9645 | 9646 | .controller('ReportsListSlowController', ReportsListSlowController); |
|
9646 | 9647 | |
|
9647 | 9648 | ReportsListSlowController.$inject = ['$scope', '$location', '$cookies', |
|
9648 |
'stateHolder', 'typeAheadTagHelper', 'slowReportsResource' |
|
|
9649 | 'stateHolder', 'typeAheadTagHelper', 'slowReportsResource'] | |
|
9649 | 9650 | |
|
9650 |
function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource |
|
|
9651 | function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource) { | |
|
9651 | 9652 | var vm = this; |
|
9652 | vm.applications = AeUser.applications_map; | |
|
9653 | vm.applications = stateHolder.AeUser.applications_map; | |
|
9653 | 9654 | stateHolder.section = 'slow_reports'; |
|
9654 | 9655 | vm.today = function () { |
|
9655 | 9656 | vm.pickerDate = new Date(); |
@@ -9787,7 +9788,7 b' function ReportsListSlowController($scope, $location, $cookies, stateHolder, typ' | |||
|
9787 | 9788 | tag: 'Status ' + status.toUpperCase() |
|
9788 | 9789 | }); |
|
9789 | 9790 | }); |
|
9790 | _.each(AeUser.applications, function (item) { | |
|
9791 | _.each(stateHolder.AeUser.applications, function (item) { | |
|
9791 | 9792 | vm.filterTypeAheadOptions.push({ |
|
9792 | 9793 | type: 'resource', |
|
9793 | 9794 | text: 'resource:' + item.resource_id + ':' + item.resource_name, |
@@ -9940,12 +9941,12 b" angular.module('appenlight.controllers')" | |||
|
9940 | 9941 | .controller('ReportsListController', ReportsListController); |
|
9941 | 9942 | |
|
9942 | 9943 | ReportsListController.$inject = ['$scope', '$location', '$cookies', |
|
9943 |
'stateHolder', 'typeAheadTagHelper', 'reportsResource' |
|
|
9944 | 'stateHolder', 'typeAheadTagHelper', 'reportsResource']; | |
|
9944 | 9945 | |
|
9945 | 9946 | function ReportsListController($scope, $location, $cookies, stateHolder, |
|
9946 |
typeAheadTagHelper, reportsResource |
|
|
9947 | typeAheadTagHelper, reportsResource) { | |
|
9947 | 9948 | var vm = this; |
|
9948 | vm.applications = AeUser.applications_map; | |
|
9949 | vm.applications = stateHolder.AeUser.applications_map; | |
|
9949 | 9950 | stateHolder.section = 'reports'; |
|
9950 | 9951 | vm.today = function () { |
|
9951 | 9952 | vm.pickerDate = new Date(); |
@@ -10103,7 +10104,7 b' function ReportsListController($scope, $location, $cookies, stateHolder,' | |||
|
10103 | 10104 | tag: 'Status ' + status.toUpperCase() |
|
10104 | 10105 | }); |
|
10105 | 10106 | }); |
|
10106 | _.each(AeUser.applications, function (item) { | |
|
10107 | _.each(stateHolder.AeUser.applications, function (item) { | |
|
10107 | 10108 | vm.filterTypeAheadOptions.push({ |
|
10108 | 10109 | type: 'resource', |
|
10109 | 10110 | text: 'resource:' + item.resource_id + ':' + item.resource_name, |
@@ -10260,9 +10261,9 b' function ReportsListController($scope, $location, $cookies, stateHolder,' | |||
|
10260 | 10261 | angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController); |
|
10261 | 10262 | ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal', |
|
10262 | 10263 | '$cookies', 'reportGroupPropertyResource', 'reportGroupResource', |
|
10263 |
'logsNoIdResource', ' |
|
|
10264 | 'logsNoIdResource', 'stateHolder']; | |
|
10264 | 10265 | |
|
10265 |
function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, |
|
|
10266 | function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) { | |
|
10266 | 10267 | var vm = this; |
|
10267 | 10268 | vm.window = $window; |
|
10268 | 10269 | vm.reportHistoryConfig = { |
@@ -10442,7 +10443,7 b' function ReportsViewController($window, $location, $state, $uibModal, $cookies, ' | |||
|
10442 | 10443 | vm.rawTraceback += ' ' + frame.cline + "\r\n"; |
|
10443 | 10444 | }); |
|
10444 | 10445 | |
|
10445 | if (AeUser.id){ | |
|
10446 | if (stateHolder.AeUser.id){ | |
|
10446 | 10447 | vm.fetchHistory(); |
|
10447 | 10448 | } |
|
10448 | 10449 | |
@@ -12772,6 +12773,7 b" angular.module('appenlight.services.stateHolder', []).factory('stateHolder', ['$" | |||
|
12772 | 12773 | resource: null, |
|
12773 | 12774 | plugins: Plugins, |
|
12774 | 12775 | flashMessages: flashMessages, |
|
12776 | AeUser: {"user_name": null, "id": null} | |
|
12775 | 12777 | }; |
|
12776 | 12778 | return stateHolder; |
|
12777 | 12779 | }]); |
@@ -12910,21 +12912,17 b" underscore.factory('_', function () {" | |||
|
12910 | 12912 | // # services, and proprietary license terms, please see |
|
12911 | 12913 | // # https://rhodecode.com/licenses/ |
|
12912 | 12914 | |
|
12913 | var aeuser = angular.module('appenlight.user', []); | |
|
12914 | aeuser.factory('AeUser', ['AeConfig', function () { | |
|
12915 | var decodedAeUser = decodeEncodedJSON(window.AE.user); | |
|
12916 | ||
|
12915 | function buildUser(jsonData){ | |
|
12917 | 12916 | var AeUser = { |
|
12918 |
user_name: |
|
|
12919 |
id: |
|
|
12920 |
assigned_reports: |
|
|
12921 |
latest_events: |
|
|
12922 |
permissions: |
|
|
12923 |
groups: |
|
|
12917 | user_name: jsonData.user_name || null, | |
|
12918 | id: jsonData.id, | |
|
12919 | assigned_reports: jsonData.assigned_reports || null, | |
|
12920 | latest_events: jsonData.latest_events || null, | |
|
12921 | permissions: jsonData.permissions || null, | |
|
12922 | groups: jsonData.groups || null, | |
|
12924 | 12923 | applications: [], |
|
12925 | 12924 | dashboards: [] |
|
12926 | 12925 | }; |
|
12927 | ||
|
12928 | 12926 | AeUser.applications_map = {}; |
|
12929 | 12927 | AeUser.dashboards_map = {}; |
|
12930 | 12928 | AeUser.addApplication = function (item) { |
@@ -12973,12 +12971,11 b" aeuser.factory('AeUser', ['AeConfig', function () {" | |||
|
12973 | 12971 | return hasPerm; |
|
12974 | 12972 | }; |
|
12975 | 12973 | |
|
12976 |
_.each( |
|
|
12974 | _.each(jsonData.applications, function (item) { | |
|
12977 | 12975 | AeUser.addApplication(item); |
|
12978 | 12976 | }); |
|
12979 |
_.each( |
|
|
12977 | _.each(jsonData.dashboards, function (item) { | |
|
12980 | 12978 | AeUser.addDashboard(item); |
|
12981 | 12979 | }); |
|
12982 | ||
|
12983 | 12980 | return AeUser; |
|
12984 | }]); | |
|
12981 | } |
@@ -6,4 +6,8 b'' | |||
|
6 | 6 | <h1 class="page-title">{{ _('Dashboard') }}</h1> |
|
7 | 7 | {% endblock %} |
|
8 | 8 | |
|
9 |
{% block content%} |
|
|
9 | {% block content%} | |
|
10 | <div class="text-center"> | |
|
11 | <span class="fa fa-cog fa-spin fa-5x m-a-4"></span> | |
|
12 | </div> | |
|
13 | {% endblock %} |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | {% import 'widgets.jinja2' as widgets %} |
|
2 | 2 | <!DOCTYPE html> |
|
3 |
<html {% block ng_controller %}{% endblock %} |
|
|
3 | <html {% block ng_controller %}{% endblock %}> | |
|
4 | 4 | <head> |
|
5 | 5 | <title>{% block title %}Application performance, exception and error monitoring for Python, |
|
6 | 6 | Django, Flask and Javascript - AppEnlight{% endblock %}</title> |
@@ -22,23 +22,14 b'' | |||
|
22 | 22 | |
|
23 | 23 | {% endblock %} |
|
24 | 24 | {% block additional_styles %}{% endblock %} |
|
25 | ||
|
26 | 25 | <script type="text/javascript"> |
|
27 | 26 | var AE = {}; |
|
28 | 27 | AE.urls = {{ url_list|tojson|safe }}; |
|
29 | 28 | AE.ws_url = '{{ request.registry.settings['cometd.ws_url'] }}'; |
|
30 | {% if request.user %} | |
|
31 | AE.user = {{ request.user.get_dict(include_keys=['user_name','id', 'applications', 'assigned_reports', 'latest_events', 'permissions', 'groups'], extended_info=True) |toJSONUnsafe}} | |
|
32 | {% else %} | |
|
33 | AE.user = '{"user_name": null, "id": null}'; | |
|
34 | {% endif %} | |
|
35 | 29 | AE.flash_messages = {{ flash_msgs|toJSONUnsafe }}; |
|
36 | 30 | AE.timeOptions = {{ h.time_options|toJSONUnsafe }}; |
|
37 | 31 | AE.plugins = {{ js_plugins|toJSONUnsafe }}; |
|
38 | 32 | </script> |
|
39 | {% block scripts %} | |
|
40 | {% block additional_layout_scripts %}{% endblock %} | |
|
41 | {% endblock %} | |
|
42 | 33 | {% if request.registry.settings.get('appenlight.public_api_key') %} |
|
43 | 34 | <script type="application/javascript"> |
|
44 | 35 | var initAppEnlight = function () { |
@@ -76,7 +67,36 b'' | |||
|
76 | 67 | {% for plugin in js_plugins %} |
|
77 | 68 | <script src="{{ request.static_url('appenlight:webassets/{}/js/{}'.format(plugin['name'], plugin['config']['src']), _query={'rev':js_hash}) }}"></script> |
|
78 | 69 | {% endfor %} |
|
79 | <script> kickstartAE(); </script> | |
|
70 | <script> | |
|
71 | var xhr = new XMLHttpRequest(); | |
|
72 | xhr.open('GET', AE.urls.userSelf); | |
|
73 | xhr.onload = function() { | |
|
74 | if (xhr.status === 200) { | |
|
75 | kickstartAE(JSON.parse(xhr.responseText)); | |
|
76 | angular.bootstrap(document, ['appenlight']); | |
|
77 | } | |
|
78 | else { | |
|
79 | kickstartAE(null); | |
|
80 | angular.bootstrap(document, ['appenlight']); | |
|
81 | } | |
|
82 | }; | |
|
83 | // do not run angular on register page | |
|
84 | ||
|
85 | var noAngularRoutes = [ | |
|
86 | AE.urls.otherRoutes.register, | |
|
87 | AE.urls.otherRoutes.lostPassword, | |
|
88 | AE.urls.otherRoutes.lostPasswordGenerate, | |
|
89 | ]; | |
|
90 | shouldRunAngular = true; | |
|
91 | for (var i=0; i< noAngularRoutes.length; i++){ | |
|
92 | if (window.location.toString().indexOf(noAngularRoutes[i]) !== -1) { | |
|
93 | shouldRunAngular = false; | |
|
94 | } | |
|
95 | } | |
|
96 | if (shouldRunAngular) { | |
|
97 | xhr.send(); | |
|
98 | } | |
|
99 | </script> | |
|
80 | 100 | </head> |
|
81 | 101 | <body class="{% block section_name %}{% endblock %} {% raw %}top-state-{{$state.current.name.split('.')[0].replace('.', '-').replace('.', '-')}} state-{{$state.current.name.replace('.', '-').replace('.', '-')}}{% endraw %} {% if request.user %}user-logged {% else %}user-unlogged{% endif %}" id="html_body"> |
|
82 | 102 | <div class="extra-deco1"></div> |
@@ -1,8 +1,5 b'' | |||
|
1 | 1 | {% extends "/layout.jinja2" %} |
|
2 | 2 | {% from '/reports/reports_small_list_old.jinja2' import render_reports with context %} |
|
3 | {% block additional_layout_scripts %} | |
|
4 | dojo.require('appenlight.dashboard.index'); | |
|
5 | {% endblock %} | |
|
6 | 3 | {% block content_class %}{% endblock %} |
|
7 | 4 | {% set layout_disable_menu = True %} |
|
8 | 5 |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | {% extends "/layout.jinja2" %} |
|
2 | {% block ng_app %}{% endblock %} | |
|
3 | 2 | {% block content %} |
|
4 | 3 | |
|
5 | 4 | <div class="col-sm-offset-1 col-sm-10"> |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | {% extends "/layout.jinja2" %} |
|
2 | {% block ng_app %}{% endblock %} | |
|
3 | 2 | {% block content %} |
|
4 | 3 | <div class="col-sm-offset-1 col-sm-10"> |
|
5 | 4 |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | {% extends "/layout.jinja2" %} |
|
2 | {% block ng_app %}{% endblock %} | |
|
3 | 2 | {% block ng_controller %} data-ng-controller="RegisterController as |
|
4 | 3 | register" {% endblock %} |
|
5 | 4 | {% block content_class %}two-col equal{% endblock %} |
@@ -181,9 +181,10 b' def users_self(request):' | |||
|
181 | 181 | request.session.flash(_('Your profile got updated.')) |
|
182 | 182 | else: |
|
183 | 183 | return HTTPUnprocessableEntity(body=form.errors_json) |
|
184 |
return request.user.get_dict( |
|
|
185 | 'security_code', | |
|
186 |
|
|
|
184 | return request.user.get_dict( | |
|
185 | exclude_keys=['security_code_date', 'notes', 'security_code', | |
|
186 | 'user_password'], | |
|
187 | extended_info=True) | |
|
187 | 188 | |
|
188 | 189 | |
|
189 | 190 | @view_config(route_name='users_self_property', |
@@ -74,7 +74,6 b" angular.module('appenlight.plugins', pluginsToLoad);" | |||
|
74 | 74 | var app = angular.module('appenlight', [ |
|
75 | 75 | 'appenlight.base', |
|
76 | 76 | 'appenlight.config', |
|
77 | 'appenlight.user', | |
|
78 | 77 | 'appenlight.templates', |
|
79 | 78 | 'appenlight.filters', |
|
80 | 79 | 'appenlight.services', |
@@ -83,10 +82,8 b" var app = angular.module('appenlight', [" | |||
|
83 | 82 | 'appenlight.plugins' |
|
84 | 83 | ]); |
|
85 | 84 | |
|
86 | function kickstartAE() { | |
|
87 | ||
|
88 | ||
|
89 | ||
|
85 | // needs manual execution because of plugin files | |
|
86 | function kickstartAE(initialUserData) { | |
|
90 | 87 | app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) { |
|
91 | 88 | $locationProvider.html5Mode(true); |
|
92 | 89 | $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) { |
@@ -138,14 +135,14 b' function kickstartAE() {' | |||
|
138 | 135 | }); |
|
139 | 136 | }); |
|
140 | 137 | |
|
141 |
app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig', |
|
|
142 |
function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig |
|
|
138 | app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig', | |
|
139 | function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) { | |
|
140 | stateHolder.AeUser = buildUser(initialUserData || {"user_name": null, "id": null}); | |
|
143 | 141 | $rootScope.$state = $state; |
|
144 | 142 | $rootScope.stateHolder = stateHolder; |
|
145 | 143 | $rootScope.flash = stateHolder.flashMessages.list; |
|
146 | 144 | $rootScope.closeAlert = stateHolder.flashMessages.closeAlert; |
|
147 | 145 | $rootScope.AeConfig = AeConfig; |
|
148 | $rootScope.AeUser = AeUser; | |
|
149 | 146 | |
|
150 | 147 | var transitionApp = function($transition$, $state) { |
|
151 | 148 | // redirect user to /register unless its one of open views |
@@ -172,14 +169,22 b' function kickstartAE() {' | |||
|
172 | 169 | isOpenView = true; |
|
173 | 170 | } |
|
174 | 171 | }); |
|
175 | if (AeUser.id === null && !isGuestState && !isOpenView) { | |
|
172 | if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) { | |
|
176 | 173 | if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) { |
|
177 | 174 | console.log('redirect to register'); |
|
178 |
|
|
|
175 | var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location); | |
|
176 | // fix infinite digest here | |
|
177 | $rootScope.$on('$locationChangeStart', | |
|
178 | function(event, toState, toParams, fromState, fromParams, options){ | |
|
179 | event.preventDefault(); | |
|
180 | $window.location = newLocation; | |
|
181 | }); | |
|
182 | $window.location = newLocation; | |
|
179 | 183 | return false; |
|
180 | 184 | } |
|
181 | 185 | return false; |
|
182 | 186 | } |
|
187 | return true; | |
|
183 | 188 | }; |
|
184 | 189 | $transitions.onBefore({}, transitionApp); |
|
185 | 190 |
@@ -20,9 +20,9 b'' | |||
|
20 | 20 | angular.module('appenlight.controllers') |
|
21 | 21 | .controller('ApplicationsUpdateController', ApplicationsUpdateController) |
|
22 | 22 | |
|
23 |
ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', ' |
|
|
23 | ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder']; | |
|
24 | 24 | |
|
25 |
function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, |
|
|
25 | function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) { | |
|
26 | 26 | 'use strict'; |
|
27 | 27 | console.debug('ApplicationsUpdateController'); |
|
28 | 28 | var vm = this; |
@@ -68,9 +68,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat' | |||
|
68 | 68 | vm.loading.application = true; |
|
69 | 69 | if (vm.resource.resource_id === null) { |
|
70 | 70 | applicationsNoIdResource.save(null, vm.resource, function (data) { |
|
71 |
|
|
|
72 | AeUser.addApplication(data); | |
|
73 | console.log('apps',AeUser.applications); | |
|
71 | stateHolder.AeUser.addApplication(data); | |
|
74 | 72 | $state.go('applications.update', {resourceId: data.resource_id}); |
|
75 | 73 | setServerValidation(vm.BasicForm); |
|
76 | 74 | }, function (response) { |
@@ -137,9 +135,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat' | |||
|
137 | 135 | key: 'delete_resource' |
|
138 | 136 | }, vm.formDeleteModel, |
|
139 | 137 | function (data) { |
|
140 | console.log('apps',AeUser.applications); | |
|
141 | AeUser.removeApplicationById(vm.resource.resource_id); | |
|
142 | console.log('apps',AeUser.applications); | |
|
138 | stateHolder.AeUser.removeApplicationById(vm.resource.resource_id); | |
|
143 | 139 | $state.go('applications.list'); |
|
144 | 140 | }, |
|
145 | 141 | function (response) { |
@@ -20,9 +20,9 b'' | |||
|
20 | 20 | angular.module('appenlight.controllers') |
|
21 | 21 | .controller('IndexDashboardController', IndexDashboardController); |
|
22 | 22 | |
|
23 |
IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig' |
|
|
23 | IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig']; | |
|
24 | 24 | |
|
25 |
function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig |
|
|
25 | function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig) { | |
|
26 | 26 | var vm = this; |
|
27 | 27 | stateHolder.section = 'dashboard'; |
|
28 | 28 | vm.timeOptions = {}; |
@@ -33,7 +33,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
33 | 33 | } |
|
34 | 34 | }); |
|
35 | 35 | vm.urls = AeConfig.urls; |
|
36 | vm.applications = AeUser.applications_map; | |
|
36 | vm.applications = stateHolder.AeUser.applications_map; | |
|
37 | 37 | vm.show_dashboard = false; |
|
38 | 38 | vm.resource = null; |
|
39 | 39 | vm.graphType = {selected: null}; |
@@ -427,7 +427,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
427 | 427 | }); |
|
428 | 428 | |
|
429 | 429 | vm.determineStartState = function () { |
|
430 | if (AeUser.applications.length) { | |
|
430 | if (stateHolder.AeUser.applications.length) { | |
|
431 | 431 | vm.resource = Number($location.search().resource); |
|
432 | 432 | |
|
433 | 433 | if (!vm.resource){ |
@@ -438,7 +438,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
438 | 438 | vm.resource = cookieResource; |
|
439 | 439 | } |
|
440 | 440 | else{ |
|
441 | vm.resource = AeUser.applications[0].resource_id; | |
|
441 | vm.resource = stateHolder.AeUser.applications[0].resource_id; | |
|
442 | 442 | } |
|
443 | 443 | } |
|
444 | 444 | } |
@@ -682,7 +682,7 b' function IndexDashboardController($scope, $location, $cookies, $interval, stateH' | |||
|
682 | 682 | ; |
|
683 | 683 | } |
|
684 | 684 | |
|
685 | if (AeUser.applications.length){ | |
|
685 | if (stateHolder.AeUser.applications.length){ | |
|
686 | 686 | vm.show_dashboard = true; |
|
687 | 687 | vm.determineStartState(); |
|
688 | 688 | vm.refreshData(); |
@@ -20,13 +20,13 b'' | |||
|
20 | 20 | angular.module('appenlight.controllers') |
|
21 | 21 | .controller('HeaderCtrl', HeaderCtrl); |
|
22 | 22 | |
|
23 |
HeaderCtrl.$inject = ['$state', 'stateHolder' |
|
|
23 | HeaderCtrl.$inject = ['$state', 'stateHolder']; | |
|
24 | 24 | |
|
25 |
function HeaderCtrl($state, stateHolder |
|
|
25 | function HeaderCtrl($state, stateHolder) { | |
|
26 | 26 | var vm = this; |
|
27 | 27 | vm.stateHolder = stateHolder; |
|
28 | vm.assignedReports = AeUser.assigned_reports; | |
|
29 | vm.latestEvents = AeUser.latest_events; | |
|
28 | vm.assignedReports = stateHolder.AeUser.assigned_reports; | |
|
29 | vm.latestEvents = stateHolder.AeUser.latest_events; | |
|
30 | 30 | vm.activeEvents = 0; |
|
31 | 31 | _.each(vm.latestEvents, function (event) { |
|
32 | 32 | if (event.status === 1 && event.end_date === null) { |
@@ -19,9 +19,9 b'' | |||
|
19 | 19 | |
|
20 | 20 | angular.module('appenlight.controllers').controller('LogsController', LogsController); |
|
21 | 21 | |
|
22 |
LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource' |
|
|
22 | LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource']; | |
|
23 | 23 | |
|
24 |
function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource |
|
|
24 | function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource) { | |
|
25 | 25 | var vm = this; |
|
26 | 26 | vm.logEventsChartConfig = { |
|
27 | 27 | data: { |
@@ -83,7 +83,7 b' function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logs' | |||
|
83 | 83 | }; |
|
84 | 84 | vm.today(); |
|
85 | 85 | |
|
86 | vm.applications = AeUser.applications_map; | |
|
86 | vm.applications = stateHolder.AeUser.applications_map; | |
|
87 | 87 | vm.logsPage = []; |
|
88 | 88 | vm.itemCount = 0; |
|
89 | 89 | vm.itemsPerPage = 250; |
@@ -21,12 +21,12 b" angular.module('appenlight.controllers')" | |||
|
21 | 21 | .controller('ReportsListController', ReportsListController); |
|
22 | 22 | |
|
23 | 23 | ReportsListController.$inject = ['$scope', '$location', '$cookies', |
|
24 |
'stateHolder', 'typeAheadTagHelper', 'reportsResource' |
|
|
24 | 'stateHolder', 'typeAheadTagHelper', 'reportsResource']; | |
|
25 | 25 | |
|
26 | 26 | function ReportsListController($scope, $location, $cookies, stateHolder, |
|
27 |
typeAheadTagHelper, reportsResource |
|
|
27 | typeAheadTagHelper, reportsResource) { | |
|
28 | 28 | var vm = this; |
|
29 | vm.applications = AeUser.applications_map; | |
|
29 | vm.applications = stateHolder.AeUser.applications_map; | |
|
30 | 30 | stateHolder.section = 'reports'; |
|
31 | 31 | vm.today = function () { |
|
32 | 32 | vm.pickerDate = new Date(); |
@@ -184,7 +184,7 b' function ReportsListController($scope, $location, $cookies, stateHolder,' | |||
|
184 | 184 | tag: 'Status ' + status.toUpperCase() |
|
185 | 185 | }); |
|
186 | 186 | }); |
|
187 | _.each(AeUser.applications, function (item) { | |
|
187 | _.each(stateHolder.AeUser.applications, function (item) { | |
|
188 | 188 | vm.filterTypeAheadOptions.push({ |
|
189 | 189 | type: 'resource', |
|
190 | 190 | text: 'resource:' + item.resource_id + ':' + item.resource_name, |
@@ -25,11 +25,11 b" angular.module('appenlight.controllers')" | |||
|
25 | 25 | .controller('ReportsListSlowController', ReportsListSlowController); |
|
26 | 26 | |
|
27 | 27 | ReportsListSlowController.$inject = ['$scope', '$location', '$cookies', |
|
28 |
'stateHolder', 'typeAheadTagHelper', 'slowReportsResource' |
|
|
28 | 'stateHolder', 'typeAheadTagHelper', 'slowReportsResource'] | |
|
29 | 29 | |
|
30 |
function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource |
|
|
30 | function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource) { | |
|
31 | 31 | var vm = this; |
|
32 | vm.applications = AeUser.applications_map; | |
|
32 | vm.applications = stateHolder.AeUser.applications_map; | |
|
33 | 33 | stateHolder.section = 'slow_reports'; |
|
34 | 34 | vm.today = function () { |
|
35 | 35 | vm.pickerDate = new Date(); |
@@ -167,7 +167,7 b' function ReportsListSlowController($scope, $location, $cookies, stateHolder, typ' | |||
|
167 | 167 | tag: 'Status ' + status.toUpperCase() |
|
168 | 168 | }); |
|
169 | 169 | }); |
|
170 | _.each(AeUser.applications, function (item) { | |
|
170 | _.each(stateHolder.AeUser.applications, function (item) { | |
|
171 | 171 | vm.filterTypeAheadOptions.push({ |
|
172 | 172 | type: 'resource', |
|
173 | 173 | text: 'resource:' + item.resource_id + ':' + item.resource_name, |
@@ -20,9 +20,9 b'' | |||
|
20 | 20 | angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController); |
|
21 | 21 | ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal', |
|
22 | 22 | '$cookies', 'reportGroupPropertyResource', 'reportGroupResource', |
|
23 |
'logsNoIdResource', ' |
|
|
23 | 'logsNoIdResource', 'stateHolder']; | |
|
24 | 24 | |
|
25 |
function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, |
|
|
25 | function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) { | |
|
26 | 26 | var vm = this; |
|
27 | 27 | vm.window = $window; |
|
28 | 28 | vm.reportHistoryConfig = { |
@@ -202,7 +202,7 b' function ReportsViewController($window, $location, $state, $uibModal, $cookies, ' | |||
|
202 | 202 | vm.rawTraceback += ' ' + frame.cline + "\r\n"; |
|
203 | 203 | }); |
|
204 | 204 | |
|
205 | if (AeUser.id){ | |
|
205 | if (stateHolder.AeUser.id){ | |
|
206 | 206 | vm.fetchHistory(); |
|
207 | 207 | } |
|
208 | 208 |
@@ -86,6 +86,7 b" angular.module('appenlight.services.stateHolder', []).factory('stateHolder', ['$" | |||
|
86 | 86 | resource: null, |
|
87 | 87 | plugins: Plugins, |
|
88 | 88 | flashMessages: flashMessages, |
|
89 | AeUser: {"user_name": null, "id": null} | |
|
89 | 90 | }; |
|
90 | 91 | return stateHolder; |
|
91 | 92 | }]); |
@@ -14,20 +14,20 b'' | |||
|
14 | 14 | <div class="row"> |
|
15 | 15 | <div class="col-sm-12 dashboard" id="content"> |
|
16 | 16 | |
|
17 | <div ng-if="!AeUser.applications.length"> | |
|
17 | <div ng-if="!stateHolder.AeUser.applications.length"> | |
|
18 | 18 | |
|
19 | 19 | <div ng-include="'templates/quickstart.html'"></div> |
|
20 | 20 | |
|
21 | 21 | </div> |
|
22 | 22 | |
|
23 | <div ng-if="AeUser.applications.length"> | |
|
23 | <div ng-if="stateHolder.AeUser.applications.length"> | |
|
24 | 24 | |
|
25 | 25 | <div class="row"> |
|
26 | 26 | <div class="col-sm-6"> |
|
27 | 27 | <div class="panel panel-default"> |
|
28 | 28 | <div class="panel-body"> |
|
29 | 29 | <form class="graph-type form-inline"> |
|
30 | <select ng-model="index.resource" ng-options="r.resource_id as r.resource_name for r in AeUser.applications" ng-change="index.updateSearchParams()" | |
|
30 | <select ng-model="index.resource" ng-options="r.resource_id as r.resource_name for r in stateHolder.AeUser.applications" ng-change="index.updateSearchParams()" | |
|
31 | 31 | class="SelectField form-control input-sm slim-input"></select> |
|
32 | 32 | |
|
33 | 33 | <select class="SelectField form-control input-sm slim-input" ng-model="index.timeSpan" |
@@ -94,7 +94,7 b'' | |||
|
94 | 94 | |
|
95 | 95 | <div ng-if="report.report !== null && !report.is_loading.report"> |
|
96 | 96 | |
|
97 | <div ng-if="AeUser.id" class="row"> | |
|
97 | <div ng-if="stateHolder.AeUser.id" class="row"> | |
|
98 | 98 | <div class="col-lg-12"> |
|
99 | 99 | <a onclick="window.history.back()" class="btn btn-default" ng-if="report.window.history.length > 2"><span class="fa fa-arrow-circle-o-left"></span> |
|
100 | 100 | Go back</a> |
@@ -17,21 +17,17 b'' | |||
|
17 | 17 | // # services, and proprietary license terms, please see |
|
18 | 18 | // # https://rhodecode.com/licenses/ |
|
19 | 19 | |
|
20 | var aeuser = angular.module('appenlight.user', []); | |
|
21 | aeuser.factory('AeUser', ['AeConfig', function () { | |
|
22 | var decodedAeUser = decodeEncodedJSON(window.AE.user); | |
|
23 | console.log('decodedAeUser', decodedAeUser); | |
|
20 | function buildUser(jsonData){ | |
|
24 | 21 | var AeUser = { |
|
25 |
user_name: |
|
|
26 |
id: |
|
|
27 |
assigned_reports: |
|
|
28 |
latest_events: |
|
|
29 |
permissions: |
|
|
30 |
groups: |
|
|
22 | user_name: jsonData.user_name || null, | |
|
23 | id: jsonData.id, | |
|
24 | assigned_reports: jsonData.assigned_reports || null, | |
|
25 | latest_events: jsonData.latest_events || null, | |
|
26 | permissions: jsonData.permissions || null, | |
|
27 | groups: jsonData.groups || null, | |
|
31 | 28 | applications: [], |
|
32 | 29 | dashboards: [] |
|
33 | 30 | }; |
|
34 | console.log('AeUser', AeUser); | |
|
35 | 31 | AeUser.applications_map = {}; |
|
36 | 32 | AeUser.dashboards_map = {}; |
|
37 | 33 | AeUser.addApplication = function (item) { |
@@ -80,12 +76,11 b" aeuser.factory('AeUser', ['AeConfig', function () {" | |||
|
80 | 76 | return hasPerm; |
|
81 | 77 | }; |
|
82 | 78 | |
|
83 |
_.each( |
|
|
79 | _.each(jsonData.applications, function (item) { | |
|
84 | 80 | AeUser.addApplication(item); |
|
85 | 81 | }); |
|
86 |
_.each( |
|
|
82 | _.each(jsonData.dashboards, function (item) { | |
|
87 | 83 | AeUser.addDashboard(item); |
|
88 | 84 | }); |
|
89 | ||
|
90 | 85 | return AeUser; |
|
91 | }]); | |
|
86 | } |
General Comments 0
You need to be logged in to leave comments.
Login now