mirror of https://github.com/jumpserver/jumpserver
bugfix(upload web) When download file, static file will unreachable. (#206)
* Update install.py 修改centos7支持 * Update install.py * Support resize web terminal size Support resize web terminal size. Change new windows to a new tab. May be more hommization * Static bug (#204) * 紧急修复下载文件后静态文件404问题 * 紧急修复监控白屏问题 * bugfix(upload web) When download file, static file will unreachable. Didn't change dir fixedpull/207/head
parent
9be13cf08f
commit
cb58012a82
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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();
|
||||
})
|
||||
});
|
|
@ -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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jumpserver Web Terminal: {{ hostname }}</title>
|
||||
<title>{{ hostname }}</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
|
|
Loading…
Reference in New Issue