From 60cb5561f09410e3f3576dc61182a1884dabd7cf Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 16 Apr 2015 14:32:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9move?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jumpserver.conf | 2 +- juser/views.py | 5 +++-- static/js/base.js | 29 ++++++++++++++++------------- templates/jperm/dept_perm_edit.html | 4 ++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/jumpserver.conf b/jumpserver.conf index 6eda751b8..6fb97b1f2 100644 --- a/jumpserver.conf +++ b/jumpserver.conf @@ -1,7 +1,7 @@ #coding: utf8 [base] -ip = 192.168.173.129 +ip = 192.168.20.209 port = 80 key = 88aaaf7ffe3c6c04 diff --git a/juser/views.py b/juser/views.py index fe083c208..c470013b1 100644 --- a/juser/views.py +++ b/juser/views.py @@ -725,9 +725,10 @@ def user_add_adm(request): 您的角色: %s 您的web登录密码: %s 您的ssh登录密码: %s - 密钥下载地址: %s + 密钥下载地址: http://%s:%s/juser/down_key/?id=%s 说明: 请登陆后再下载密钥! - """ % (name, username, dept.name, '普通用户', password, ssh_key_pwd, ssh_key_pwd) + """ % (name, username, dept.name, '普通用户', + password, ssh_key_pwd, SEND_IP, SEND_PORT, user.id) print MAIL_FROM send_mail(mail_title, mail_msg, MAIL_FROM, [email], fail_silently=False) msg = u'添加用户 %s 成功! 用户密码已发送到 %s 邮箱!' % (username, email) diff --git a/static/js/base.js b/static/js/base.js index 4b0adfe76..6a88472bc 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -59,10 +59,13 @@ function GetTableDataBox() { return returnData; } -function move(from, to) { +function move(from, to, from_o, to_o) { $("#" + from + " option").each(function () { if ($(this).prop("selected") == true) { $("#" + to).append(this); + if( typeof from_o !== 'undefined'){ + $("#"+to_o).append($("#"+from_o +" option[value='"+this.value+"']")); + } } }); } @@ -76,12 +79,12 @@ function move_left(from, to) { }); } -function move_all(from, to) { - $("#" + from).children().each(function () { - $("#" + to).append(this); - }); -} - +//function move_all(from, to) { +// $("#" + from).children().each(function () { +// $("#" + to).append(this); +// }); +//} +// function selectAll(){ var checklist = document.getElementsByName ("selected"); @@ -100,12 +103,12 @@ function selectAll(){ } - -function move_all(from, to){ - $("#"+from).children().each(function(){ - $("#"+to).append(this); - }); -} +// +//function move_all(from, to){ +// $("#"+from).children().each(function(){ +// $("#"+to).append(this); +// }); +//} //function commit_select(form_array){ // $('#{0} option'.format(form_array)).each(function(){ diff --git a/templates/jperm/dept_perm_edit.html b/templates/jperm/dept_perm_edit.html index 889a991f0..7d9c8247f 100644 --- a/templates/jperm/dept_perm_edit.html +++ b/templates/jperm/dept_perm_edit.html @@ -101,8 +101,8 @@ function search_ip(text, noselect, total){
- - + +