From 5afd135967ee39b5350f707302ef00daf9cd6401 Mon Sep 17 00:00:00 2001 From: kelianchun Date: Fri, 22 Apr 2016 11:49:50 +0800 Subject: [PATCH 2/4] fix bug index out of range (#210) --- jlog/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jlog/views.py b/jlog/views.py index ff1239e8e..d8a4268d1 100644 --- a/jlog/views.py +++ b/jlog/views.py @@ -240,6 +240,7 @@ class TermLogRecorder(object): TermLogRecorder.loglist[str(id)] = [self] def write(self, msg): + """ if self.recoder and (not self._in_vim): if self.commands.__len__() == 0: self._stream.feed(msg) @@ -256,6 +257,7 @@ class TermLogRecorder(object): self._screen.reset() else: self._command() + """ try: self.write_message(msg) except: From 6ce948366d9c915efac890e44d249361fdb2f2b3 Mon Sep 17 00:00:00 2001 From: huangguozhen Date: Sat, 23 Apr 2016 10:35:28 +0800 Subject: [PATCH 3/4] Update base.html (#213) fix(frontend): use webkit default in multi kernel browsers --- templates/base.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/base.html b/templates/base.html index 7b163003d..8d9c2a706 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,6 +4,7 @@ + Jumpserver | 开源跳板机系统 From c6404f7ed69951d7380a2f2a7a48367d3b1fe604 Mon Sep 17 00:00:00 2001 From: liuzheng Date: Sun, 24 Apr 2016 20:42:02 +0800 Subject: [PATCH 4/4] Static bug (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 紧急修复下载文件后静态文件404问题 * 紧急修复监控白屏问题 * 紧急修复下载文件后静态文件404问题 * 紧急修复下载文件后静态文件404问题 * 修复zip包为空问题 --- jumpserver/views.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jumpserver/views.py b/jumpserver/views.py index fae546a28..473dc8c58 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -19,6 +19,7 @@ from jlog.models import Log, FileLog from jperm.perm_api import get_group_user_perm, gen_resource from jasset.models import Asset, IDC from jperm.ansible_api import MyRunner +import zipfile def getDaysByNum(num): @@ -327,13 +328,18 @@ def download(request): filename=file_path, type='download', remote_ip=remote_ip, result=runner.results).save() logger.debug(runner.results) tmp_dir_name = os.path.basename(upload_dir) - tar_file = '%s.tar.gz' % tmp_dir_name - bash('cd /tmp && tar czf %s %s' % (tar_file, tmp_dir_name)) - f = open('/tmp/%s' % tar_file) + file_zip = '/tmp/'+tmp_dir_name+'.zip' + zf = zipfile.ZipFile(file_zip, "w", zipfile.ZIP_DEFLATED) + for dirname, subdirs, files in os.walk(upload_dir): + zf.write(dirname) + for filename in files: + zf.write(os.path.join(dirname, filename)) + zf.close() + f = open(file_zip) data = f.read() f.close() response = HttpResponse(data, content_type='application/octet-stream') - response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(tar_file) + response['Content-Disposition'] = 'attachment; filename=%s.zip' % tmp_dir_name return response return render_to_response('download.html', locals(), context_instance=RequestContext(request))