e52f7f3566
- New: sdk/plugin_web.py (PluginWebMixin: web pages, API routes, SSE) - New: services/web_panel/routes/plugin_web.py (3 endpoints) - New: plugins/example_plugin/dashboard.html (counter + SSE demo) - Updated: example_plugin uses PluginWebMixin - Tests: 28/28 passing
706 B
706 B
Phase 3 开发进度总结
完成: 2026-06-10 测试: 28/28 通过
新增
sdk/plugin_web.py— PluginWebMixin (Web页面注册+API+SSE)services/web_panel/routes/plugin_web.py— 插件面板路由plugins/example_plugin/dashboard.html— 示例仪表盘 (计数器+SSE)
SDK API
register_web_page(path, title, html, icon)— 注册控制页面register_api_route(method, path, handler)— 注册 REST 端点push_sse_event(type, data)— SSE 实时推送handle_sse(request)— SSE 连接处理
端点
- GET /SenSu/plugin/{name} — 插件控制面板
- GET /SenSu/plugin/{name}/sse — SSE 事件流
- POST /SenSu/plugin/{name}/event — 触发事件