diff --git a/install/install.py b/install/install.py index e721a3991..9bdfe976b 100755 --- a/install/install.py +++ b/install/install.py @@ -85,12 +85,12 @@ class PreSetup(object): @property def _is_redhat(self): - if self.dist == "centos" or self.dist == "redhat" or self.dist == "fedora" or self.dist == "amazon linux ami": + if self.dist.startswith("centos") or self.dist.startswith("red") or self.dist == "fedora" or self.dist == "amazon linux ami": return True @property def _is_centos7(self): - if self.dist == "centos" and self.version.startswith("7"): + if self.dist.startswith("centos") and self.version.startswith("7"): return True @property diff --git a/jumpserver/views.py b/jumpserver/views.py index 70476d1a1..fae546a28 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -326,11 +326,10 @@ def download(request): FileLog(user=request.user.username, host=' '.join([asset.hostname for asset in asset_select]), filename=file_path, type='download', remote_ip=remote_ip, result=runner.results).save() logger.debug(runner.results) - os.chdir('/tmp') tmp_dir_name = os.path.basename(upload_dir) - tar_file = '%s.tar.gz' % upload_dir - bash('tar czf %s %s' % (tar_file, tmp_dir_name)) - f = open(tar_file) + 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) data = f.read() f.close() response = HttpResponse(data, content_type='application/octet-stream') diff --git a/static/js/webterminal.js b/static/js/webterminal.js index d21500499..b8fb72d15 100644 --- a/static/js/webterminal.js +++ b/static/js/webterminal.js @@ -1,4 +1,3 @@ - /** * Created by liuzheng on 3/3/16. */ @@ -63,8 +62,14 @@ function openTerminal(options) { rowHeight = 35; colWidth = 100 } - if(rowHeight){}else{rowHeight=35}; - if(colWidth){}else{colWidth=100}; + if (rowHeight) { + } else { + rowHeight = 35 + } + if (colWidth) { + } else { + colWidth = 100 + } var term = new Terminal({ rows: rowHeight, @@ -139,6 +144,11 @@ $(document).ready(function () { term_client.term.resize(col, row); term_client.client.send({'resize': {'rows': row, 'cols': col}}); $('#ssh').show(); + }); + $(".terminal").mouseleave(function () { + $(".termChangBar").slideDown(); + }); + $(".terminal").mouseenter(function () { + $(".termChangBar").slideUp(); }) - }); \ No newline at end of file diff --git a/templates/jasset/asset_list.html b/templates/jasset/asset_list.html index 1c063d8d9..898703237 100644 --- a/templates/jasset/asset_list.html +++ b/templates/jasset/asset_list.html @@ -245,7 +245,7 @@ }); window.open(new_url+data, '_blank', 'toolbar=yes, location=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=628, height=400') */ - window.open(new_url+data, '', 'width=628px, height=380px'); + window.open(new_url+data, "_blank"); } else if (dataArray.length == 1 && data != 'error'){ /*layer.open({ type: 2, @@ -256,8 +256,7 @@ content: new_url+data }); */ - window.open(new_url+data, '_blank', 'toolbar=yes, location=yes, copyhistory=yes, scrollbars=yes, width=628, height=410'); - + window.open(new_url+data, '_blank'); } else { aUrl = ''; @@ -293,7 +292,7 @@ content: new_url }); */ - window.open(new_url, '_blank', 'toolbar=yes, location=yes, copyhistory=yes, scrollbars=yes, width=628, height=380') + window.open(new_url, '_blank') } else { /* @@ -306,7 +305,7 @@ content: new_url }); */ - window.open(new_url, '_blank', 'toolbar=yes, location=yes, copyhistory=yes, scrollbars=yes, width=628, height=410'); + window.open(new_url, '_blank'); } return false diff --git a/templates/jlog/web_terminal.html b/templates/jlog/web_terminal.html index 44a58ba50..9b088d57c 100644 --- a/templates/jlog/web_terminal.html +++ b/templates/jlog/web_terminal.html @@ -2,7 +2,7 @@
-