From 3ddffdc8f49ecd6301f98b8002c210dc469a039b Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 6 May 2026 16:17:44 +0800 Subject: [PATCH] feat: redesign system page - service status with refresh, separate backup/restore cards --- internal/web/ui/templates/system.html | 71 ++++++++++++++++++++++----- internal/web/ui_test.go | 6 +-- 2 files changed, 61 insertions(+), 16 deletions(-) diff --git a/internal/web/ui/templates/system.html b/internal/web/ui/templates/system.html index 338d124..4b0ee1b 100644 --- a/internal/web/ui/templates/system.html +++ b/internal/web/ui/templates/system.html @@ -1,36 +1,33 @@ {{define "system"}} -
-
系统管理 / 系统状态
-
系统状态页负责平台健康检查和数据备份恢复。
-
-

{{icon "heartbeat"}}后台健康

+

{{icon "heartbeat"}}服务状态

-
健康检查/health
-
接口文档/openapi.json
+
管理后台检测中…
+
接口文档检测中…
- 健康检查 - OpenAPI +
-

{{icon "audit"}}数据备份 / 恢复

+

{{icon "audit"}}数据备份

数据库文件{{if .DBPath}}{{.DBPath}}{{else}}未配置{{end}}
-
备份方式另存为数据库文件
-
+
+
+

{{icon "apply"}}数据恢复

+
- +
@@ -38,4 +35,52 @@
+ + {{end}} diff --git a/internal/web/ui_test.go b/internal/web/ui_test.go index 637cfab..96e78f2 100644 --- a/internal/web/ui_test.go +++ b/internal/web/ui_test.go @@ -3414,7 +3414,7 @@ func TestUI_AuditAndSystemPagesDefineNewScopes(t *testing.T) { rrSystem := httptest.NewRecorder() ui.pageSystem(rrSystem, httptest.NewRequest(http.MethodGet, "/ui/system", nil)) - for _, want := range []string{"系统管理 / 系统状态", "后台健康", "数据备份 / 恢复", "/health", "/openapi.json"} { + for _, want := range []string{"服务状态", "数据备份", "数据恢复", "/health", "/openapi.json"} { if !strings.Contains(rrSystem.Body.String(), want) { t.Fatalf("expected system HTML to contain %q", want) } @@ -3774,7 +3774,7 @@ func TestUI_SystemManagementPagesUseSystemManagementCrumb(t *testing.T) { path string want string }{ - {path: "/ui/system", want: "系统管理 / 系统状态"}, + {path: "/ui/system", want: "服务状态"}, {path: "/ui/audit", want: "系统管理 / 日志审计 / 审计记录"}, {path: "/ui/api", want: "系统管理 / 日志审计 / 高级调试"}, } { @@ -4480,7 +4480,7 @@ func TestUI_SystemPageShowsDatabaseBackupAction(t *testing.T) { html := renderPage(t, ui, "/ui/system") for _, want := range []string{ - "数据备份 / 恢复", + "数据备份", "恢复数据库", `class="btn ghost js-export-db"`, `data-export-url="/ui/system/db-backup"`,