From a2361cf452b1d88de8df1bef76df5b0871d832f5 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sat, 13 Jun 2026 15:17:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Sentinel=20WebUI=20=E2=80=94=20=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=BA=E5=8D=95=E9=A1=B5=E9=9D=A2(=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98+=E8=8A=82=E7=82=B9=E7=AE=A1=E7=90=86Tab)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 插件 Web 页面 key 必须匹配 plugin_name (/plugin/sentinel) 改为单页面 Tab 切换: 仪表盘 + 节点管理 Co-Authored-By: Claude --- plugins/sentinel/__init__.py | 14 ++- plugins/sentinel/dashboard.html | 153 ++++++++++++++++++++++++++++---- 2 files changed, 143 insertions(+), 24 deletions(-) diff --git a/plugins/sentinel/__init__.py b/plugins/sentinel/__init__.py index 0029418..9f8a0c6 100644 --- a/plugins/sentinel/__init__.py +++ b/plugins/sentinel/__init__.py @@ -47,15 +47,11 @@ class Plugin(PluginWebMixin): except Exception as e: logger.warning(f"Sentinel network skip: {e}") - # 注册 WebUI 页面 - for fid, title, fname in [ - ("sentinel_dash", "🛡️ Sentinel", "dashboard.html"), - ("sentinel_cfg", "🛡️ 节点管理", "settings.html"), - ]: - p = os.path.join(os.path.dirname(__file__), fname) - if os.path.exists(p): - with open(p) as f: - self.register_web_page(fid, title, f.read(), icon="S" if "dash" in fid else "⚙") + # 注册 WebUI 页面 (key 必须匹配 plugin_name 才能在侧边栏访问) + dash_path = os.path.join(os.path.dirname(__file__), "dashboard.html") + if os.path.exists(dash_path): + with open(dash_path) as f: + self.register_web_page("sentinel", "🛡️ Sentinel", f.read(), icon="S") # 注册 API 路由 if self.network_bridge: diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index 58a03a4..02a7a21 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -1,10 +1,43 @@
-
+

🛡️ Sentinel 集群监控

- 连接中... +
+ + +
-
-
加载中...
+ + +
+
+
加载中...
+
+
+ + + + + +