Merge branch 'bug' into dev

pull/26/head
ibuler 9 years ago
commit 72b8ac2a50

@ -437,6 +437,7 @@ class SshTty(Tty):
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_tty)
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()

@ -43,14 +43,16 @@ def scriptToJSON(scriptf, timing=None):
scriptf.readline() # ignore first header line from script file
offset = 0
for t in timing:
data = escapeString(scriptf.read(t[1]))
dt = scriptf.read(t[1])
data = escapeString(dt)
offset += t[0]
ret.append((data, offset))
return dumps(ret)
def renderTemplate(script_path, time_file_path, dimensions=(24, 80), templatename=DEFAULT_TEMPLATE):
with copen(script_path, encoding='utf-8', errors='replace') as scriptf:
#with copen(script_path, encoding='utf-8', errors='replace') as scriptf:
with open(script_path) as scriptf:
with open(time_file_path) as timef:
timing = getTiming(timef)
json = scriptToJSON(scriptf, timing)

@ -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
try:
t.setDaemon(True)
t.start()
except RuntimeError:
pass
def on_message(self, message):
data = json.loads(message)
@ -309,6 +312,7 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
self.log.is_finished = True
self.log.end_time = datetime.datetime.now()
self.log.save()
self.log_time_f.close()
self.close()
except AttributeError:
pass

@ -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…
Cancel
Save