branch develop updated (9e5ed0d -> e9423c9)
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 9e5ed0d hostpage: remove this host => OK new c56fa15 upload minimaliste possible pour les clés new 5584898 upload minimaliste possible pour les clés new e9423c9 qqes corrections dans hostpage The 3 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 e9423c98b877b1e280961c83599dd53e6f60ca9a Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:28:33 2015 +0100 qqes corrections dans hostpage commit 5584898917ab96affb139eef4203733899dc5e0e Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:12:47 2015 +0100 upload minimaliste possible pour les clés commit c56fa15b580d3954827d2c147cbc23656cc997d6 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:11:57 2015 +0100 upload minimaliste possible pour les clés Summary of changes: app/app.py | 11 ++++++++--- app/module_loader.py | 5 +++++ static/js/controllers/headCtrl.js | 3 +++ views/groups.html | 1 - views/hostpage.html | 34 +++++++++++++++++++--------------- 5 files changed, 35 insertions(+), 19 deletions(-) -- 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 c56fa15b580d3954827d2c147cbc23656cc997d6 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:11:57 2015 +0100 upload minimaliste possible pour les clés --- app/app.py | 13 +++++++++---- app/module_loader.py | 3 +++ static/js/controllers/headCtrl.js | 3 +++ views/hostpage.html | 24 ++++++++++++++---------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/app.py b/app/app.py index bea6da4..eda7db5 100755 --- a/app/app.py +++ b/app/app.py @@ -159,11 +159,16 @@ def receive(ws): except WebSocketError: # Should be WebSocketError when closing the connection wsc.remove_websocket(ws) break -""" + @route('/upload', method='POST') def do_upload(): - upload.save(path) -""" + upload = request.files.get('upload') + try: + upload.save(ml.get_public_keys_loc() + upload.filename) + return 'Upload done! <a href="/">Back to dashboard.</a>' + except IOError: + return 'This file already exists. <a href="/">Back to dashboard.</a>' + # Lancement du serveur a l'adresse 0.0.0.0:1337 @@ -175,6 +180,6 @@ if __name__ == '__main__': ml.load_all_connection_modules() ml.load_all_detection_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/app/module_loader.py b/app/module_loader.py index c1a587c..7b8d136 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -49,6 +49,9 @@ class ModuleLoader: def get_db(self): return self.db + def get_public_keys_loc(self): + return self.public_keys_loc + @staticmethod def run_nmap_detection(param, opt, db, ws, list_mod_conn, dict_mod_monitoring): """ diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index f1467c7..a492dd0 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -29,6 +29,7 @@ mumApp.controller('headCtrl', function($scope, $rootScope, toastr, $interval, $r case "SUCCESS_MODULE": // Success of a module execution $rootScope.$broadcast("success", value); toastr.success(value, "Success on module execution"); + break; case "RES_INFO_HOST": // Informations concerning one host $rootScope.$broadcast("hostInfos", JSON.parse(value)); break; @@ -44,6 +45,7 @@ mumApp.controller('headCtrl', function($scope, $rootScope, toastr, $interval, $r break; case "RES_GET_LOADED_MONI_MOD": $rootScope.$broadcast("resGetLoadedMoniMod", JSON.parse(value)); + break; case "RES_CALL_FUNC_DB": // Get a result after calling a funcion on the db $rootScope.$broadcast("resCall", JSON.parse(value)); break; @@ -72,6 +74,7 @@ mumApp.controller('headCtrl', function($scope, $rootScope, toastr, $interval, $r break; case "KEYS_LIST": $rootScope.$broadcast("keysList", JSON.parse(value)); + break; case "ERROR": toastr.error(value, "Server error"); break; diff --git a/views/hostpage.html b/views/hostpage.html index c2cf6e7..c7c53f3 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -149,8 +149,6 @@ <h3 class="modal-title">Connection configuration</h3> </div> <div class="modal-body"> - {{current_config}} - {{priorities}} <form> <div class="form-group"> <h3>Choose the priority of each avaliable connection</h3> @@ -191,7 +189,6 @@ </div> <div class="modal-body"> - {{loaded_conn_mods}} <!--<input type="file" nv-file-select uploader="uploader"/><br/> <ul> <li ng-repeat="item in uploader.queue"> @@ -200,15 +197,24 @@ </li> </ul>--> <div class="row"> - <div class="col-xs-2"> - <label for="port">Port used</label> - <input type="number" id="port" min="0" ng-model="port"> + <div class="col-xs-3"> + <label for="public_key">Select a public key</label> + <select class="form-control input-sm" id="public_key" ng-model="public_key" ng-options="key as key for key in keys_list"></select> + </div> + </div> + <div class="row"> + <div class="col-xs-3"> + <form action="/upload" method="post" enctype="multipart/form-data"> + <label for="upload_key">Or upload a new public key:</label> + <input type="file" id="upload_key" name="upload" /> + <input type="submit" value="Start upload" /> + </form> </div> </div> <div class="row"> <div class="col-xs-2"> - <label for="public_key">Select a public key</label> - <select class="form-control input-sm" id="public_key" ng-model="public_key" ng-options="key as key for key in keys_list"></select> + <label for="port">Port used</label> + <input type="number" id="port" min="0" ng-model="port"> </div> </div> <div class="row"> @@ -232,8 +238,6 @@ <h3 class="modal-title">Activate/Deactivate monitoring blocks</h3> </div> <div class="modal-body"> - {{loaded_moni_mod}} - {{blocks}} <table class="table table-bordered table-hover"> <tr ng-repeat-start="(blockname, block) in blocks"> <th>{{blockname}}</th> -- 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 5584898917ab96affb139eef4203733899dc5e0e Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:12:47 2015 +0100 upload minimaliste possible pour les clés --- app/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.py b/app/app.py index eda7db5..2bfb16b 100755 --- a/app/app.py +++ b/app/app.py @@ -180,6 +180,6 @@ if __name__ == '__main__': ml.load_all_connection_modules() ml.load_all_detection_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 -- 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 e9423c98b877b1e280961c83599dd53e6f60ca9a Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 12 17:28:33 2015 +0100 qqes corrections dans hostpage --- app/module_loader.py | 2 ++ views/groups.html | 1 - views/hostpage.html | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 7b8d136..f4db97f 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -85,6 +85,8 @@ class ModuleLoader: conn['args'], self.public_keys_loc, modules.CommandNotFoundException) + else: + print "Error: no connection have been configured yet" return mod_inst def load_all_detection_modules(self): diff --git a/views/groups.html b/views/groups.html index fe9eca1..153b3ff 100644 --- a/views/groups.html +++ b/views/groups.html @@ -1,7 +1,6 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Group manager</h1> - <button type="button" class="btn btn-primary" ng-click="toto()">ngf.</button> <div class="row"> <div class="col-xs-3"> <label for="grpoption">Your existing groups</label> diff --git a/views/hostpage.html b/views/hostpage.html index c7c53f3..a90d2b0 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -84,10 +84,10 @@ <label for="freq">Frequency check (d:hh:mm)</label> <input type="text" class="form-control" id="freq" ng-model="freq"> <div ng-show="items.unit == '%'"> - <label for="minor_%">Minor notification at {{minor_limit}}% of charge</label> + <label for="minor_%">Minor notification at {{minor_limit_percent}}% of charge</label> <input type="range" min="0" max="99" id="minor_%" ng-model="minor_limit_percent"> - <label for="major_%">Major notification at {{major_limit}}% of charge</label> - <input type="range" min="{{minor_limit}}" max="100" id="major_%" ng-model="major_limit_percent"> + <label for="major_%">Major notification at {{major_limit_percent}}% of charge</label> + <input type="range" min="{{minor_limit_percent}}" max="100" id="major_%" ng-model="major_limit_percent"> </div> <div ng-show="items.unit == 'bool'"> <label for="minor_bool">If down, send a </label> @@ -105,9 +105,9 @@ </div> </div> <div ng-show="items.unit != '%' && items.unit != 'bool'"> - <label for="minor_unit">Minor notif at {{items.unit}}</label> + <label for="minor_unit">Minor notif at {{minor_limit_unit}}</label> <input type="number" class="form-control" id="minor_unit" min="0" ng-model="minor_limit_unit"> - <label for="maj_pack">Major notif at {{items.unit}}</label> + <label for="maj_pack">Major notif at {{major_limit_unit}}</label> <input type="number" class="form-control" id="maj_pack" min="0" ng-model="major_limit_unit"> </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm