From 2f5cf429ed17f90925b5ef446f845d7b911faa1b Mon Sep 17 00:00:00 2001 From: IYism Date: Fri, 25 Sep 2015 16:30:15 +0800 Subject: [PATCH 1/2] bugfix ip_list bugfix ip_list --- connect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect.py b/connect.py index 3fa72c719..e5d372bf0 100644 --- a/connect.py +++ b/connect.py @@ -91,7 +91,7 @@ def log_record(username, host): dept_name = User.objects.get(username=username).dept.name pid = os.getpid() pts = os.popen("ps axu | awk '$2==%s{ print $7 }'" % pid).read().strip() - ip_list = os.popen("who | awk '$2==%s{ print $5 }'" % pts).read().strip('()\n') + ip_list = os.popen("who | awk '$2==\"%s\"{ print $5 }'" % pts).read().strip('()\n') if not os.path.isdir(today_connect_log_dir): try: From 667862223c8a816d9810e91f0d9d78c6f4b60bff Mon Sep 17 00:00:00 2001 From: IYism Date: Fri, 25 Sep 2015 16:33:11 +0800 Subject: [PATCH 2/2] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复chrome浏览器有时候不能阻断的bug --- templates/jlog/log_online.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/jlog/log_online.html b/templates/jlog/log_online.html index 7e2858e57..1af12a9aa 100644 --- a/templates/jlog/log_online.html +++ b/templates/jlog/log_online.html @@ -223,10 +223,12 @@ $.ajax({ type: "GET", url: g_url, - success: window.open("/jlog/log_list/online/", "_self") + success: function(){ + document.location.reload(); + } // error: window.open(g_url, "_self") }); } -{% endblock %} \ No newline at end of file +{% endblock %}