Skip to content

feat(webui): refactor dashboard and add plugin page#175

Closed
YumemiDream wants to merge 1 commit into
NickCharlie:mainfrom
YumemiDream:codex/dashboard-settings-plugin-page
Closed

feat(webui): refactor dashboard and add plugin page#175
YumemiDream wants to merge 1 commit into
NickCharlie:mainfrom
YumemiDream:codex/dashboard-settings-plugin-page

Conversation

@YumemiDream
Copy link
Copy Markdown
Contributor

改动概览

本次 PR 主要优化 Self Learning Dashboard 的前端体验,并新增 AstrBot Plugin Pages 支持,使用户可以直接从 AstrBot WebUI 的插件详情页进入 Dashboard。

Dashboard 设置页重构

  • 为设置页面增加侧边栏分类导航,降低大量配置项堆叠带来的阅读压力。
  • 将右侧设置项从单列展示优化为响应式网格布局,更充分利用页面空间。
  • 将布尔类型配置项改为切换开关样式,交互更直观。
  • 优化长文本、列表、复杂配置项的布局宽度,减少页面纵向滚动。
  • 优化依赖安装区域的展示、图标对齐、镜像选择和滚动条样式。
  • 保留手动保存按钮和未保存状态提示,避免配置修改反馈不清晰。

Dashboard 体验优化

  • 简化顶部品牌区域,减少重复标题和过多说明文字占用空间。
  • 移除黑话列表中容易产生误解的“按出现次数排序”。
  • 保留更准确的样本数、审查信息和上下文展示。

AstrBot Plugin Pages 支持

  • 新增 pages/dashboard/index.html,支持在 AstrBot 插件详情页中打开 Dashboard。
  • 新增 .astrbot-plugin/i18n/zh-CN.json.astrbot-plugin/i18n/en-US.json,注册 Dashboard 页面标题。
  • 通过 AstrBot Plugin Page bridge 调用插件 API 获取独立 Dashboard 地址。
  • WebUIManager 中注册 dashboard_url Web API,用于返回当前 WebUI Dashboard 地址。
  • 使用 iframe 嵌入原有 Dashboard,因此后续修改原 Dashboard 时,AstrBot 内嵌页面也会同步生效。
  • 移除 Plugin Page 内额外标题栏和无效按钮,避免与 AstrBot 自带页面标题重复。

回归测试

  • 增加 Plugin Page 入口相关断言,确认 bridge、iframe、dashboard_url 调用存在。
  • 增加 WebUIManager 单元测试,确认 dashboard_url API 会被注册。
  • 将 Plugin Page HTML 纳入外部 CDN 引用检查。
  • 增加设置页布局、开关控件、依赖安装区域等前端结构断言。

验证

已执行:

  • python -m py_compile tests\integration\test_webui_static_assets.py webui\manager.py tests\unit\test_webui_manager.py
  • Node 内联脚本语法检查:pages/dashboard/index.htmlweb_res/static/html/dashboard.html
  • git diff --cached --check

未完整执行 pytest:本地环境缺少 pytest 模块。

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @YumemiDream, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@YumemiDream YumemiDream force-pushed the codex/dashboard-settings-plugin-page branch 2 times, most recently from 19b6f8b to 42ff4b6 Compare June 7, 2026 06:56
@YumemiDream YumemiDream force-pushed the codex/dashboard-settings-plugin-page branch from 42ff4b6 to 1bb2800 Compare June 7, 2026 07:13
@YumemiDream YumemiDream closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant