Update webssh.js
This commit is contained in:
parent
b243b0e76b
commit
bacffd96a5
|
|
@ -4,29 +4,18 @@ function web_shell2() {
|
|||
var sendTotal = 0;
|
||||
if(!socket)socket = io.connect();
|
||||
var term = new Terminal({ cols: termCols, rows: termRows, screenKeys: true, useStyle: true});
|
||||
console.log(term);
|
||||
// term.fit()
|
||||
|
||||
term.open();
|
||||
gterm = term
|
||||
term.setOption('cursorBlink', true);
|
||||
term.setOption('fontSize', 10);
|
||||
gterm = term
|
||||
|
||||
var req_str = ''
|
||||
socket.on('server_response', function (data) {
|
||||
term.write(data.data);
|
||||
|
||||
console.log('server_response_data',data.data);
|
||||
console.log('编码:'+data.data.charCodeAt(0));
|
||||
req_str += data.data;
|
||||
if (data.data.charCodeAt(0) == 13){
|
||||
console.log('按了回车键!');
|
||||
req_str = '';
|
||||
}
|
||||
console.log(req_str);
|
||||
|
||||
if (req_str == '\r\n登出\r\n' || req_str == '登出\r\n' || req_str == '\r\nlogout\r\n' || req_str == 'logout\r\n') {
|
||||
setTimeout(function () {
|
||||
layer.closeAll();
|
||||
term.destroy();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue