pull/167/head
liuzheng712 2016-03-24 17:17:47 +08:00
parent 357aea1693
commit ba5e90abc3
3 changed files with 16 additions and 10 deletions

View File

@ -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

View File

@ -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)
@ -481,6 +486,7 @@ def main():
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
# tornado.options.parse_command_line()
# app = Application()

View File

@ -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();
//}
});