Skip to content

feat(admin): migrate pro admin UI into app admin sidebar - #7609

Draft
xqvvu wants to merge 2 commits into
labring:mainfrom
xqvvu:xqvvu/feat/admin-ui-migrate
Draft

feat(admin): migrate pro admin UI into app admin sidebar#7609
xqvvu wants to merge 2 commits into
labring:mainfrom
xqvvu:xqvvu/feat/admin-ui-migrate

Conversation

@xqvvu

@xqvvu xqvvu commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

背景

把 pro/admin 的 UI 迁移到前台主应用 projects/app,以"管理员侧栏"形式集成,root 用户在 app 内即可完成管理员操作,无需单独部署/访问 admin 应用。设计方案见 .agents/design/admin/pro-admin-ui-migrate.md

改动

  • 路由:新增 25 个 /admin/* 页面(dashboard 5 子页、users/teams/plans/pays/invoice、apps/datasets、config basic/feature/model/thirdParty/user/pay/plugin/modelProvider、templates app/toolkit、inform、log、audit、home);旧 /config/* 路由 302 重定向到 /admin/config/*
  • 导航壳层SecondaryNavigationContainer 扩展两级分组侧栏能力(SideTabs/Group,向后兼容 account 页);root 用户 navbar 新增"管理"入口
  • 组件迁移components/admin/(BoxCard、markdown、Settings 表单系列、PlanComponents)、pageComponents/admin/ 各页面模块
  • 前端 API 封装web/admin/* 通过 /proApi 代理调用 pro/admin 接口;pro 服务未配置时静默降级为空数据,保证开源版页面骨架可渲染
  • License:激活/校验 UI(LicenseInput/LicenseData)+ root 登录后未激活检测,提示激活/购买商业版
  • 依赖@tanstack/react-tablenodemailer@alicloud/*xml2jscanvas 等注册进 pnpm catalog

验证

  • tsc 全量 0 error、eslint 0 error(warning 为迁移代码风格,与 pro/admin 源一致)
  • dev server 实测迁移接口从 404 → 403/200(root 认证拦截/公开接口),路由真实存在;app 首页/登录正常

待办(后续)

  • 迁移接口单测(pro/admin 已有 7 个测试待迁移到 projects/app/test/api/admin/
  • eslint warnings 清理
  • root 登录后完整 UI 流程人工验证

- Add 25 /admin/* routes (dashboard, users/teams/plans/pays/invoice,
  apps/datasets, config basic/feature/model/thirdParty/user/pay/plugin/
  modelProvider, templates app/toolkit, inform, log, audit, home)
- Extend SecondaryNavigationContainer with two-level grouped sidebar
  (SideTabs/Group, backward compatible with account pages)
- Add admin entry to navbar for root users; redirect old /config/* routes
  to /admin/config/*
- Migrate admin components (BoxCard, markdown, Settings form series,
  PlanComponents) and frontend API wrappers (web/admin/*) calling
  pro/admin APIs via /proApi proxy with silent degrade when pro is absent
- Add license activation UI (LicenseInput/LicenseData) + root license
  detection in Layout; useSystemStore license state
- Register new deps in pnpm catalog (react-table, nodemailer, alicloud,
  xml2js, canvas, xterm)

Design: .agents/design/admin/pro-admin-ui-migrate.md
canvas@3.2.3 was added to the app catalog/package.json during the admin
migration but is never imported by any app code (pro/admin pins its own
^3.0.0 for captcha). Its node-gyp install script requires Python, which
breaks the alpine maindeps Docker build. Keep onlyBuiltDependencies entry
for pro/admin.
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_7822cbb3eb106447ad222f881e4dbe7e37962a16

🕒 Time: 2026-08-27 16:45:49 (UTC+8)

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 31.78% 3119 / 9814
🔵 Statements 31.67% 3289 / 10382
🔵 Functions 26.46% 623 / 2354
🔵 Branches 26.26% 1514 / 5765
File CoverageNo changed files found.
Generated in workflow #2660 for commit 7822cbb by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown

Build and publish successful - Preview fastgpt Image:

ghcr.io/labring/fastgpt-pr:fastgpt_7822cbb3eb106447ad222f881e4dbe7e37962a16

🕒 Time: 2026-08-27 16:46:42 (UTC+8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant