Files
AstrBot/dashboard
Soulter 93e446e9f7 perf(dashboard): reduce first-screen load (lazy-load VAD/Monaco/i18n/ApexCharts, gzip responses) (#10413)
* perf(dashboard): lazy-load VAD dependencies on demand

Load onnxruntime-web and vad-web via dynamic script injection when the
VAD initializes instead of render-blocking script tags in index.html,
so they no longer delay the first paint on every page load.

* perf(dashboard): shrink first-screen bundle and gzip responses

- Lazy-load Monaco Editor (~3.3 MB) via an async wrapper component
  instead of importing it in main.ts; the editor bundle now loads only
  when an editor is first mounted.
- Load i18n locale data on demand: each language becomes its own async
  chunk instead of bundling all four locales (~1.4 MB of JSON) into the
  entry.
- Register vue3-apexcharts locally in StatsPage instead of globally in
  main.ts, moving ~470 KB out of the entry chunk.
- Add Starlette GZipMiddleware to the dashboard ASGI app so static
  assets and API responses are compressed (SSE is excluded by default).

Entry chunk: 4.5 MB -> 648 KB (gzip: 1.25 MB -> 210 KB).
2026-10-06 15:08:06 +08:00
..
…

AstrBot 管理面板

基于 CodedThemes/Berry 模板开发。

本地开发

先在项目根目录启动后端:

uv sync
uv run main.py

在另一个终端启动 WebUI:

cd dashboard
pnpm install
pnpm dev

开发服务器默认运行在 http://localhost:3000,将 /api 请求代理到 http://127.0.0.1:6185。后端地址不同时,请修改 vite.config.ts 中的 server.proxy。

构建与 API 客户端

pnpm build

此命令检查 TypeScript 类型并生成 dist/。当后端 API 路由、请求/响应结构或 OpenAPI 定义发生变化时,在本目录运行 pnpm generate:api 重新生成前端客户端。

发布更新入口

WebUI 顶部的更新入口会打开更新对话框,通过后端 API 获取版本信息。VITE_ASTRBOT_RELEASE_BASE_URL 当前没有被前端代码读取,设置此变量不会改变更新入口。