pull/109/head
Mr Chen 6 years ago
parent ac07a9e840
commit 5f91fba942
  1. 13
      plugins/webssh/js/webssh.js
  2. 6
      route/__init__.py

@ -108,15 +108,9 @@ function web_shell2() {
var menudiv = '<ul class="contextmenu">\
<li>\
<a class="shell_copy_btn menu_ssh" data-clipboard-text="'+ selectText + '" ' + style_str + '>复制到剪切板</a>\
</li>\
<li>\
<a onclick="shell_paste_text()" '+ paste_str+'>粘贴选中项</a>\
</li>\
<li>\
<a onclick="shell_to_baidu()" ' + style_str + '>百度搜索</a>\
</li>\
<li><a class="shell_copy_btn menu_ssh" data-clipboard-text="'+ selectText + '" ' + style_str + '>复制到剪切板</a></li>\
<li><a onclick="shell_paste_text()" '+ paste_str+'>粘贴选中项</a></li>\
<li><a onclick="shell_to_baidu()" ' + style_str + '>百度搜索</a></li>\
</ul>';
$("body").append(menudiv);
$(".contextmenu").css({
@ -175,7 +169,6 @@ function shell_to_baidu() {
gterm.focus();
}
function shell_paste_text(){
socket.emit('webssh', getCookie('ssh_selection'));
remove_ssh_menu();

@ -222,7 +222,6 @@ def create_rsa():
def connect_ssh():
print 'connect_ssh_init'
global shell, ssh
if not os.path.exists('/root/.ssh/authorized_keys') or not os.path.exists('/root/.ssh/id_rsa') or not os.path.exists('/root/.ssh/id_rsa.pub'):
create_rsa()
@ -231,7 +230,6 @@ def connect_ssh():
try:
ssh.connect('127.0.0.1', public.getSSHPort())
except Exception as e:
print 'connect_ssh error:', str(e)
if public.getSSHStatus():
try:
ssh.connect('localhost', public.getSSHPort())
@ -275,7 +273,7 @@ def webssh(msg):
recv = shell.recv(4096)
emit('server_response', {'data': recv.decode("utf-8")})
except Exception as ex:
print str(ex)
print 'webssh:' + str(ex)
@socketio.on('connect_event')
@ -289,7 +287,7 @@ def connected_msg(msg):
print recv.decode("utf-8")
emit('server_response', {'data': recv.decode("utf-8")})
except Exception as e:
print 'connect_event:' + str(e)
print 'connected_msg:' + str(e)
@socketio.on('panel')

Loading…
Cancel
Save