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 11ca6963d0c23551c99758a761e1b7f92d84166e Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 13:52:27 2015 +0200 log modal button moved to menu bar --- static/js/controllers/dashboardCtrl.js | 27 --------------------------- static/js/controllers/headCtrl.js | 29 ++++++++++++++++++++++++++++- views/dashboard.html | 24 ------------------------ views/index.html | 26 +++++++++++++++++++++++--- 4 files changed, 51 insertions(+), 55 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 8e3d839..a26c168 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -165,14 +165,6 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r }); }; - $scope.open_modal_log = function () { - var modalInstance = $modal.open({ - templateUrl: 'modal_log_label.html', - controller: 'ModalLogInstanceCtrl', - size: 'lg' - }); - }; - /* Group view functions */ $scope.groups = {};/*{ grp_name: { 'hosts': [host1, ...], 'subscribers': { usr: { 'minor': int, 'major': int }, ... @@ -238,23 +230,4 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } return color; } -}); - -mumApp.controller('ModalLogInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout) { - $scope.log_content = ""; - $scope.nb_lines = 50; - - $scope.update = function(){ - $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOGS": $scope.nb_lines})); - }; - - $scope.$on("resGetLogs", function (event, args) { - $timeout(function () { - $scope.log_content = args; - }, 0); - }); - - $scope.close = function () { - $modalInstance.close(); - }; }); \ No newline at end of file diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index 4a32550..ce43e3e 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $routeParams, $location, DataHosts) { +mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $routeParams, $location, $modal, DataHosts) { // init //$scope.master = {}; @@ -167,6 +167,14 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ return res; }; + $scope.open_modal_log = function () { + var modalInstance = $modal.open({ + templateUrl: 'modal_log_label.html', + controller: 'ModalLogInstanceCtrl', + size: 'lg' + }); + }; + }); mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, notif_args) { @@ -304,4 +312,23 @@ mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modal $scope.close = function () { $modalInstance.close(); }; +}); + +mumApp.controller('ModalLogInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout) { + $scope.log_content = ""; + $scope.nb_lines = 50; + + $scope.update = function(){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOGS": $scope.nb_lines})); + }; + + $scope.$on("resGetLogs", function (event, args) { + $timeout(function () { + $scope.log_content = args; + }, 0); + }); + + $scope.close = function () { + $modalInstance.close(); + }; }); \ No newline at end of file diff --git a/views/dashboard.html b/views/dashboard.html index 0e2203f..6464346 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -231,28 +231,4 @@ If you are ready, <a href="#scan">scan for new machines</a>! </p> </div> - - <div class="row"> - <button type="button" class="btn btn-default" ng-click="open_modal_log()">See the logs...</button> - </div> - - <script type="text/ng-template" id="modal_log_label.html"> - <div class="modal-header"> - <h3 class="modal-title">Logs from Mum Service</h3> - </div> - - <div class="modal-body"> - <label for="lines_nb_log">Number of lines to get from log</label> - <input type="number" id="lines_nb_log" min="1" ng-model="nb_lines"/> - - <button type="button" class="btn btn-info" data-dismiss="modal" ng-click="update()">Update</button> - - <textarea class="form-control" rows="20" ng-model="log_content"></textarea> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button> - <!--<button type="button" class="btn btn-primary" ng-click="save()">Save changes</button>--> - </div> - </script> - </div> \ No newline at end of file diff --git a/views/index.html b/views/index.html index 00b08de..9ed3ee7 100644 --- a/views/index.html +++ b/views/index.html @@ -46,11 +46,11 @@ </head> - <body> + <body ng-controller="headCtrl"> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> - <div class="navbar-header" ng-controller="headCtrl"> + <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> @@ -101,7 +101,8 @@ <li><a href="#users">Users</a></li> <li><a href="#settings">Global settings</a></li> <li><a href="#notifications">Notifications summary</a></li> - + <li><hr/></li> + <li><a ng-click="open_modal_log()">See the logs...</a></li> </ul> </div> <div id="main"> @@ -190,6 +191,25 @@ </div> </script> + <script type="text/ng-template" id="modal_log_label.html"> + <div class="modal-header"> + <h3 class="modal-title">Logs from Mum Service</h3> + </div> + + <div class="modal-body"> + <label for="lines_nb_log">Number of lines to get from log</label> + <input type="number" id="lines_nb_log" min="1" ng-model="nb_lines"/> + + <button type="button" class="btn btn-info" data-dismiss="modal" ng-click="update()">Update</button> + + <textarea class="form-control" rows="20" ng-model="log_content"></textarea> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button> + <!--<button type="button" class="btn btn-primary" ng-click="save()">Save changes</button>--> + </div> + </script> + </body> </html> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.