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 19cf2a0111c54a20fbf133d12550943e76a6096c Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Mar 17 14:09:35 2015 +0100 dashboard : filtre de groupes rétabli --- static/js/controllers/dashboardCtrl.js | 36 +++++++++++++++++++--------------- static/js/controllers/groupCtrl.js | 4 ++-- views/dashboard.html | 4 ++-- views/groups.html | 2 +- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 4b7a783..95ced9e 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -8,7 +8,23 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH $scope.gap = 5; - $scope.items = DataHosts.Items; + $scope.items = DataHosts.Items; /* [ + { + "addr":"192.168.74.1", + "name":"www.example.com", + "status":val, //"success" or "warning" or "danger" or "" + "group":[ "all", ...], + "last_check":val //UNIX time + "subscribers":{ + "uid":val, + "priority":val + } + "warning": [mod_name, ...] + "danger": [mod_name, ...] + }, + ... + ] + */ $scope.$on("hostsUpdate", function (event) { $scope.items = DataHosts.Items; @@ -112,7 +128,7 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH // $scope.groupsByAddr = {} - $scope.getGroupsByAddr = function(addr) { + /*$scope.getGroupsByAddr = function(addr) { res = "" for(var i = 0; i<$scope.items.length; i++){ if($scope.items[i].addr === addr){ @@ -122,27 +138,15 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH } } return res; - }; + };*/ $scope.allGroups = function(){ var res = [] for(var i = 0; i<$scope.items.length; i++){ for(var j = 0; j<$scope.items[i].group.length; j++){ - res.push($scope.items[i].group[j].name); + res.push($scope.items[i].group[j]); } } return res; }; - - $scope.checkAll = function(){ - if($scope.selectedAll){ - $scope.selectedAll = true; - } - else{ - $scope.selectedAll = false; - } - angular.forEach($scope.items, function(item){ - item.Selected = $scope.selectedAll; - }); - }; }); \ No newline at end of file diff --git a/static/js/controllers/groupCtrl.js b/static/js/controllers/groupCtrl.js index b9bb876..5c40294 100644 --- a/static/js/controllers/groupCtrl.js +++ b/static/js/controllers/groupCtrl.js @@ -36,7 +36,7 @@ mumApp.controller('groupCtrl', function($scope, $rootScope, $filter, $route, $ro $scope.grp = "all"; - $scope.getGroupsByAddr = function(addr) { + /*$scope.getGroupsByAddr = function(addr) { res = ""; for(var i = 0; i<$scope.items.length; i++){ if($scope.items[i].addr === addr){ @@ -44,7 +44,7 @@ mumApp.controller('groupCtrl', function($scope, $rootScope, $filter, $route, $ro } } return res; - }; + };*/ $scope.allGroups = function(){ var res = [] diff --git a/views/dashboard.html b/views/dashboard.html index 1a66eb3..0c949a6 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -65,12 +65,12 @@ <tbody> <tr ng-repeat="item in items | orderBy:sort.sortingOrder:sort.reverse | - filter:{addr:addr_filter, name:name_filter, status:status_filter}" class={{item.status}}> <!-- group.name:group_filter --> + filter:{addr:addr_filter, name:name_filter, status:status_filter, group:group_filter}" class={{item.status}}> <!-- group.name:group_filter --> <td><a href="#/hostpage/{{item.addr}}">{{item.addr}}</a></td> <td>{{item.name}}</td> <td>warning : {{item.warning}}<br/> danger : {{item.danger}}</td> - <td>{{getGroupsByAddr(item.addr)}}</td> + <td>{{item.group}}</td> <td>{{item.last_check}}</td> </tr> </tbody> diff --git a/views/groups.html b/views/groups.html index 1be9016..cfd6a3d 100644 --- a/views/groups.html +++ b/views/groups.html @@ -30,7 +30,7 @@ <tr ng-repeat="item in items | filter:{addr:addr_filter, name:name_filter, group:grp}"> <!-- group:{name:grp} --> <td>{{item.addr}}</td> <td>{{item.name}}</td> - <td>{{getGroupsByAddr(item.addr)}}</td> + <td>{{item.group}}</td> <td> <input type="checkbox" ng-model="selection[item.addr]"/> </td> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.