fix: Sentinel WebUI — 合并为单页面(仪表盘+节点管理Tab)
插件 Web 页面 key 必须匹配 plugin_name (/plugin/sentinel) 改为单页面 Tab 切换: 仪表盘 + 节点管理 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user