feat: 优化数据分析页面,添加Excel工单导入功能

- 优化数据分析页面,添加可定制的图表功能
- 支持多种图表类型:折线图、柱状图、饼图、环形图、雷达图、极坐标图
- 添加图表定制功能:时间范围选择、数据维度选择
- 实现Excel工单导入功能,支持详情.xlsx文件
- 添加工单编辑功能,包括前端UI和后端API
- 修复WebSocket连接错误,处理invalid Connection header问题
- 简化预警管理参数,改为卡片式选择
- 实现Agent主动调用,无需人工干预
- 改进知识库导入,结合累计工单内容与大模型输出
This commit is contained in:
zhaojie
2025-09-10 23:13:08 +08:00
parent e08b570f22
commit 0c03ff20aa
16 changed files with 3077 additions and 51 deletions

View File

@@ -7,6 +7,8 @@
import sys
import os
import logging
import threading
import asyncio
from datetime import datetime
# 添加项目根目录到Python路径
@@ -23,6 +25,15 @@ def setup_logging():
]
)
def start_websocket_server():
"""启动WebSocket服务器"""
try:
from src.web.websocket_server import WebSocketServer
server = WebSocketServer(host="localhost", port=8765)
server.run()
except Exception as e:
print(f"WebSocket服务器启动失败: {e}")
def main():
"""主函数"""
print("=" * 60)
@@ -58,10 +69,15 @@ def main():
print(" 主页: http://localhost:5000")
print(" 预警管理: http://localhost:5000/alerts")
print(" 实时对话: http://localhost:5000/chat")
print(" WebSocket: ws://localhost:8765")
print()
print("按 Ctrl+C 停止服务")
print("=" * 60)
# 在单独线程中启动WebSocket服务器
websocket_thread = threading.Thread(target=start_websocket_server, daemon=True)
websocket_thread.start()
# 启动Flask应用
app.run(
debug=False,