mirror of https://github.com/jumpserver/jumpserver
update
parent
357aea1693
commit
ba5e90abc3
|
@ -183,7 +183,7 @@ class TermLogRecorder(object):
|
|||
self.user = None
|
||||
self.recoderStartTime = time.time()
|
||||
self.__init_screen_stream()
|
||||
self.recoder = True
|
||||
self.recoder = False
|
||||
self.commands = []
|
||||
self._lists = None
|
||||
self.file = None
|
||||
|
|
|
@ -35,10 +35,12 @@ except ImportError:
|
|||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
|
||||
from jumpserver.settings import IP, PORT
|
||||
|
||||
define("port", default=PORT, help="run on the given port", type=int)
|
||||
define("host", default=IP, help="run port on given host", type=str)
|
||||
from jlog.views import TermLogRecorder
|
||||
|
||||
|
||||
def django_request_support(func):
|
||||
@functools.wraps(func)
|
||||
def _deco(*args, **kwargs):
|
||||
|
@ -46,6 +48,7 @@ def django_request_support(func):
|
|||
response = func(*args, **kwargs)
|
||||
request_finished.send_robust(func)
|
||||
return response
|
||||
|
||||
return _deco
|
||||
|
||||
|
||||
|
@ -83,6 +86,7 @@ def require_auth(role='user'):
|
|||
logger.warning('Websocket: Request auth failed.')
|
||||
|
||||
return _deco2
|
||||
|
||||
return _deco
|
||||
|
||||
|
||||
|
@ -340,6 +344,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
|||
self.term.remote_ip = self.request.remote_ip
|
||||
self.ssh = self.term.get_connection()
|
||||
self.channel = self.ssh.invoke_shell(term='xterm')
|
||||
self.channel.resize_pty(80, 24)
|
||||
WebTerminalHandler.tasks.append(MyThread(target=self.forward_outbound))
|
||||
WebTerminalHandler.clients.append(self)
|
||||
|
||||
|
@ -421,7 +426,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
|||
self.termlog.write(data)
|
||||
self.termlog.recoder = False
|
||||
now_timestamp = time.time()
|
||||
self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data)))
|
||||
self.log_time_f.write('%s %s\n' % (round(now_timestamp - pre_timestamp, 4), len(data)))
|
||||
self.log_file_f.write(data)
|
||||
pre_timestamp = now_timestamp
|
||||
self.log_file_f.flush()
|
||||
|
@ -481,6 +486,7 @@ def main():
|
|||
|
||||
tornado.ioloop.IOLoop.instance().start()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# tornado.options.parse_command_line()
|
||||
# app = Application()
|
||||
|
|
|
@ -104,13 +104,13 @@ $(document).ready(function () {
|
|||
$('#ssh').show();
|
||||
var term_client = openTerminal(options);
|
||||
console.log(rowHeight);
|
||||
|
||||
window.onresize = function () {
|
||||
var geom = resize();
|
||||
console.log(geom);
|
||||
term_client.term.resize(geom.cols, geom.rows);
|
||||
term_client.client.send({'resize': {'rows': geom.rows, 'cols': geom.cols}});
|
||||
$('#ssh').show();
|
||||
}
|
||||
// by liuzheng712 because it will bring record bug
|
||||
//window.onresize = function () {
|
||||
// var geom = resize();
|
||||
// console.log(geom);
|
||||
// term_client.term.resize(geom.cols, geom.rows);
|
||||
// term_client.client.send({'resize': {'rows': geom.rows, 'cols': geom.cols}});
|
||||
// $('#ssh').show();
|
||||
//}
|
||||
|
||||
});
|
Loading…
Reference in New Issue