mirror of https://github.com/jumpserver/jumpserver
fix some bug
parent
0335bc26ca
commit
2c0d42e0da
|
@ -204,6 +204,7 @@ class Tty(object):
|
|||
|
||||
log.save()
|
||||
log_file_f.write('Start at %s\n' % datetime.datetime.now())
|
||||
log_time_f.write('0.0000 ')
|
||||
return log_file_f, log_time_f, log
|
||||
|
||||
def get_connect_info(self):
|
||||
|
@ -325,7 +326,7 @@ class SshTty(Tty):
|
|||
sys.stdout.write(x)
|
||||
sys.stdout.flush()
|
||||
now_timestamp = time.time()
|
||||
log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(x)))
|
||||
log_time_f.write('%s\n%s ' % (len(x), round(now_timestamp-pre_timestamp, 4)))
|
||||
log_file_f.write(x)
|
||||
pre_timestamp = now_timestamp
|
||||
log_file_f.flush()
|
||||
|
@ -362,8 +363,10 @@ class SshTty(Tty):
|
|||
|
||||
finally:
|
||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_tty)
|
||||
log_time_f.write('0')
|
||||
log_file_f.write('End time is %s' % datetime.datetime.now())
|
||||
log_file_f.close()
|
||||
log_time_f.close()
|
||||
log.is_finished = True
|
||||
log.end_time = datetime.datetime.now()
|
||||
log.save()
|
||||
|
|
|
@ -13,7 +13,7 @@ password = mysql234
|
|||
database = jumpserver
|
||||
|
||||
[websocket]
|
||||
web_socket_host = js:3000
|
||||
web_socket_host = j:3000
|
||||
|
||||
[mail]
|
||||
mail_enable = 1
|
||||
|
|
|
@ -275,8 +275,11 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
|||
for t in WebTerminalHandler.tasks:
|
||||
if t.is_alive():
|
||||
continue
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
try:
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def on_message(self, message):
|
||||
data = json.loads(message)
|
||||
|
@ -309,6 +312,8 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
|||
self.log.is_finished = True
|
||||
self.log.end_time = datetime.datetime.now()
|
||||
self.log.save()
|
||||
self.log_time_f.write('0')
|
||||
self.log_time_f.close()
|
||||
self.close()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
@ -331,7 +336,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
|
|||
try:
|
||||
self.write_message(json.dumps({'data': data}))
|
||||
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\n%s ' % (len(data), round(now_timestamp-pre_timestamp, 4)))
|
||||
self.log_file_f.write(data)
|
||||
pre_timestamp = now_timestamp
|
||||
self.log_file_f.flush()
|
||||
|
|
|
@ -182,8 +182,15 @@
|
|||
success: function(data){
|
||||
var dataArray = data.split(',');
|
||||
if (dataArray.length == 1 && data != 'error'){
|
||||
console.log('one');
|
||||
window.open(new_url + data, '', 'height=400, width=600, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: 'Jumpserver Web Terminal',
|
||||
maxmin: true,
|
||||
shade: false,
|
||||
area: ['628px', '452px'],
|
||||
content: new_url
|
||||
});
|
||||
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
|
||||
} else if (dataArray.length == '1' && data == 'error'){
|
||||
layer.alert('没有授权角色')
|
||||
} else {
|
||||
|
@ -194,6 +201,7 @@
|
|||
layer.alert(aUrl, {
|
||||
skin: 'layui-layer-molv',
|
||||
title: '多个角色,请选择一个连接',
|
||||
shade: false,
|
||||
closeBtn: 0
|
||||
})
|
||||
}
|
||||
|
@ -205,7 +213,15 @@
|
|||
|
||||
function windowOpen(aTab){
|
||||
var new_url = aTab.href;
|
||||
window.open(new_url, '', 'height=400, width=600, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: 'Jumpserver Web Terminal',
|
||||
maxmin: true,
|
||||
area: ['628px', '452px'],
|
||||
shade: false,
|
||||
content: new_url
|
||||
});
|
||||
//window.open(new_url, '', 'height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -224,7 +240,6 @@
|
|||
border: [2, 0.3, '#1AB394'],
|
||||
shade: [0.5, '#000000'],
|
||||
shadeClose: true,
|
||||
area : ['800px' , '600px'],
|
||||
content: url,
|
||||
cancel: function(){
|
||||
location.replace(location.href);
|
||||
|
|
|
@ -163,38 +163,6 @@ $('#ruleForm').validator({
|
|||
});
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$("input.role").click(function(){
|
||||
if($("input.role[value=GA]").is( ":checked" )){
|
||||
$("#admin_groups").css("display", 'none');
|
||||
}
|
||||
else {
|
||||
|
||||
$("#admin_groups").css("display", 'block');
|
||||
}
|
||||
});
|
||||
|
||||
$('#use_password').click(function(){
|
||||
if ($(this).is(':checked')){
|
||||
$('#admin_account_password').css('display', 'block')
|
||||
}
|
||||
else {
|
||||
|
||||
$('#admin_account_password').css('display', 'none')
|
||||
}
|
||||
});
|
||||
|
||||
$('#use_publicKey').click(function(){
|
||||
if ($(this).is(':checked')){
|
||||
|
||||
$('#admin_account_publicKey').css('display', 'block')
|
||||
}
|
||||
else {
|
||||
$('#admin_account_publicKey').css('display', 'none')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var config = {
|
||||
'.chosen-select' : {},
|
||||
'.chosen-select-deselect' : {allow_single_deselect:true},
|
||||
|
|
Loading…
Reference in New Issue