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 61c296b19fc612d72ba25919739d857e3dcc94f2 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Mar 9 17:24:00 2015 +0100 hostpage : modal des priorités de connection => OK --- static/js/controllers/hostPageCtrl.js | 15 +++++++++ views/hostpage.html | 62 ++--------------------------------- 2 files changed, 17 insertions(+), 60 deletions(-) diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 0c915fd..b49ef66 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -197,12 +197,27 @@ mumApp.controller('ModalConnInstanceCtrl', function ($scope, $rootScope, $modalI $scope.current_config = {}; + $scope.priorities = {}; + + $scope.isNotConfigured = function(modname){ + res = false; + for(param in $scope.current_config[modname]){ + if($scope.current_config[modname][param] == null){ + res = true; + } + } + return res; + } + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_conn_param','args': {'addr_host': $scope.conn_args['addr_host']}}})); // when the configuration of the connection is received $scope.$on("resCall", function (event, args) { $scope.$apply(function(){ $scope.current_config = args; + for(mod in args){ + $scope.priorities[mod] = args[mod]['priority'] + } }); }); diff --git a/views/hostpage.html b/views/hostpage.html index 6a24b18..3e2c553 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -147,6 +147,7 @@ </div> <div class="modal-body"> {{current_config}} + {{priorities}} <form> <div class="form-group"> <h3>Choose the priority of each avaliable connection</h3> @@ -161,7 +162,7 @@ <tbody> <tr ng-repeat="(modname, modconf) in current_config"> <td>{{modname}}</td> - <td><input type="number" min="0" ng-model="prio_{{modname}}"></td> + <td><input type="number" min="0" ng-model="priorities[modname]" disabled="{{isNotConfigured(modname)}}"></td> <td> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_conf_conn">Advanced configuration</button> <button type="button" class="btn btn-success">Test</button> @@ -180,65 +181,6 @@ </script> <!-- - <div class="modal fade" id="modal_conn" tabindex="-1" role="dialog" aria-labelledby="modal_conn_label" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="modal_conn_label">Connection configuration</h4> - </div> - <div class="modal-body"> - <form> - <div class="form-group"> - <h3>Choose the priority of each avaliable connection</h3> - <table class="table table-bordered table-hover"> - <thead> - <tr> - <th>Protocol </th> - <th>Priority </th> - <th>Options </th> - </tr> - </thead> - <tbody> - <tr> - <td>SSH</td> - <td><input type="number" min="0" placeholder=1></td> - <td> - <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_conf_conn">Advanced configuration</button> - <button type="button" class="btn btn-success">Test</button> - </td> - - </tr> - <tr> - <td>SNMP</td> - <td><input type="number" min="0" placeholder=0 disabled></td> - <td> - <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_conf_conn">Advanced configuration</button> - <button type="button" class="btn btn-success">Test</button> - </td> - - </tr> - <tr> - <td>Nagios</td> - <td><input type="number" min="0" placeholder=0 disabled></td> - <td> - <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_conf_conn">Advanced configuration</button> - <button type="button" class="btn btn-success">Test</button> - </td> - </tr> - </tbody> - </table> - </div> - </form> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> - <button type="button" class="btn btn-primary">Save changes</button> - </div> - </div> - </div> - </div> - <div class="modal fade bs-example-modal-lg" id="modal_conf_conn" tabindex="-1" role="dialog" aria-labelledby="modal_conf_conn_label" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.