Commit 210b3c85 authored by liuzheng712's avatar liuzheng712

test

parent bdf6d974
......@@ -384,9 +384,6 @@ class SshTty(Tty):
if self.channel in r:
try:
x = self.channel.recv(10240)
print x
print '===='
print len(x)
if len(x) == 0:
break
if self.vim_flag:
......
......@@ -412,7 +412,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if self.term.vim_flag:
self.term.vim_data += recv
try:
self.write_message(json.dumps({'data': data}))
self.write_message(data)
now_timestamp = time.time()
self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data)))
self.log_file_f.write(data)
......
......@@ -85,7 +85,11 @@ function openTerminal(options) {
term.write('Connection Reset By Peer');
};
sock.onmessage= function (data) {
term.write(JSON.parse(data.data)['data']);
try {
term.write(data)
} catch (e) {
term.write(JSON.parse(data.data)['data'])
}
};
sock.onerror= function () {
term.write('Connection Reset By Peer');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment