mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
fix resize event error when websocket closed (#1970)
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('resize', function () {
|
||||
var terminalSize = getTerminalSize();
|
||||
ws.send(JSON.stringify({ action: 'resize', cols: terminalSize.cols, rows: terminalSize.rows }));
|
||||
xterm.resize(terminalSize.cols, terminalSize.rows);
|
||||
if(ws !== undefined && ws !== null){
|
||||
let terminalSize = getTerminalSize();
|
||||
ws.send(JSON.stringify({ action: 'resize', cols: terminalSize.cols, rows: terminalSize.rows }));
|
||||
xterm.resize(terminalSize.cols, terminalSize.rows);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,9 +18,11 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('resize', function () {
|
||||
var terminalSize = getTerminalSize();
|
||||
ws.send(JSON.stringify({ action: 'resize', cols: terminalSize.cols, rows: terminalSize.rows }));
|
||||
xterm.resize(terminalSize.cols, terminalSize.rows);
|
||||
if(ws !== undefined && ws !== null){
|
||||
let terminalSize = getTerminalSize();
|
||||
ws.send(JSON.stringify({ action: 'resize', cols: terminalSize.cols, rows: terminalSize.rows }));
|
||||
xterm.resize(terminalSize.cols, terminalSize.rows);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user