branch develop updated (1ecd69d -> dec3951)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from 1ecd69d subscription on service new 111b8f9 dashboard : all filters update the url new 11ca696 log modal button moved to menu bar new e3a8844 removed profile page and merged with user page new dec3951 exception raised on snmp conn on more cases The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit dec3951ad50ee41b6c11275f598c3d348a0ac8a7 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 18:21:23 2015 +0200 exception raised on snmp conn on more cases commit e3a8844d57b7936a7a094f6aa5706b217596c286 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 14:54:28 2015 +0200 removed profile page and merged with user page commit 11ca6963d0c23551c99758a761e1b7f92d84166e Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 13:52:27 2015 +0200 log modal button moved to menu bar commit 111b8f996fcb84a07f77e8f7bad9c37edbd7f48b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 11:31:24 2015 +0200 dashboard : all filters update the url Summary of changes: app/modules/connection_modules/snmp.py | 8 ++ app/modules/connection_modules/snmp_walk.py | 8 ++ app/mum.py | 4 - static/js/controllers/dashboardCtrl.js | 63 ++++++------ static/js/controllers/headCtrl.js | 29 +++++- static/js/controllers/profileCtrl.js | 105 -------------------- static/js/controllers/usersCtrl.js | 31 +++++- static/js/mumApp.js | 17 ++-- views/dashboard.html | 45 ++++----- views/index.html | 28 +++++- views/profile.html | 144 ---------------------------- views/users.html | 51 ++++++++-- 12 files changed, 189 insertions(+), 344 deletions(-) delete mode 100644 static/js/controllers/profileCtrl.js delete mode 100644 views/profile.html -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 111b8f996fcb84a07f77e8f7bad9c37edbd7f48b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 11:31:24 2015 +0200 dashboard : all filters update the url --- static/js/controllers/dashboardCtrl.js | 36 +++++++++++++++++++++++++--------- static/js/mumApp.js | 13 +++++++----- views/dashboard.html | 21 ++++++++++++++++---- 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 98e9acc..8e3d839 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -47,38 +47,56 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.host_filter = ''; // input field $scope.addr_filter = ''; // input field $scope.name_filter = ''; // input field + $scope.group_filter = ''; $scope.order_val = 'status'; // select field $scope.view = 'host_view'; - if ($routeParams.param == null) { + if (Object.keys($location.search()).length == 0) { // if no status filter in parameters, show all status $scope.status_filter = ["success", "warning", "danger", "idling", ""]; } else { // multiple params should be separated by ',' - $scope.status_filter = []; - tab_params = $routeParams.param.split(','); - for (var i = 0; i<tab_params.length; i++) { - $scope.status_filter.push(tab_params[i]); + for (var key in $location.search()){ + + if ( key == 'status_filter' ){ + $scope.status_filter = []; + status_tab = $location.search()[key].split(','); + for (var i = 0; i<status_tab.length; i++) { + $scope.status_filter.push(status_tab[i]); + } + } + else{ + $scope[key] = $location.search()[key]; + } } } $scope.update_url = function () { - var url = "/dashboard/"; + var url = ""; + + url += "host_filter=" + $scope.host_filter + "&"; + + url += "addr_filter=" + $scope.addr_filter + "&"; + + url += "name_filter=" + $scope.name_filter + "&"; + + url += "group_filter=" + $scope.group_filter + "&"; + var nb_attr = $scope.status_filter.length; var i = 0; + url += "status_filter=" while ( i<nb_attr - 1 ) { url += $scope.status_filter[i] + ','; i++; } url += $scope.status_filter[i]; - $location.path(url); - } - $scope.group_filter = ''; + $location.search(url); + } $scope.status = ''; diff --git a/static/js/mumApp.js b/static/js/mumApp.js index b3688ae..a1001fc 100644 --- a/static/js/mumApp.js +++ b/static/js/mumApp.js @@ -8,15 +8,18 @@ mumApp.config(function ($routeProvider) { $routeProvider .when('/',{ templateUrl : 'dashboard.html', - controller : 'dashboardCtrl' + controller : 'dashboardCtrl', + reloadOnSearch: false }) .when('/dashboard/',{ templateUrl : 'dashboard.html', - controller : 'dashboardCtrl' + controller : 'dashboardCtrl', + reloadOnSearch: false }) .when('/dashboard/:param/',{ templateUrl : 'dashboard.html', - controller : 'dashboardCtrl' + controller : 'dashboardCtrl', + reloadOnSearch: false }) .when('/hostpage/:param/',{ templateUrl : 'hostpage.html', @@ -59,9 +62,9 @@ mumApp.config(function ($routeProvider) { }); }); -/*mumApp.config(function($locationProvider)){ +mumApp.config(function($locationProvider){ $locationProvider.html5Mode(false); -});*/ +}); mumApp.$inject = ['$scope', '$filter']; diff --git a/views/dashboard.html b/views/dashboard.html index 7be0830..0e2203f 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -13,17 +13,29 @@ <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"> + <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"> + <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"> + <input class="form-control" + type="text" + id="name_f" + ng-model="name_filter" + ng-change="update_url()"> </div> <div class="col-xs-2"> @@ -44,7 +56,8 @@ <select class="form-control input-sm" id="group_f" ng-model="group_filter" - ng-options="group for group in allGroups() | unique:'group'"> + ng-options="group for group in allGroups() | unique:'group'" + ng-change="update_url()"> </select> <!--<ui-select multiple tagging="tag_transform" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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>.
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 e3a8844d57b7936a7a094f6aa5706b217596c286 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 14:54:28 2015 +0200 removed profile page and merged with user page --- app/mum.py | 4 - static/js/controllers/profileCtrl.js | 105 ------------------------- static/js/controllers/usersCtrl.js | 31 +++++++- static/js/mumApp.js | 4 - views/index.html | 2 - views/profile.html | 144 ----------------------------------- views/users.html | 51 ++++++++++--- 7 files changed, 70 insertions(+), 271 deletions(-) diff --git a/app/mum.py b/app/mum.py index a426c0c..91a9f06 100755 --- a/app/mum.py +++ b/app/mum.py @@ -30,10 +30,6 @@ def angular(): def angular(): return template('notifications') -@route('/profile.html') -def angular(): - return template('profile') - @route('/scan.html') def angular(): return template('scan') diff --git a/static/js/controllers/profileCtrl.js b/static/js/controllers/profileCtrl.js deleted file mode 100644 index e4dff89..0000000 --- a/static/js/controllers/profileCtrl.js +++ /dev/null @@ -1,105 +0,0 @@ -mumApp.controller('profileCtrl', function ($scope, $rootScope, $route, $modal, $timeout) { - - $scope.users = {}; - - $scope.selected_user = ""; - - $scope.email = ""; - $scope.sms_url = ""; - - $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_users', 'args': null}})); - - // after calling db functions - $scope.$on("resCall", function (event, args) { - if (args.func == 'get_users') { - $timeout(function () { - $scope.users = args.res; - }, 0); - } - if (args.func == 'get_user_settings') { - $timeout(function () { - $scope.email = args.res.settings.email; - $scope.sms_url = args.res.settings.sms_url; - }, 0); - } - if (args.func == 'update_user_settings') { - $route.reload(); - } - }); - - $scope.get_user_settings = function () { - var args = {}; - if ($scope.selected_user != '') { - args['username'] = $scope.selected_user; - } - - $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_user_settings', 'args': args}})); - }; - - $scope.save_settings = function () { - var args = {}; - args['username'] = $scope.selected_user; - args['settings'] = {}; - args['settings']['email'] = $scope.email; - args['settings']['sms_url'] = $scope.sms_url; - - $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'update_user_settings', 'args': args}})); - }; - - // creation of modals - $scope.open_modal_subscriptions = function () { - var modalInstance = $modal.open({ - templateUrl: 'modal_subscriptions_label.html', - controller: 'ModalSubscriptionsInstanceCtrl', - resolve: { - subs_args: function () { - return {'username': $scope.selected_user}; - } - } - }); - }; -}); - -mumApp.controller('ModalSubscriptionsInstanceCtrl', function ($scope, $rootScope, $modalInstance, $timeout, subs_args) { - $scope.subs_args = subs_args; // { 'username': stringĀ } - - $scope.user_subscriptions = {}; /* - { - 'hosts':{ - addr_host:{ - 'major':{ - notif_mod:{ - 'priority': int, - 'activated': bool - }, ... - } - 'minor':{...} - }, ... - }, - 'groups':{ ... } - } - */ - - $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_user_subscriptions', - 'args': $scope.subs_args['username']}})); - - $scope.$on("resCall", function (event, args) { - if (args.func == 'get_user_subscriptions') { - $timeout(function () { - $scope.user_subscriptions = args.res; - }, 0); - } - }); - - $scope.get_class = function (sub_part, sub_type, target_name, notif_mod) { - var res = ""; - if ($scope.user_subscriptions[sub_part][target_name][sub_type][notif_mod]['activated']) { - res = "success"; - } - return res; - }; - - $scope.close = function () { - $modalInstance.close(); - }; -}); \ No newline at end of file diff --git a/static/js/controllers/usersCtrl.js b/static/js/controllers/usersCtrl.js index 4d616c0..42bb483 100644 --- a/static/js/controllers/usersCtrl.js +++ b/static/js/controllers/usersCtrl.js @@ -3,8 +3,6 @@ mumApp.controller('usersCtrl', function ($scope, $rootScope, $route, $timeout) { $scope.selected_user = ""; - $scope.show_new_user = false; - $scope.new_username = ""; $scope.user_subscriptions = {}; /* @@ -40,6 +38,16 @@ mumApp.controller('usersCtrl', function ($scope, $rootScope, $route, $timeout) { $timeout(function () { $scope.user_subscriptions = args.res; }, 0); + $scope.get_user_settings(); + } + if (args.func == 'get_user_settings') { + $timeout(function () { + $scope.email = args.res.settings.email; + $scope.sms_url = args.res.settings.sms_url; + }, 0); + } + if (args.func == 'update_user_settings') { + $route.reload(); } }); @@ -72,4 +80,23 @@ mumApp.controller('usersCtrl', function ($scope, $rootScope, $route, $timeout) { return res; }; + $scope.get_user_settings = function () { + var args = {}; + if ($scope.selected_user != '') { + args['username'] = $scope.selected_user; + } + + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_user_settings', 'args': args}})); + }; + + $scope.save_settings = function () { + var args = {}; + args['username'] = $scope.selected_user; + args['settings'] = {}; + args['settings']['email'] = $scope.email; + args['settings']['sms_url'] = $scope.sms_url; + + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'update_user_settings', 'args': args}})); + }; + }); \ No newline at end of file diff --git a/static/js/mumApp.js b/static/js/mumApp.js index a1001fc..69f0db7 100644 --- a/static/js/mumApp.js +++ b/static/js/mumApp.js @@ -29,10 +29,6 @@ mumApp.config(function ($routeProvider) { templateUrl : 'notifications.html', controller : 'notificationsCtrl' }) - .when('/profile/',{ - templateUrl : 'profile.html', - controller : 'profileCtrl' - }) .when('/scan/',{ templateUrl : 'scan.html', controller : 'scanCtrl' diff --git a/views/index.html b/views/index.html index 9ed3ee7..14dab72 100644 --- a/views/index.html +++ b/views/index.html @@ -38,7 +38,6 @@ <script src="static/js/controllers/hostPageCtrl.js"></script> <script src="static/js/controllers/headCtrl.js"></script> <script src="static/js/controllers/notificationsCtrl.js"></script> - <script src="static/js/controllers/profileCtrl.js"></script> <script src="static/js/controllers/scanCtrl.js"></script> <script src="static/js/controllers/settingsCtrl.js"></script> <script src="static/js/controllers/statsCtrl.js"></script> @@ -85,7 +84,6 @@ </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> - <li><a href="#profile">Profile</a></li> <li><a href="signin.html">Logout</a></li> </ul> </div> diff --git a/views/profile.html b/views/profile.html deleted file mode 100644 index 2c4137a..0000000 --- a/views/profile.html +++ /dev/null @@ -1,144 +0,0 @@ -<div class="col-md-offset-2 main"> - <h1 class="page-header">Your account</h1> - <select class="form-control input-sm" id="usrlist" - ng-model="selected_user" - ng-options="user as user for user in users" - ng-change="get_user_settings()"> - </select> - <button type="button" class="btn btn-primary" - ng-click="open_modal_subscriptions()" - ng-disabled="selected_user==''">See your subscriptions</button> - - <!--<h2 class="sub-header">They will be applied on each new host you will add.</h2>--> - <form ng-show="selected_user!=''"> - <div class="row"> - <div class="col-xs-3"> - <label for="username">Username</label> - <input type="text" class="form-control" id="username" - disabled - ng-model="selected_user"> - </div> - <div class="row"></div> - <div class="col-xs-3"> - <label for="pswd">Change password</label> - <input type="password" class="form-control" id="pswd" disabled> - </div> - <div class="col-xs-3"> - <label for="pswd2">Repeat new password</label> - <input type="password" class="form-control" id="pswd2" disabled> - </div> - <div class="row"></div> - <div class="col-xs-4"> - <label for="mail">Email address</label> - <input type="email" class="form-control" id="mail" ng-model="email"> - </div> - <div class="row"></div> - <div class="col-xs-8"> - <label for="cellphone">SMS URL (put #message# on the message parameter)</label> - <input type="text" class="form-control" id="cellphone" ng-model="sms_url"> - </div> - </div> - - <button type="button" class="btn btn-primary" ng-click="save_settings()">Save changes</button> - <!--<h3>Preferences</h3> - - <div class="checkbox"> - <label for="minornotif">Send minor notifications by :</label> - <label> - <input type="checkbox" value="" id="minornotif"> - Browser notification - </label> - <label> - <input type="checkbox" value=""> - E-mail - </label> - <label> - <input type="checkbox" value=""> - SMS - </label> - </div> - - <div class="checkbox"> - <label for="majornotif">Send major notifications by :</label> - <label> - <input type="checkbox" value="" id="majornotif"> - Browser notification - </label> - <label> - <input type="checkbox" value=""> - E-mail - </label> - <label> - <input type="checkbox" value=""> - SMS - </label> - </div> - - ---> - </form> - - <script type="text/ng-template" id="modal_subscriptions_label.html"> - <div class="modal-header"> - <h3 class="modal-title">Summary of your subscriptions</h3> - </div> - <div class="modal-body"> - <p>Number of notifications between 2 logins</p> - <table class="table table-hover"> - <thead> - <tr> - <th>Host</th> - <th>Notification service</th> - <th>Minor</th> - <th>Major</th> - </tr> - </thead> - <tbody> - <tr ng-repeat-start="(addr_host, host) in user_subscriptions.hosts"> - <td>{{addr_host}}</td> - </tr> - <tr ng-repeat-end - ng-repeat="(notif_mod_name, notif_mod) in host.minor"> - <td></td> - <td>{{notif_mod_name}}</td> - <td class="{{get_class('hosts', 'minor', addr_host, notif_mod_name)}}"> - {{notif_mod.priority}} - </td> - <td class="{{get_class('hosts', 'major', addr_host, notif_mod_name)}}"> - {{user_subscriptions.hosts[addr_host].major[notif_mod_name].priority}} - </td> - </tr> - </tbody> - </table> - <table class="table table-hover"> - <thead> - <tr> - <th>Group</th> - <th>Notification service</th> - <th>Minor</th> - <th>Major</th> - </tr> - </thead> - <tbody> - <tr ng-repeat-start="(grp_name, grp) in user_subscriptions.groups"> - <td>{{grp_name}}</td> - </tr> - <tr ng-repeat-end - ng-repeat="(notif_mod_name, notif_mod) in grp.minor"> - <td></td> - <td>{{notif_mod_name}}</td> - <td class="{{get_class('groups', 'minor', grp_name, notif_mod_name)}}"> - {{notif_mod.priority}} - </td> - <td class="{{get_class('groups', 'major', grp_name, notif_mod_name)}}"> - {{user_subscriptions.groups[grp_name].major[notif_mod_name].priority}} - </td> - </tr> - </tbody> - </table> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button> - </div> - </script> -</div> \ No newline at end of file diff --git a/views/users.html b/views/users.html index aeb348c..c289b5d 100644 --- a/views/users.html +++ b/views/users.html @@ -1,5 +1,12 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Users <small>{{selected_user}}</small></h1> + + <input type="text" ng-model="new_username"> + <button type="button" class="btn btn-primary" + ng-disabled="new_username==''" + ng-click="addUser()">Create user + </button> + <div class="row"> <div class="col-xs-4"> <label for="usrlist">Registered users</label> @@ -9,21 +16,45 @@ ng-change="get_user_subscriptions()"></select> </div> </div> - <button type="button" class="btn btn-primary" data-toggle="popover" - data-placement="bottom" title="Add user..." data-content="ger" - ng-click="show_new_user=!show_new_user">Add user</button> - <input type="text" ng-show="show_new_user" ng-model="new_username"> - <button type="button" class="btn btn-primary" - ng-show="show_new_user && new_username!=''" - ng-click="addUser()">Create user - </button> + <button type="button" class="btn btn-danger" ng-show="selected_user!='' && selected_user!=null" - ng-click="removeUser()">Remove {{selected_user}} + ng-click="removeUser()">Delete {{selected_user}} </button> <div ng-show="selected_user!=''"> - <p>Subscriptions summary:</p> + <div class="row"> + <div class="col-xs-3"> + <label for="username">Username</label> + <input type="text" class="form-control" id="username" + disabled + ng-model="selected_user"> + </div> + <div class="row"></div> + <div class="col-xs-3"> + <label for="pswd">Change password</label> + <input type="password" class="form-control" id="pswd" disabled> + </div> + <div class="col-xs-3"> + <label for="pswd2">Repeat new password</label> + <input type="password" class="form-control" id="pswd2" disabled> + </div> + <div class="row"></div> + <div class="col-xs-4"> + <label for="mail">Email address</label> + <input type="email" class="form-control" id="mail" ng-model="email"> + </div> + <div class="row"></div> + <div class="col-xs-8"> + <label for="cellphone">SMS URL (put #message# on the message parameter)</label> + <input type="text" class="form-control" id="cellphone" ng-model="sms_url"> + </div> + </div> + + <button type="button" class="btn btn-primary" ng-click="save_settings()">Save changes</button> + + <p>This is a summary of this user's subscriptions. You can change the subscriptions on the + dashboard table or a specific host page.</p> <table class="table table-hover"> <thead> <tr> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 dec3951ad50ee41b6c11275f598c3d348a0ac8a7 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 24 18:21:23 2015 +0200 exception raised on snmp conn on more cases --- app/modules/connection_modules/snmp.py | 8 ++++++++ app/modules/connection_modules/snmp_walk.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/app/modules/connection_modules/snmp.py b/app/modules/connection_modules/snmp.py index 1deff5f..d21590d 100644 --- a/app/modules/connection_modules/snmp.py +++ b/app/modules/connection_modules/snmp.py @@ -43,12 +43,20 @@ class SNMP: # Check for errors and print out results if errorIndication: self.logger.warning(errorIndication) + exception_inst = getattr(self.CommandNotFoundException, "CommandNotFoundException")( + cmd, self.addr_host + ) + raise exception_inst else: if errorStatus: self.logger.warning('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1] or '?' )) + exception_inst = getattr(self.CommandNotFoundException, "CommandNotFoundException")( + cmd, self.addr_host + ) + raise exception_inst else: for name, val in varBinds: if val == "": diff --git a/app/modules/connection_modules/snmp_walk.py b/app/modules/connection_modules/snmp_walk.py index c3ddcd2..1e0f28d 100644 --- a/app/modules/connection_modules/snmp_walk.py +++ b/app/modules/connection_modules/snmp_walk.py @@ -43,12 +43,20 @@ class SNMPWalk: # Check for errors and print out results if errorIndication: self.logger.warning(errorIndication) + exception_inst = getattr(self.CommandNotFoundException, "CommandNotFoundException")( + cmd, self.addr_host + ) + raise exception_inst else: if errorStatus: self.logger.warning('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBindTable[-1][int(errorIndex)-1] or '?' )) + exception_inst = getattr(self.CommandNotFoundException, "CommandNotFoundException")( + cmd, self.addr_host + ) + raise exception_inst else: for varBindTableRow in varBindTable: for name, val in varBindTableRow: -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm