From 4672884255bf33352a0a0b53ad1e54331d9484e7 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 28 Nov 2015 22:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9role=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 2 +- templates/jperm/perm_role_add.html | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/connect.py b/connect.py index 1c7218dd8..9cfc7e063 100644 --- a/connect.py +++ b/connect.py @@ -602,7 +602,7 @@ class Nav(object): else: res = gen_resource({'user': self.user, 'asset': assets, 'role': role}, perm=self.user_perm) cmd = Command(res) - logger.debug("res: %s" % res) + logger.debug("批量执行res: %s" % res) asset_name_str = '' for inv in cmd.inventory.get_hosts(pattern=pattern): print inv.name diff --git a/templates/jperm/perm_role_add.html b/templates/jperm/perm_role_add.html index 78c33b38e..d62ab05b6 100644 --- a/templates/jperm/perm_role_add.html +++ b/templates/jperm/perm_role_add.html @@ -116,6 +116,21 @@ $('#roleForm').validator({ form.submit(); } }) + +var config = { + '.chosen-select' : {}, + '.chosen-select-deselect' : {allow_single_deselect:true}, + '.chosen-select-no-single' : {disable_search_threshold:10}, + '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'}, + '.chosen-select-width' : {width:"95%"} + }; + +for (var selector in config) { + $(selector).chosen(config[selector]); +} + + + {% endblock %}