mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
Support resize web terminal size
Support resize web terminal size. Change new windows to a new tab. May be more hommization
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -173,8 +173,14 @@
|
||||
$('.terminal').detach().appendTo('#term');
|
||||
$('.terminal').show();
|
||||
socket.onmessage = function(evt){
|
||||
term.write(evt.data);
|
||||
}}, 1000);
|
||||
try {
|
||||
var findResize = JSON.parse(evt.data)['data'];
|
||||
term.resize(findResize['resize']['cols'], findResize['resize']['rows'])
|
||||
} catch (err) {
|
||||
term.write(evt.data);
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
return tag[0];
|
||||
} ,
|
||||
|
||||
@@ -1,43 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jumpserver Web Terminal: {{ hostname }}</title>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ hostname }}</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
<style>
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.terminal {
|
||||
border: #000 solid 5px;
|
||||
font-family: "Monaco", "Microsoft Yahei", "DejaVu Sans Mono", "Liberation Mono", monospace;
|
||||
font-size: 11px;
|
||||
color: #f0f0f0;
|
||||
background: #000;
|
||||
width: 600px;
|
||||
box-shadow: rgba(0, 0, 0, 0.8) 2px 2px 20px;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
.terminal {
|
||||
border: #000 solid 5px;
|
||||
font-family: "Monaco", "Microsoft Yahei", "DejaVu Sans Mono", "Liberation Mono", monospace;
|
||||
font-size: 11px;
|
||||
color: #f0f0f0;
|
||||
background: #000;
|
||||
box-shadow: rgba(0, 0, 0, 0.8) 2px 2px 20px;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.reverse-video {
|
||||
color: #000;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
.reverse-video {
|
||||
color: #000;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div id="term">
|
||||
</div>
|
||||
</div>
|
||||
.termChangBar {
|
||||
line-height: 1;
|
||||
margin: 0 auto;
|
||||
border: 1px solid #ffffff;
|
||||
color: #fff;
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<script type="application/javascript" src="/static/js/jquery-2.1.1.js">
|
||||
</script>
|
||||
<script type="application/javascript" src="/static/js/term.js">
|
||||
</script>
|
||||
<script type="application/javascript" src="/static/js/webterminal.js"></script>
|
||||
</body>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div id="term">
|
||||
</div>
|
||||
</div>
|
||||
<div class="termChangBar">
|
||||
<input type="number" min="100" value="100" placeholder="col" id="term-col"/>
|
||||
<input type="number" min="35" value="35" placeholder="row" id="term-row"/>
|
||||
<button id="col-row">修改窗口大小</button>
|
||||
</div>
|
||||
<script type="application/javascript" src="/static/js/jquery-2.1.1.js"></script>
|
||||
<script type="application/javascript" src="/static/js/term.js"></script>
|
||||
<script type="application/javascript" src="/static/js/webterminal.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user