25/09/24 10:00~11:30 停机维护

This commit is contained in:
Cai
2025-09-24 18:12:45 +08:00
parent 07cf2363ab
commit 3ad36c29ed
13 changed files with 2997 additions and 224 deletions

View File

@@ -15,10 +15,7 @@ from ..services.user_service import get_or_load_current_user
class VSCodeNamespace(Namespace):
def on_login(self,data):
ex = current_app.extensions
uuid2username = ex["uuid2username"]
backboard_manager = ex["backboard_manager"]
print("VSCode client connected")
print(data)
dataconfig = data['config']
user_uuid = dataconfig.get('user_uuid')
path = dataconfig.get('path')
@@ -26,11 +23,18 @@ class VSCodeNamespace(Namespace):
lesson_id = dataconfig.get('chapter_id')
print(f"User {user_uuid} connected with path: {path}")
join_room(user_uuid, namespace='/vscode')
if backboard_manager.get_backboard(user_uuid) == None:
backboard_manager.add_backboard(user_uuid,uuid2username[user_uuid], course_id, lesson_id, path)
chatmanager = ex['user_uuid2chatmanager'][user_uuid]
chatmanager.vscode_ws=self
def on_load_chapter(self, data):
dataconfig = data['config']
user_uuid = dataconfig.get('user_uuid')
ex = current_app.extensions
chatmanager = ex['user_uuid2chatmanager'][user_uuid]
chatmanager.load_code_in_markdown()
def on_message(self, data):
# print(f"Received from VSCode client: {data}")
dataconfig = data['config']
@@ -139,6 +143,9 @@ class AgentNamespace(Namespace):
user_uuid2ase_client[uuid].send_text(d['route'], data['data'])
def on_connect_to_ase(client_entry: HSAEngineClient, namespace_entry, init_data):
'''
此时刚刚建立好aseclient连接并向前端发送打开code-server-like指令。
'''
print(f"on_connect_to_ase {client_entry}, {namespace_entry}, {init_data}")
namespace_entry, ase_client = namespace_entry
namespace_entry.emit('open-iframe',"", room=init_data['room'], namespace='/agent')