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 41af25a8adedd0ce545e2b6ad8980fdf31588d5b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 26 12:24:53 2015 +0200 fullscreen button oh dashboard --- static/js/controllers/dashboardCtrl.js | 9 ++- static/js/controllers/headCtrl.js | 6 ++ views/dashboard.html | 140 ++++++++++++++++++--------------- views/index.html | 3 +- 4 files changed, 91 insertions(+), 67 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index a26c168..746329c 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -53,6 +53,8 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.view = 'host_view'; + $scope.fullscreen = false; + if (Object.keys($location.search()).length == 0) { // if no status filter in parameters, show all status $scope.status_filter = ["success", "warning", "danger", "idling", ""]; @@ -96,7 +98,12 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r url += $scope.status_filter[i]; $location.search(url); - } + }; + + $scope.set_fullscreen = function(fullscreen_enabled){ + $rootScope.$broadcast("set_fullscreen", fullscreen_enabled); + $scope.fullscreen = fullscreen_enabled; + }; $scope.status = ''; diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index ce43e3e..49a9121 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -7,6 +7,8 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ $scope.task_list = []; + $scope.fullscreen = false; + $scope.$on ("hostsUpdate", function (event) { $scope.items = DataHosts.Items; }); @@ -45,6 +47,10 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ $scope.pop_warning('Warning', args) }); + $scope.$on("set_fullscreen", function(event, args){ + $scope.fullscreen = args; + }); + ws.onmessage = function (evt) { // actions effectuees lors de la reception d'un message via la websocket var obj = JSON.parse(evt.data); for (key in obj) { diff --git a/views/dashboard.html b/views/dashboard.html index 6464346..ef21814 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -5,77 +5,87 @@ <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 + <button type="button" class="btn" aria-label="Fullscreen" + popover-placement="bottom" + popover="Enable/Disable fullscreen" + popover-trigger="mouseenter" + ng-click="set_fullscreen(!fullscreen)"> + <span class="fa fa-expand" + aria-hidden="true"> + </span> + </button> + <!-- Host view --> <div ng-show="view == 'host_view' && items.length > 0"> <h2 class="sub-header">Hosts currently on monitoring</h2> <div class="row" ng-show="items.length > 0"> - - <div class="col-xs-3"> - <label for="host_f">Host filter</label> - <input class="form-control" - type="text" - id="host_f" - ng-model="host_filter" - ng-change="update_url()"> - </div> - - <div class="col-xs-3"> - <label for="addr_f">Address filter</label> - <input class="form-control" - type="text" - id="addr_f" - ng-model="addr_filter" - ng-change="update_url()"> + <div ng-show="!fullscreen"> + <div class="col-xs-3"> + <label for="host_f">Host filter</label> + <input class="form-control" + type="text" + id="host_f" + ng-model="host_filter" + ng-change="update_url()"> + </div> + + <div class="col-xs-3"> + <label for="addr_f">Address filter</label> + <input class="form-control" + type="text" + id="addr_f" + ng-model="addr_filter" + ng-change="update_url()"> + </div> + + <div class="col-xs-3"> + <label for="name_f">Name filter</label> + <input class="form-control" + type="text" + id="name_f" + ng-model="name_filter" + ng-change="update_url()"> + </div> + + <div class="col-xs-2"> + <label for="status_f">Status filter</label> + <select multiple class="form-control input-sm" + id="status_f" + ng-model="status_filter" + ng-change="update_url()"> + <option>success</option> + <option>warning</option> + <option>danger</option> + <option>idling</option> + </select> + </div> + + <div class="col-xs-2"> + <label for="group_f">Group filter</label> + <select class="form-control input-sm" + id="group_f" + ng-model="group_filter" + ng-options="group for group in allGroups() | unique:'group'" + ng-change="update_url()"> + </select> + <!--<ui-select multiple + tagging="tag_transform" + tagging-label="" + ng-model="group_filter" + theme="bootstrap" + sortable="true" + ng-disabled="disabled" + style="width: 300px;" + title="Group filter"> + <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> + <ui-select-choices repeat="group in allGroups() | unique:'group' | filter:$select.search" + refresh-delay="0"> + {{group}} + </ui-select-choices> + </ui-select>--> + </div> </div> - - <div class="col-xs-3"> - <label for="name_f">Name filter</label> - <input class="form-control" - type="text" - id="name_f" - ng-model="name_filter" - ng-change="update_url()"> - </div> - - <div class="col-xs-2"> - <label for="status_f">Status filter</label> - <select multiple class="form-control input-sm" - id="status_f" - ng-model="status_filter" - ng-change="update_url()"> - <option>success</option> - <option>warning</option> - <option>danger</option> - <option>idling</option> - </select> - </div> - - <div class="col-xs-2"> - <label for="group_f">Group filter</label> - <select class="form-control input-sm" - id="group_f" - ng-model="group_filter" - ng-options="group for group in allGroups() | unique:'group'" - ng-change="update_url()"> - </select> - <!--<ui-select multiple - tagging="tag_transform" - tagging-label="" - ng-model="group_filter" - theme="bootstrap" - sortable="true" - ng-disabled="disabled" - style="width: 300px;" - title="Group filter"> - <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> - <ui-select-choices repeat="group in allGroups() | unique:'group' | filter:$select.search" - refresh-delay="0"> - {{group}} - </ui-select-choices> - </ui-select>--> - </div> - <table class="table table-condensed table-hover"> <thead> <tr> diff --git a/views/index.html b/views/index.html index 14dab72..58fca9d 100644 --- a/views/index.html +++ b/views/index.html @@ -91,7 +91,8 @@ </nav> <div class="container-fluid"> <div class="row"> - <div class="col-sm-3 col-md-2 sidebar"> + <div class="col-sm-3 col-md-2 sidebar" + ng-show="!fullscreen"> <ul class="nav nav-sidebar sidebar-fixed-left"> <li><a href="#dashboard">Dashboard</a></li> <!--<li><a href="#stats">Statistics</a></li>--> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.