feat: 设置页新增「系统与更新」,按 GitHub 版本号检查更新

- 顶层 package.json 作为应用版本唯一来源(happy-export v1.0.0)
- backend/lib/updater.js:查 GitHub Release(优先)或 tag,与本机版本做 semver 比对
- backend/routes/system.js:GET /api/system/info、GET /api/system/check-update(30s 缓存)
- /api/health 版本号改为读真实版本
- 设置页新增第 4 个分类:当前版本 / 更新源仓库 / 检查更新(含更新说明折叠)
- 新增 RefreshIcon
This commit is contained in:
Drsakura
2026-09-10 16:23:42 +08:00
parent d8df2c3960
commit e4537d5bf0
7 changed files with 476 additions and 2 deletions
+12
View File
@@ -281,6 +281,18 @@
.cart-total { align-self: center; color: var(--text-secondary); font-size: 13px; }
.cart-total b { color: var(--text-primary); font-size: 16px; }
/* 设置页:系统与更新 */
.update-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 13px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--surface-deep); color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.update-status b { color: var(--text-primary); font-family: var(--font-mono); }
.update-status .spinner { width: 14px; height: 14px; border-width: 2px; }
.update-status.is-checking { color: var(--text-tertiary); }
.update-status.is-ok { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }
.update-status.is-new { border-color: var(--primary-border); background: var(--primary-bg); color: var(--primary-light); }
.update-status.is-error { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.update-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.update-links .btn-link { text-decoration: none; font-size: 13px; }
.update-notes { margin: 10px 0 0; max-height: 230px; overflow: auto; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--surface-deep); color: var(--text-secondary); font-family: var(--font-body); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
/* 窄屏:批量条与抽屉内表单换行 */
@media (max-width: 720px) {
.batch-bar { flex-wrap: wrap; }