Beispiel #1
0
def command_log(item):
    """
    :param item:
    :return: 发送一条日志
    """
    from web_server import socketio
    socketio.emit('command', item)
Beispiel #2
0
def message(message, _type=''):
    """
    :param _type: 默认 success warning error
    :param message:
    :return: 顶部下拉消息
    """
    from web_server import socketio
    socketio.emit('message', {'type': _type, 'message': message})
Beispiel #3
0
def message_box(message, title, _type=''):
    """
    :param message:默认 success warning error
    :param title:
    :param _type:
    :return: 弹窗消息
    """
    from web_server import socketio
    socketio.emit('message_box', {
        'message': message,
        'title': title,
        'type': _type
    })
Beispiel #4
0
def notification(message, title, _type='', duration=3):
    """
    :param message:默认 success warning error
    :param title:
    :param _type:
    :param duration: 消息显示时间 0表示消息不会自动关闭
    :return: 右侧消息
    """
    from web_server import socketio
    socketio.emit('notification', {
        'message': message,
        'title': title,
        'type': _type,
        'duration': duration
    })
Beispiel #5
0
def handle_message_connected():
    socketio.emit('connect', {'data': 'hand shake'})
Beispiel #6
0
 def send_process(self):
     """
     :return: 通过websocket发送数据
     """
     from web_server import socketio
     socketio.emit('process', self.process)
Beispiel #7
0
 def send(self):
     """
     :return: 通过websocket 发送数据到前端
     """
     socketio.emit('req_data', self.get())