|
|
|
@ -249,6 +249,7 @@ done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def connect_ssh(): |
|
|
|
|
print 'connect_ssh ....' |
|
|
|
|
clear_ssh() |
|
|
|
|
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'): |
|
|
|
@ -319,19 +320,19 @@ def connected_msg(msg): |
|
|
|
|
# print 'connected_msg:' + str(e) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@socketio.on('panel') |
|
|
|
|
def websocket_test(data): |
|
|
|
|
pdata = get_input_data(data) |
|
|
|
|
if not isLogined(): |
|
|
|
|
emit(pdata.s_response, { |
|
|
|
|
'data': public.returnData(-1, '会话丢失,请重新登陆面板!\r\n')}) |
|
|
|
|
return None |
|
|
|
|
mods = ['site', 'ftp', 'database', 'ajax', 'system', 'crontab', 'files', |
|
|
|
|
'config', 'panel_data', 'plugin', 'ssl', 'auth', 'firewall', 'panel_wxapp'] |
|
|
|
|
if not pdata['s_module'] in mods: |
|
|
|
|
result = '指定模块不存在!' |
|
|
|
|
else: |
|
|
|
|
result = eval("%s(pdata)" % pdata['s_module']) |
|
|
|
|
if not hasattr(pdata, 's_response'): |
|
|
|
|
pdata.s_response = 'response' |
|
|
|
|
emit(pdata.s_response, {'data': result}) |
|
|
|
|
# @socketio.on('panel') |
|
|
|
|
# def websocket_test(data): |
|
|
|
|
# pdata = get_input_data(data) |
|
|
|
|
# if not isLogined(): |
|
|
|
|
# emit(pdata.s_response, { |
|
|
|
|
# 'data': public.returnData(-1, '会话丢失,请重新登陆面板!\r\n')}) |
|
|
|
|
# return None |
|
|
|
|
# mods = ['site', 'ftp', 'database', 'ajax', 'system', 'crontab', 'files', |
|
|
|
|
# 'config', 'panel_data', 'plugin', 'ssl', 'auth', 'firewall', 'panel_wxapp'] |
|
|
|
|
# if not pdata['s_module'] in mods: |
|
|
|
|
# result = '指定模块不存在!' |
|
|
|
|
# else: |
|
|
|
|
# result = eval("%s(pdata)" % pdata['s_module']) |
|
|
|
|
# if not hasattr(pdata, 's_response'): |
|
|
|
|
# pdata.s_response = 'response' |
|
|
|
|
# emit(pdata.s_response, {'data': result}) |
|
|
|
|