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 d71e23aaac97254ed5cd6f2fb0b015ef85ff0b62 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 15:08:58 2015 +0200 views on URL + fullscreen on every views --- static/js/controllers/dashboardCtrl.js | 21 +++++++++++++---- views/dashboard.html | 41 +++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 3c841fd..41c7e68 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -10,6 +10,8 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r //$scope.gap = 5; + var first_loading = true; + $scope.items = DataHosts.Items; /* [ { "addr":"192.168.74.1", @@ -32,6 +34,15 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.$on("hostsUpdate", function (event) { $scope.items = DataHosts.Items; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_groups','args': null}})); + $scope.update_group_obj; + $scope.update_service_obj; + if (first_loading){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_MONI_MOD": null})); + first_loading = false; + } + else{ + $scope.update_category_obj; + } }); $scope.$on("resCall", function (event, args) { @@ -81,6 +92,8 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.update_url = function () { var url = ""; + url += "view=" + $scope.view + "&"; + url += "fullscreen=" + $scope.fullscreen + "&"; url += "host_filter=" + $scope.host_filter + "&"; @@ -106,6 +119,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.set_fullscreen = function(fullscreen_enabled){ $rootScope.$broadcast("set_fullscreen", fullscreen_enabled); $scope.fullscreen = fullscreen_enabled; + $scope.update_url(); }; $scope.status = ''; @@ -236,6 +250,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } } + $scope.update_url(); }; /*** SERVICE VIEW FUNCIONS ***/ @@ -268,6 +283,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.service_obj[tab_danger[j]].danger.push($scope.items[i].display_name); } } + $scope.update_url(); }; /*** CATEGORY VIEW FUNCIONS ***/ @@ -280,10 +296,6 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r return Object.keys($scope.category_obj).length > 0; }; - $scope.get_loaded_moni_mod = function (){ - $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_MONI_MOD": null})); - }; - $scope.$on("resGetLoadedMoniMod", function (event, args) { $timeout(function () { $scope.loaded_moni_mod = args; @@ -315,5 +327,6 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.category_obj[category].danger.push($scope.items[i].display_name + " on " + tab_danger[j]); } } + $scope.update_url(); }; }); \ No newline at end of file diff --git a/views/dashboard.html b/views/dashboard.html index 2fff242..33b7212 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -1,6 +1,7 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Dashboard + <h1 class="page-header" + ng-show="!fullscreen">Dashboard <small><button type="button" class="btn" aria-label="Fullscreen" popover-placement="bottom" popover="Fullscreen" @@ -13,10 +14,10 @@ </h1> <div ng-show="!fullscreen"> - <input type="radio" value="host_view" ng-model="view"> Host view - <input type="radio" value="group_view" ng-model="view" ng-click="update_group_obj()"> Group view - <input type="radio" value="service_view" ng-model="view" ng-click="update_service_obj()"> Service view - <input type="radio" value="category_view" ng-model="view" ng-click="get_loaded_moni_mod()"> Category view + <input type="radio" value="host_view" ng-model="view" ng-change="update_url()"> Host view + <input type="radio" value="group_view" ng-model="view" ng-change="update_group_obj()"> Group view + <input type="radio" value="service_view" ng-model="view" ng-change="update_service_obj()"> Service view + <input type="radio" value="category_view" ng-model="view" ng-change="get_loaded_moni_mod()"> Category view </div> @@ -183,10 +184,12 @@ <!-- Group view --> - <div ng-show="view == 'group_view' && items.length > 0">{{group_obj}} - <h2 class="sub-header">Hosts currently on monitoring (by group)</h2> + <div ng-show="view == 'group_view' && items.length > 0"> + <h2 class="sub-header" + ng-show="!fullscreen">Hosts currently on monitoring (by group)</h2> <div class="row"> - <div class="col-xs-2"> + <div class="col-xs-2" + ng-show="!fullscreen"> <label for="status_f_grp">Status filter</label> <select multiple class="form-control input-sm" id="status_f_grp" @@ -199,7 +202,8 @@ </select> </div> - <div class="col-xs-2"> + <div class="col-xs-2" + ng-show="!fullscreen"> <label for="group_f_grp">Group filter</label> <select class="form-control input-sm" id="group_f_grp" @@ -268,7 +272,8 @@ <div ng-show="view == 'service_view' && items.length > 0"> <div ng-show="is_services_in_alert()"> - <h2 class="sub-header">Services in alert...</h2> + <h2 class="sub-header" + ng-show="!fullscreen">Services in alert...</h2> <table class="table table-condensed table-hover"> <thead> @@ -307,7 +312,8 @@ <div ng-show="view == 'category_view' && items.length > 0"> <div ng-show="is_category_in_alert()"> - <h2 class="sub-header">Categories in alert...</h2> + <h2 class="sub-header" + ng-show="!fullscreen">Categories in alert...</h2> <table class="table table-condensed table-hover"> <thead> @@ -355,4 +361,17 @@ If you are ready, <a href="#scan">scan for new machines</a>! </p> </div> + + <div class="row" + ng-show="fullscreen"> + <button type="button" class="btn" aria-label="Disable fullscreen" + popover-placement="up" + popover="Disable fullscreen" + popover-trigger="mouseenter" + ng-click="set_fullscreen(!fullscreen)"> + <span class="fa fa-compress" + aria-hidden="true"> + </span> + </button> + </div> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.