feat: add WebSocket plugin progress notification module and integrate with plugin management routes

- Implemented a WebSocket endpoint for broadcasting plugin loading progress.
- Created functions to update and broadcast progress status to connected clients.
- Integrated progress updates into plugin management routes for operations like fetching, cloning, installing, uninstalling, and updating plugins.
- Added error handling and logging for progress updates and WebSocket connections.
This commit is contained in:
墨梓柒
2025-11-18 22:54:25 +08:00
parent 8fe90b3642
commit 4141c25fdd
4 changed files with 2009 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ from .statistics_routes import router as statistics_router
from .person_routes import router as person_router
from .expression_routes import router as expression_router
from .emoji_routes import router as emoji_router
from .plugin_routes import router as plugin_router
from .plugin_progress_ws import get_progress_router
logger = get_logger("webui.api")
@@ -25,6 +27,10 @@ router.include_router(person_router)
router.include_router(expression_router)
# 注册表情包管理路由
router.include_router(emoji_router)
# 注册插件管理路由
router.include_router(plugin_router)
# 注册插件进度 WebSocket 路由
router.include_router(get_progress_router())
class TokenVerifyRequest(BaseModel):