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 d137cb9d839afa5b456ce1ea31464bc5c65a747d Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Mar 11 13:53:45 2015 +0100 hostpage : check now => OK --- app/app.py | 5 ++++- static/js/controllers/hostPageCtrl.js | 7 +++++++ views/hostpage.html | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/app.py b/app/app.py index 42536fc..30de1e7 100755 --- a/app/app.py +++ b/app/app.py @@ -146,6 +146,9 @@ def receive(ws): ws.send(json_dumps({"RES_GET_LOADED_MONI_MOD": ml.get_info_mod_monitoring()})) elif code == "SET_MOD_ACTIVATION": ml.update_activated_modules(msg["SET_MOD_ACTIVATION"]) + elif code == "CHECK_NOW": + args = msg["CHECK_NOW"] + ml.run_one_monitoring_module(args['mod_name'], args['addr_host'], None, None) else: break except WebSocketError: # Should be WebSocketError when closing the connection @@ -161,6 +164,6 @@ if __name__ == '__main__': ml.load_all_monitoring_modules() ml.load_all_connection_modules() wsc = WebSocketContainer(ml.get_db()) - process_monitoring.init(ml, wsc) + #process_monitoring.init(ml, wsc) port = int(os.environ.get('PORT', 1337)) run(host='0.0.0.0', port=port, debug=True, server=GeventWebSocketServer) \ No newline at end of file diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 19effef..62106c8 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -34,6 +34,13 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $routeParams, $mo */ $scope.model = {custom_infos : ''}; + $scope.check = function(modname){ + var args = {}; + args['mod_name'] = modname; + args['addr_host'] = $scope.addr_host; + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CHECK_NOW": args})); + }; + $scope.watch('model.custom_infos', function(){ console.log($scope.model.custom_infos); }) diff --git a/views/hostpage.html b/views/hostpage.html index 729266a..a8d037c 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -23,7 +23,7 @@ <td>{{item.state}}</td> <td>{{item.date}}</td> <td><button type="button" class="btn btn-primary btn-xs" ng-click="open_modal_conf(itemname)">Configure</button></td> - <td><button type="button" class="btn btn-info btn-xs">Check now</button></td> + <td><button type="button" class="btn btn-info btn-xs" ng-click="check(itemname)">Check now</button></td> </tr> </tbody> </table> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.