Skip to content

管理后台:把系统设置并入「访问与安全」并删除该页 - #128

Merged
todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a14eaa-082e-7509-8f2c-43853c80d401
Oct 18, 2026
Merged

todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a14eaa-082e-7509-8f2c-43853c80d401

Conversation

@todosdev

@todosdev todosdev Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 将「系统设置」页并入「访问与安全」,并删除独立的系统设置页与路由,管理后台从 5 个标签精简为 4 个。
  • 「允许访问初始化页面」开关迁入访问与安全区块,随页面现有的保存按钮一并提交。
  • 「数据库维护」区块整体迁到访问与安全页末尾,行为不变。

Changes

web/src/pages/admin/AdminSecurityPage.tsx

  • 新增 setupPageEnabled 状态,读值并入现有 GET /admin/system/settings(setup_page_enabled ?? "1" !== "0"),保存并入现有 PUT(值 "1"/"0")。
  • 在现有三个开关之后新增「允许访问初始化页面」开关,复用页面内已有的 Toggle 组件。
  • 在保存按钮之后、页面末尾新增「数据库维护」区块:POST /admin/setup,展示「已是最新 / 初始化成功 / 未授权 / 禁止 / 失败」,请求中禁用按钮。

web/src/pages/admin/AdminPage.tsx

  • 从 tabs 移除 /admin/system 及不再使用的 Database 图标 import(移动端共用同一 tabs,自动一致)。

web/src/App.tsx

  • 删除 AdminSystemPage 的 lazy import 与 <Route path="system">,/admin/system 现落入根级 * 兜底路由重定向到首页。

web/src/pages/admin/AdminSystemPage.tsx

  • 删除(内容已全部迁移至 AdminSecurityPage)。

web/src/locales/en.json / zh.json

  • 删除不再引用的 admin.system;被迁移部分继续使用的键(setupPage*、dbMaintenance*、checkUpgradeDb、checkingDb、dbUpToDate、dbInitialized、dbUpgrade* 等)全部保留。

Testing

  • pnpm install --frozen-lockfile ✅
  • pnpm lint ✅(仅有 worker 与 PasswordPromptDialog.tsx 的既有 warning,改动文件无问题)
  • pnpm format:check ✅
  • pnpm typecheck(web + worker)✅
  • pnpm build(web)✅ —— 产物中已无 AdminSystemPage chunk

后端接口路径与字段名未改动;仅修改 web/src/**。

- Move the "allow setup page" toggle into AdminSecurityPage, read from and
  saved with the existing PUT /admin/system/settings alongside the other toggles
- Move the database maintenance section below the save button on the same page
- Remove the /admin/system route, its lazy import, and AdminSystemPage.tsx
- Drop the now-unused admin.system i18n key; keep migrated keys such as
  setupPage*, dbMaintenance*, checkUpgradeDb, and dbUpToDate

Checkpoint: 1u65_IEKpspptS0_ogv7b
@todosdev
todosdev Bot merged commit f327883 into main Oct 18, 2026
1 check passed
@mapxn
mapxn deleted the tds/conv-01a14eaa-082e-7509-8f2c-43853c80d401 branch November 8, 2026 11:29
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.

0 participants