mirror of https://github.com/midoks/mdserver-web
parent
687f16e1ef
commit
1cc8ac17f3
@ -1,39 +0,0 @@ |
|||||||
# coding:utf-8 |
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------- |
|
||||||
# MW-Linux面板 |
|
||||||
# --------------------------------------------------------------------------------- |
|
||||||
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved. |
|
||||||
# --------------------------------------------------------------------------------- |
|
||||||
# Author: midoks <midoks@163.com> |
|
||||||
# --------------------------------------------------------------------------------- |
|
||||||
|
|
||||||
|
|
||||||
from flask_socketio import SocketIO, emit, send |
|
||||||
from flask import request |
|
||||||
|
|
||||||
from admin import app,socketio |
|
||||||
from .common import isLogined |
|
||||||
|
|
||||||
def websshRun(): |
|
||||||
@socketio.on('webssh_websocketio') |
|
||||||
def webssh_websocketio(data): |
|
||||||
if not isLogined(): |
|
||||||
emit('server_response', {'data': '会话丢失,请重新登陆面板!\r\n'}) |
|
||||||
return |
|
||||||
import utils.ssh.ssh_terminal as ssh_terminal |
|
||||||
shell_client = ssh_terminal.ssh_terminal.instance() |
|
||||||
shell_client.run(request.sid, data) |
|
||||||
return |
|
||||||
|
|
||||||
|
|
||||||
@socketio.on('webssh') |
|
||||||
def webssh(data): |
|
||||||
if not isLogined(): |
|
||||||
emit('server_response', {'data': '会话丢失,请重新登陆面板!\r\n'}) |
|
||||||
return None |
|
||||||
|
|
||||||
import utils.ssh.ssh_local as ssh_local |
|
||||||
shell = ssh_local.ssh_local.instance() |
|
||||||
shell.run(data) |
|
||||||
return |
|
Loading…
Reference in new issue