feat: 新增智控台管理websocket服务器端【配置拉取】和【重启】

This commit is contained in:
caixypromise
2025-05-20 20:02:16 +08:00
parent 888b71a196
commit 34d9857089
16 changed files with 1320 additions and 23 deletions
+4 -2
View File
@@ -273,9 +273,10 @@ class ConnectionHandler:
await self.websocket.send(
json.dumps(
{
"type": "server_response",
"type": "server",
"status": "success",
"message": "服务器重启中...",
"content": {'action': "restart"}
}
)
)
@@ -302,9 +303,10 @@ class ConnectionHandler:
await self.websocket.send(
json.dumps(
{
"type": "server_response",
"type": "server",
"status": "error",
"message": f"Restart failed: {str(e)}",
'content': {'action': "restart"}
}
)
)
@@ -95,9 +95,10 @@ async def handleTextMessage(conn, message):
await conn.websocket.send(
json.dumps(
{
"type": "config_update_response",
"type": "server",
"status": "error",
"message": "无法获取服务器实例",
"content": {"action": "update_config"}
}
)
)
@@ -107,9 +108,10 @@ async def handleTextMessage(conn, message):
await conn.websocket.send(
json.dumps(
{
"type": "config_update_response",
"type": "server",
"status": "error",
"message": "更新服务器配置失败",
"content": {"action": "update_config"}
}
)
)
@@ -119,9 +121,10 @@ async def handleTextMessage(conn, message):
await conn.websocket.send(
json.dumps(
{
"type": "config_update_response",
"type": "server",
"status": "success",
"message": "配置更新成功",
"content": {"action": "update_config"}
}
)
)
@@ -130,9 +133,10 @@ async def handleTextMessage(conn, message):
await conn.websocket.send(
json.dumps(
{
"type": "config_update_response",
"type": "server",
"status": "error",
"message": f"更新配置失败: {str(e)}",
"content": {"action": "update_config"}
}
)
)