This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 4a26442dddd8ddb8c5f4004a39875b3f4394c821 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 5 14:06:55 2015 +0200 bool values for dict strcut on hostpage + hadling update after updating the notifications --- static/js/controllers/dashboardCtrl.js | 7 +++++-- static/js/controllers/hostPageCtrl.js | 13 +++++++++---- views/dashboard.html | 1 - views/hostpage.html | 5 +++++ views/index.html | 19 +++++-------------- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index c3b5ce5..d2fec1b 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -210,11 +210,15 @@ mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modal }, 0); $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_NOTIF_MOD": ""})); } - if (args.func == 'get_users') { + else if (args.func == 'get_users') { $timeout(function () { $scope.users = args.res; }, 0); } + else if (args.func == 'update_subscription_to_group' || 'update_subscription_to_host'){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_HOSTS": ""})); + $modalInstance.close(); + } }); $scope.$on("resGetLoadedNotifMod", function (event, args) { @@ -256,7 +260,6 @@ mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modal args['addr_host'] = $scope.addr_host; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'update_subscription_to_host', 'args': args}})); } - $modalInstance.close(); }; $scope.cancel = function () { diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 319a75a..5889a49 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -41,6 +41,7 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa 'compatible_os': [val1, val2, ...], => a list containing the compatibles os 'unit': val, => the unit type of return ('%', 'bool' or other) 'block': val, => the monitoring block of the module + 'compatible_conn': [val1, ...] => a list of connection modules } } } @@ -110,6 +111,10 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa for (var key in $scope.items.monitoring[modname].value){ res = Math.max(res, $scope.items.monitoring[modname].value[key]); } + if ($scope.items.loaded_moni_mod[modname].unit == 'bool'){ + // if success for bool value, want to show 'true' and not '1' + res = (res == 1); + } return res; }; @@ -742,10 +747,10 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance // if this archive have subparts // will get the archives for the selected subpart $scope.data.series = [$scope.selected_mod + ' on ' + $scope.selected_subpart]; - for (var i = 0; i<archive_list.length; i++) { + for (var i = 0, l=archive_list.length ; i<l ; i++) { var current_arch = archive_list[i]; if (current_arch.value.hasOwnProperty($scope.selected_subpart)) { - $scope.data.data.push({'x': i, + $scope.data.data.push({'x': l - (i+l), 'y': [current_arch.value[$scope.selected_subpart]], 'tooltip': current_arch.value[$scope.selected_subpart] + " @ " + current_arch.date.split('.')[0] @@ -758,9 +763,9 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance // there is no subpart $scope.data.series = [$scope.selected_mod]; var archive_list = $scope.archive[$scope.selected_mod][$scope.selected_period] - for (var i = 0; i < archive_list.length; i++) { + for (var i = 0, l=archive_list.length ; i<l ; i++) { var current_arch = archive_list[i]; - $scope.data.data.push({'x': i, + $scope.data.data.push({'x': l - (i+l), 'y': [current_arch.value], 'tooltip': current_arch.value + " @ " + current_arch.date.split('.')[0] diff --git a/views/dashboard.html b/views/dashboard.html index 9b65af6..4646b22 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -177,7 +177,6 @@ <h3 class="modal-title">Notifications for {{addr_host}}{{grp_name}}</h3> </div> <div class="modal-body"> - {{subscribers}} <div ng-repeat="(username, subscriber) in subscribers"> {{username}} will be notified: <ul> diff --git a/views/hostpage.html b/views/hostpage.html index 9abfbd8..d095168 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -109,6 +109,11 @@ </optgroup> </select> + <!--<div ng-show="selected_mod_part!=''"> + {{selected_mod_part}}: compatible os: {{items.loaded_moni_mod[selected_mod_part].compatible_os}} <br/> + compatible connections: {{items.loaded_moni_mod[selected_mod_part].compatible_conn}} + </div>--> + <accordion close-others="false"> <accordion-group heading="Essential configuration (nmap detection)"> diff --git a/views/index.html b/views/index.html index 4760e36..9e03a25 100644 --- a/views/index.html +++ b/views/index.html @@ -31,6 +31,7 @@ <script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script> + <!-- Controllers --> <script src="static/js/mumApp.js"></script> <script src="static/js/controllers/dashboardCtrl.js"></script> <script src="static/js/controllers/hostPageCtrl.js"></script> @@ -42,12 +43,6 @@ <script src="static/js/controllers/statsCtrl.js"></script> <script src="static/js/controllers/usersCtrl.js"></script> - - <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> - <!--[if lt IE 9]><!-- - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> </head> <body> @@ -100,21 +95,17 @@ <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar sidebar-fixed-left"> <li><a href="#dashboard">Dashboard</a></li> - <li><a href="#scan">Scan for new machines</a></li> - <li><a href="#settings">Check the default settings</a></li> + <li><a href="#stats">Statistics</a></li> + <li><hr/></li> <li><a href="#users">Users</a></li> + <li><a href="#settings">Global settings</a></li> <li><a href="#notifications">Notifications summary</a></li> - <li><a href="#stats">See the statistics</a></li> + </ul> </div> <div id="main"> <div ng-view></div> </div> - <!-- Bootstrap core JavaScript - ================================================== --> - <!-- Placed at the end of the document so the pages load faster - <script src="bower_components/jquery/dist/jquery.min.js"></script> - <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>--> </div> </div> </body> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.