branch develop updated (7aabc10 -> 86ac6c3)
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 7aabc10 ssh utilise clée privée + formulaire contient champ mot de passe new b08765a actualisation naive du hostpage après nouveau check new 86ac6c3 reload de hostpage après changement + suppr warning au lancement de l'appli The 2 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 86ac6c3eeed2f08162565d74635ac91241769608 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 13 11:04:15 2015 +0100 reload de hostpage après changement + suppr warning au lancement de l'appli commit b08765a6494538008ccc2d52a77767d8c2756001 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 13 10:08:54 2015 +0100 actualisation naive du hostpage après nouveau check Summary of changes: app/app.py | 5 +---- app/modules/connection_modules/ssh.py | 1 - static/js/controllers/hostPageCtrl.js | 41 ++++++++++++++++++++++------------- views/hostpage.html | 3 ++- 4 files changed, 29 insertions(+), 21 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 b08765a6494538008ccc2d52a77767d8c2756001 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 13 10:08:54 2015 +0100 actualisation naive du hostpage après nouveau check --- app/app.py | 2 +- static/js/controllers/hostPageCtrl.js | 39 ++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 15 deletions(-) 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 diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 0859b17..e7a55e7 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -1,5 +1,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $routeParams, $modal) { + $scope.loaded = false; // indicates if this is the first loading of the page + $scope.addr_host = $routeParams.param // asks for host informations @@ -56,20 +58,21 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $routeParams, $mo // receiving the host informations $scope.$on("hostInfos", function (event, args) { $scope.$apply(function(){ - $scope.items = args; - $scope.model.custom_infos = args.custom_infos; + if(!$scope.loaded){ // we take all the fields of information + $scope.items = args; + $scope.model.custom_infos = args.custom_infos; + $scope.loaded = true; + } + else{ // we takes only monitoring updates + $scope.items.monitoring = args.monitoring; + } }); }); - /* // monitoring data are updated + // monitoring data are updated $scope.$on("hostsUpdate", function (event, args) { - $scope.$apply(function(){ - for(i=0 ; i<args.length()) ; i++){ - if(args[i][]) - $scope.items['monitoring'] = args['monitoring']; - } - }); - });*/ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_HOST_INFO": $scope.addr_host})); + }); // save custom informations $scope.save_custom_infos = function(){ @@ -139,7 +142,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $routeParams, $mo // modals controllers -mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, conf_args) { +mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, $location, conf_args) { $scope.conf_args = conf_args; // {'addr_host' : val, 'mod_name', val} $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_conf_mod', 'args': conf_args}})); @@ -205,6 +208,8 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'set_conf_mod', 'args': args}})); $modalInstance.close(); + + $location.path('#hostpage/' + $scope.conf_args['addr_host']); }; $scope.cancel = function () { @@ -212,7 +217,7 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI }; }); -mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $modalInstance, $filter, interv_args) { +mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $modalInstance, $filter, $location, interv_args) { $scope.interv_args = interv_args; // {'addr_host' : val} $scope.user = ''; @@ -229,6 +234,8 @@ mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $moda $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'add_intervention', 'args': args}})); $modalInstance.close(); + + $location.path('#hostpage/' + $scope.interv_args['addr_host']); }; $scope.cancel = function () { @@ -236,7 +243,7 @@ mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $moda }; }); -mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, conn_args) { +mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, $location, conn_args) { $scope.conn_args = conn_args; // {'addr_host' : val} $scope.current_config = {}; @@ -273,6 +280,8 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'set_prio_conn','args': args}})); $modalInstance.close(); + + $location.path('#hostpage/' + $scope.conn_args['addr_host']); }; $scope.cancel = function () { @@ -375,7 +384,7 @@ mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $mo }; }); -mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, block_args) { +mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, $location, block_args) { $scope.block_args = block_args; /* {'addr_host': val, 'activated_mod':{ mod_name: bool @@ -452,6 +461,8 @@ mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modal $rootScope.$broadcast("sendViaWs", JSON.stringify({"SET_MOD_ACTIVATION": args})); $modalInstance.close(); + + $location.path('#hostpage/' + $scope.block_args['addr_host']); }; $scope.cancel = function () { -- 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 86ac6c3eeed2f08162565d74635ac91241769608 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 13 11:04:15 2015 +0100 reload de hostpage après changement + suppr warning au lancement de l'appli --- app/app.py | 3 --- app/modules/connection_modules/ssh.py | 1 - static/js/controllers/hostPageCtrl.js | 18 +++++++++--------- views/hostpage.html | 3 ++- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/app.py b/app/app.py index 2bfb16b..36c9804 100755 --- a/app/app.py +++ b/app/app.py @@ -12,9 +12,6 @@ from module_loader import ModuleLoader import process_monitoring from modules.notification_modules.websocket_container import WebSocketContainer -wsc = None -ml = None - # Pour lancer la detection nmap avec un nouveau thread class ThreadDetect(threading.Thread): def __init__(self, param, opt, ml, ws): diff --git a/app/modules/connection_modules/ssh.py b/app/modules/connection_modules/ssh.py index 9ae2530..f58dfcc 100644 --- a/app/modules/connection_modules/ssh.py +++ b/app/modules/connection_modules/ssh.py @@ -7,7 +7,6 @@ def get_class_name(): class SSH: def __init__(self, addr_host, params, key_loc, cnfe): - print params self.parameters = {"username": "string", "password": "string", "private_key": "file", "port": "int"} self.name = get_class_name() self.addr_host = addr_host diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index e7a55e7..506d35c 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -142,7 +142,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $routeParams, $mo // modals controllers -mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, $location, conf_args) { +mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, conf_args) { $scope.conf_args = conf_args; // {'addr_host' : val, 'mod_name', val} $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_conf_mod', 'args': conf_args}})); @@ -209,7 +209,7 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI $modalInstance.close(); - $location.path('#hostpage/' + $scope.conf_args['addr_host']); + $route.reload(); }; $scope.cancel = function () { @@ -217,11 +217,11 @@ mumApp.controller('ModalConfInstanceCtrl', function ($scope, $rootScope, $modalI }; }); -mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $modalInstance, $filter, $location, interv_args) { +mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $modalInstance, $filter, $route, interv_args) { $scope.interv_args = interv_args; // {'addr_host' : val} $scope.user = ''; - $scope.date = $filter('date')(new Date(), 'yyyy-MM-dd hh:mm'); + $scope.date = $filter('date')(new Date(), 'yyyy-MM-dd HH:mm'); $scope.details = ''; $scope.ok = function () { @@ -235,7 +235,7 @@ mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $moda $modalInstance.close(); - $location.path('#hostpage/' + $scope.interv_args['addr_host']); + $route.reload(); }; $scope.cancel = function () { @@ -243,7 +243,7 @@ mumApp.controller('ModalIntervInstanceCtrl', function ($scope, $rootScope, $moda }; }); -mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, $location, conn_args) { +mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalInstance, $modal, $route, conn_args) { $scope.conn_args = conn_args; // {'addr_host' : val} $scope.current_config = {}; @@ -281,7 +281,7 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI $modalInstance.close(); - $location.path('#hostpage/' + $scope.conn_args['addr_host']); + $route.reload(); }; $scope.cancel = function () { @@ -384,7 +384,7 @@ mumApp.controller('ModalConfConnInstanceCtrl', function ($scope, $rootScope, $mo }; }); -mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, $location, block_args) { +mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, block_args) { $scope.block_args = block_args; /* {'addr_host': val, 'activated_mod':{ mod_name: bool @@ -462,7 +462,7 @@ mumApp.controller('ModalBlockInstanceCtrl', function ($scope, $rootScope, $modal $modalInstance.close(); - $location.path('#hostpage/' + $scope.block_args['addr_host']); + $route.reload(); }; $scope.cancel = function () { diff --git a/views/hostpage.html b/views/hostpage.html index e6a730f..31f2734 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -62,7 +62,8 @@ </tr> </thead> <tbody> - <tr ng-repeat="interv in items.interventions"> + <tr ng-repeat="interv in items.interventions | + orderBy:'-date'"> <td>{{interv.date}}</td> <td>{{interv.username}}</td> <td>{{interv.details}}</td> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm