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 5b0534858af5f181ec887d1b68f89771de42236a Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Jun 9 14:04:49 2015 +0200 group view: link to hostpage + colors displayed --- mum.conf | 6 +- static/js/controllers/dashboardCtrl.js | 21 ++++++- static/js/controllers/hostPageCtrl.js | 3 +- views/dashboard.html | 100 +++++++++++++++++---------------- views/hostpage.html | 8 ++- views/index.html | 2 +- 6 files changed, 82 insertions(+), 58 deletions(-) diff --git a/mum.conf b/mum.conf index 8dcfdc1..ca53a58 100644 --- a/mum.conf +++ b/mum.conf @@ -1,8 +1,8 @@ server_port=1337 server_addr=0.0.0.0 -db_location=mum.db -external_modules_location= -keys_location= +db_location=/var/lib/mum/data/mum.db +external_modules_location=/etc/mum/modules/ +keys_location=/var/lib/mum/keys/ smtp_server= smtp_port= smtp_address= diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index d2fec1b..46d26e1 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -137,14 +137,14 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r for (var i=0, l=allGroups.length ; i<l ; i++){ var current_group_name = allGroups[i]; $scope.group_obj[current_group_name] = {}; - $scope.group_obj[current_group_name].hosts = []; + $scope.group_obj[current_group_name].hosts = {}; //{addr: color} $scope.group_obj[current_group_name].status = 'success'; } for (var pos_host=0, l=$scope.items.length ; pos_host < l ; pos_host++){ var current_host_name = $scope.items[pos_host].addr; for (var pos_grp=0, l_grp=$scope.items[pos_host].group.length ; pos_grp<l_grp ; pos_grp++){ var current_group_name = $scope.items[pos_host].group[pos_grp]; - $scope.group_obj[current_group_name].hosts.push(current_host_name); + $scope.group_obj[current_group_name].hosts[current_host_name] = get_color($scope.items[pos_host].status); if ($scope.items[pos_host].status == 'danger'){ $scope.group_obj[current_group_name].status = 'danger'; } @@ -153,8 +153,23 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } } - delete $scope.group_obj['all']; }; + + var get_color = function(status){ + var color = ""; + switch (status){ + case "success": + color = 'green'; + break; + case "warning": + color = 'orange'; + break; + case "danger": + color = 'red'; + break; + } + return color; + } }); mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, notif_args) { diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 5889a49..15326b2 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -826,7 +826,8 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance //could be 'left, right' position: 'right' }, - waitForHeightAndWidth: true + waitForHeightAndWidth: true, + isAnimate: false }; $scope.data = { diff --git a/views/dashboard.html b/views/dashboard.html index 4646b22..3fb3fd6 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -45,60 +45,61 @@ <table class="table table-condensed table-hover"> <thead> - <tr> - <th><a ng-click="order_val='addr'">Address</a></th> - <th><a ng-click="order_val='name'">Name</a></th> - <th><a ng-click="order_val='status'">Status</a></th> - <th><a ng-click="order_val='group'">Group</a></th> - <th><a ng-click="order_val='last_check'">Last check</a></th> - </tr> + <tr> + <th><a ng-click="order_val='addr'">Address</a></th> + <th><a ng-click="order_val='name'">Name</a></th> + <th><a ng-click="order_val='status'">Status</a></th> + <th><a ng-click="order_val='group'">Group</a></th> + <th><a ng-click="order_val='last_check'">Last check</a></th> + </tr> </thead> <tbody> - <tr ng-repeat="host in items | + <tr ng-repeat="host in items | orderBy:order_val | filter:{addr:addr_filter, name:name_filter, group:group_filter} | filter:filtering_status" - class={{host.status}}> <!-- group.name:group_filter --> - <td><a href="#/hostpage/{{host.addr}}">{{host.addr}}</a></td> - <td>{{host.name}}</td> - <td> - <a popover-placement="bottom" - popover="warning: {{host.warning}} ; danger: {{host.danger}}" - popover-trigger="mouseenter">{{host.status}} - </a> - </td> - <td> - <ui-select multiple - tagging="tag_transform" - tagging-label="" - ng-model="host.group" - theme="bootstrap" - sortable="true" - ng-disabled="disabled" - style="width: 300px;" - title="Add or remove to a group" - on-remove="rem_host_to_group(host.addr, $item)" - on-select="add_host_to_group(host.addr, $item)"> - <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> - <ui-select-choices repeat="group in allGroups() | filter:$select.search"> - {{group}} - </ui-select-choices> - </ui-select> - </td> - <!--<td>{{host.group}}</td>--> - <td>{{host.last_check.split('.')[0]}}</td> - <td> - <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" - popover-placement="left" - popover="{{host.nb_subscribers}} subscribers" - popover-trigger="mouseenter" - ng-click="open_modal_notif(host.addr, null)"> + class={{host.status}}> <!-- group.name:group_filter --> + <td><a href="#/hostpage/{{host.addr}}">{{host.addr}}</a></td> + <td>{{host.name}}</td> + <td> + <a popover-placement="bottom" + popover="warning: {{host.warning}} ; danger: {{host.danger}}" + popover-trigger="mouseenter">{{host.status}} + </a> + </td> + <td> + <ui-select multiple + tagging="tag_transform" + tagging-label="" + ng-model="host.group" + theme="bootstrap" + sortable="true" + ng-disabled="disabled" + style="width: 300px;" + title="Add or remove to a group" + on-remove="rem_host_to_group(host.addr, $item)" + on-select="add_host_to_group(host.addr, $item)"> + <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> + <ui-select-choices repeat="group in allGroups() | unique | filter:$select.search" + refresh-delay="0"> + {{group}} + </ui-select-choices> + </ui-select> + </td> + <!--<td>{{host.group}}</td>--> + <td>{{host.last_check.split('.')[0]}}</td> + <td> + <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" + popover-placement="left" + popover="{{host.nb_subscribers}} subscribers" + popover-trigger="mouseenter" + ng-click="open_modal_notif(host.addr, null)"> <span class="glyphicon glyphicon-user" aria-hidden="true"> </span> - </button> - </td> - </tr> + </button> + </td> + </tr> </tbody> </table> <a href="#scan"> @@ -139,7 +140,12 @@ orderBy:order_val" class="{{group.status}}"> <!-- group:{name:grp} --> <td>{{groupname}}</td> - <td>{{group.hosts}}</td> + <td> + <div ng-repeat="(host, color) in group.hosts"> + <a href="#/hostpage/{{host}}" + style="color: {{color}}">{{host}}</a> + </div> + </td> <td>{{group.status}}</td> <td> <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" diff --git a/views/hostpage.html b/views/hostpage.html index d095168..bbdabbd 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -1,6 +1,6 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Current state of {{addr_host}} <small>{{items.hostname}} + <h1 class="page-header">Current state of {{items.hostname}}<small> {{addr_host}} <button type="button" class="btn btn-{{get_idle_state()}}" aria-label="Button activation" @@ -63,7 +63,9 @@ </button> </td> <td> - <button type="button" class="btn btn-primary btn-xs" + <button type="button" + class="btn btn-primary btn-xs" + ng-show="get_type_of(mod.value) != 'object'" ng-click="open_modal_stats(addr_host, modname, '')">Archives </button> </td> @@ -348,7 +350,7 @@ <div class="form-group"> <label for="username">User</label> - <input type="text" class="form-control" id="username" ng-model="user"> {{user}} + <input type="text" class="form-control" id="username" ng-model="user"> <label for="date">Date (YYYY-MM-DD HH:MM)</label> <input type="datetime" class="form-control" id="date" ng-model="date"> diff --git a/views/index.html b/views/index.html index 9e03a25..778506f 100644 --- a/views/index.html +++ b/views/index.html @@ -95,7 +95,7 @@ <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="#stats">Statistics</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> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.