diff --git a/config/plugins/commands.yaml b/config/plugins/commands.yaml index 7d5e557..d27f62a 100644 --- a/config/plugins/commands.yaml +++ b/config/plugins/commands.yaml @@ -92,7 +92,7 @@ commands: permissions: - framework.command.test source: internal -last_updated: 291543.087298158 +last_updated: 297792.734060618 plugin_commands: example_plugin: echo: *id001 diff --git a/config/services/network_routes.yaml b/config/services/network_routes.yaml index 4292fc5..731fcc8 100644 --- a/config/services/network_routes.yaml +++ b/config/services/network_routes.yaml @@ -1,5 +1,5 @@ http_port: 4200 -last_updated: 291543.090646752 +last_updated: 297792.741311191 plugin_routes: example_plugin: - methods: diff --git a/docs/SenSu 插件开发详细指南.md b/docs/SenSu 插件开发详细指南.md index 7019466..7d0e4c7 100644 --- a/docs/SenSu 插件开发详细指南.md +++ b/docs/SenSu 插件开发详细指南.md @@ -5,6 +5,7 @@ - [SenSu 插件开发超详细指南](#sensu-插件开发超详细指南) - [一、插件系统架构深度解析](#一插件系统架构深度解析) - [二、插件开发完整方案](#二插件开发完整方案) + - [2.6 插件 WebUI 页面](#26-插件-webui-页面-v060) - [三、插件生命周期管理](#三插件生命周期管理) - [四、插件开发最佳实践](#四插件开发最佳实践) - [4.1 错误处理最佳实践](#41-错误处理最佳实践) @@ -3400,6 +3401,73 @@ class PluginResourceManager: ``` +### 2.6 插件 WebUI 页面 (v0.6.0) + +插件可以注册 WebUI 页面,自动出现在 SenSu 管理面板侧边栏的「插件面板」折叠项中。 + +#### 2.6.1 注册页面 + +```python +from sdk.plugin_web import PluginWebMixin + +class MyPlugin(PluginWebMixin): + async def initialize(self): + self.register_web_page( + path="mypanel", # 访问路径: /plugin/{plugin_name} + title="我的面板", # 侧边栏显示名称 + html_content="