From 3a4c2edd9b314d98f152bc2fadad277c5bef1e6e Mon Sep 17 00:00:00 2001 From: Wu Qing <3184394176@qq.com> Date: Fri, 17 Apr 2026 13:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3:=20=E6=8C=89=20Ant/Arco=20De?= =?UTF-8?q?sign=20=E9=A3=8E=E6=A0=BC=E9=87=8D=E6=9E=84=E5=AE=98=E7=BD=91?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E4=BF=AE=E6=AD=A3=20API=20=E5=8F=82?= =?UTF-8?q?=E8=80=83=EF=BC=8C=E5=AE=8C=E5=96=84=20i18n=20(#41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构: - 首页 Hero 重设计:双列布局(标题+CTA+指标 / macOS 风代码窗口) - 引入渐变文字、pulse 徽章、悬停带动画的主按钮 - 功能卡片加 SVG 图标、悬停提升效果、部分卡片变成可点击链接 - 新增 HomepageShowcase 截图轮播区:Tab 切换四个核心页面(仪表盘/任务/存储/多节点) - 全站换 Arco 蓝 (#165dff) 作为主色,紫色 (#8f4bff) 作为辅助 - 导航栏加毛玻璃效果、表格加圆角与边框、菜单项圆角化 - 深色模式配色整体收敛 内容修正: - API 参考补全遗漏的端点:auth logout/profile、records batch-delete、 storage-targets star/usage/google-drive、notifications test、dashboard timeline、settings - 把 API 表格改为"方法/端点/说明"三列,加响应结构说明 - 中英文 API 文档同步更新 i18n: - code.json 补充 Hero、Features、Showcase 全部新翻译键 - 校对:16 个中英文档 frontmatter 完全对齐,无漏译 构建:双语 build 通过、产物 3.3MB --- docs-site/docs/reference/api.md | 164 +++++++---- docs-site/i18n/zh-Hans/code.json | 70 ++++- .../current/reference/api.md | 154 ++++++---- .../src/components/HomepageFeatures/index.tsx | 120 ++++++-- .../HomepageFeatures/styles.module.css | 146 +++++++++- .../src/components/HomepageShowcase/index.tsx | 120 ++++++++ .../HomepageShowcase/styles.module.css | 196 +++++++++++++ docs-site/src/css/custom.css | 213 +++++++++++++- docs-site/src/pages/index.module.css | 270 +++++++++++++++++- docs-site/src/pages/index.tsx | 103 +++++-- .../static/img/screenshots/backup-tasks.png | Bin 0 -> 120535 bytes .../static/img/screenshots/dashboard.png | Bin 0 -> 130648 bytes docs-site/static/img/screenshots/nodes.png | Bin 0 -> 112368 bytes .../img/screenshots/storage-targets.png | Bin 0 -> 98178 bytes 14 files changed, 1373 insertions(+), 183 deletions(-) create mode 100644 docs-site/src/components/HomepageShowcase/index.tsx create mode 100644 docs-site/src/components/HomepageShowcase/styles.module.css create mode 100644 docs-site/static/img/screenshots/backup-tasks.png create mode 100644 docs-site/static/img/screenshots/dashboard.png create mode 100644 docs-site/static/img/screenshots/nodes.png create mode 100644 docs-site/static/img/screenshots/storage-targets.png diff --git a/docs-site/docs/reference/api.md b/docs-site/docs/reference/api.md index de3aa8a..e694bc1 100644 --- a/docs-site/docs/reference/api.md +++ b/docs-site/docs/reference/api.md @@ -10,74 +10,126 @@ All endpoints are prefixed with `/api` and authenticated with a JWT Bearer token ## Authentication -| Endpoint | Description | -|----------|-------------| -| `POST /api/auth/setup` | Initialize the first admin (only when no user exists) | -| `POST /api/auth/login` | Log in and receive a JWT | -| `PUT /api/auth/password` | Change password | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/auth/setup/status` | Check whether admin initialization is needed | +| `POST` | `/api/auth/setup` | Initialize the first admin (only when no user exists) | +| `POST` | `/api/auth/login` | Log in and receive a JWT | +| `POST` | `/api/auth/logout` | Log out (invalidate current token) | +| `GET` | `/api/auth/profile` | Current user profile | +| `PUT` | `/api/auth/password` | Change password | -## Backup tasks +## Backup Tasks -| Endpoint | Description | -|----------|-------------| -| `GET /api/backup/tasks` | List tasks | -| `POST /api/backup/tasks` | Create | -| `GET /api/backup/tasks/:id` | Detail | -| `PUT /api/backup/tasks/:id` | Update | -| `DELETE /api/backup/tasks/:id` | Delete | -| `PUT /api/backup/tasks/:id/toggle` | Enable / disable | -| `POST /api/backup/tasks/:id/run` | Manual run | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/backup/tasks` | List tasks | +| `POST` | `/api/backup/tasks` | Create | +| `GET` | `/api/backup/tasks/:id` | Detail | +| `PUT` | `/api/backup/tasks/:id` | Update | +| `DELETE` | `/api/backup/tasks/:id` | Delete | +| `PUT` | `/api/backup/tasks/:id/toggle` | Enable / disable | +| `POST` | `/api/backup/tasks/:id/run` | Trigger a manual run | -## Backup records +## Backup Records -| Endpoint | Description | -|----------|-------------| -| `GET /api/backup/records` | List records with filters | -| `GET /api/backup/records/:id/logs/stream` | Live logs (SSE) | -| `GET /api/backup/records/:id/download` | Download artifact | -| `POST /api/backup/records/:id/restore` | Restore into the original source | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/backup/records` | List records with filters | +| `GET` | `/api/backup/records/:id` | Record detail | +| `GET` | `/api/backup/records/:id/logs/stream` | Live logs (SSE) | +| `GET` | `/api/backup/records/:id/download` | Download the artifact | +| `POST` | `/api/backup/records/:id/restore` | Restore to the original source | +| `DELETE` | `/api/backup/records/:id` | Delete a record | +| `POST` | `/api/backup/records/batch-delete` | Bulk delete | -## Storage targets +## Storage Targets -| Endpoint | Description | -|----------|-------------| -| `GET /api/storage-targets` | List | -| `POST /api/storage-targets` | Create | -| `POST /api/storage-targets/test` | Test connection with pending config | -| `GET /api/storage-targets/rclone/backends` | List all available rclone backends | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/storage-targets` | List | +| `POST` | `/api/storage-targets` | Create | +| `GET` | `/api/storage-targets/:id` | Detail | +| `PUT` | `/api/storage-targets/:id` | Update | +| `DELETE` | `/api/storage-targets/:id` | Delete | +| `POST` | `/api/storage-targets/test` | Test connection with pending config | +| `POST` | `/api/storage-targets/:id/test` | Re-test a saved target | +| `PUT` | `/api/storage-targets/:id/star` | Toggle favourite | +| `GET` | `/api/storage-targets/:id/usage` | Query remote usage (where supported) | +| `GET` | `/api/storage-targets/rclone/backends` | List all available rclone backends | +| `POST` | `/api/storage-targets/google-drive/auth-url` | Start Google Drive OAuth | +| `POST` | `/api/storage-targets/google-drive/complete` | Complete OAuth flow | -## Nodes (cluster) +## Nodes (Cluster) -| Endpoint | Description | -|----------|-------------| -| `GET /api/nodes` | List nodes | -| `POST /api/nodes` | Create a node and return token | -| `PUT /api/nodes/:id` | Rename | -| `DELETE /api/nodes/:id` | Delete (rejected if tasks are attached) | -| `GET /api/nodes/:id/fs/list` | Browse directory (remote node = async RPC) | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/nodes` | List nodes | +| `POST` | `/api/nodes` | Create a node and return its token | +| `GET` | `/api/nodes/:id` | Node detail | +| `PUT` | `/api/nodes/:id` | Rename | +| `DELETE` | `/api/nodes/:id` | Delete (rejected if tasks are still attached) | +| `GET` | `/api/nodes/:id/fs/list` | Browse a directory (remote nodes use an async RPC via Agent) | -## Agent protocol (X-Agent-Token) +## Agent Protocol (X-Agent-Token) -| Endpoint | Description | -|----------|-------------| -| `POST /api/agent/heartbeat` | Report liveness | -| `POST /api/agent/commands/poll` | Claim one pending command | -| `POST /api/agent/commands/:id/result` | Report command result | -| `GET /api/agent/tasks/:id` | Fetch task spec with decrypted storage configs | -| `POST /api/agent/records/:id` | Append logs / update record status | +Dedicated endpoints for the Agent CLI. Authenticated via the `X-Agent-Token` header instead of JWT. + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `POST` | `/api/agent/heartbeat` | Report liveness; returns the node ID | +| `POST` | `/api/agent/commands/poll` | Claim one pending command | +| `POST` | `/api/agent/commands/:id/result` | Report command result | +| `GET` | `/api/agent/tasks/:id` | Fetch task spec with decrypted storage configs | +| `POST` | `/api/agent/records/:id` | Append logs / update record status | ## Notifications -| Endpoint | Description | -|----------|-------------| -| `GET /api/notifications` | List | -| `POST /api/notifications` | Create | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/notifications` | List | +| `POST` | `/api/notifications` | Create | +| `GET` | `/api/notifications/:id` | Detail | +| `PUT` | `/api/notifications/:id` | Update | +| `DELETE` | `/api/notifications/:id` | Delete | +| `POST` | `/api/notifications/test` | Test with pending config | +| `POST` | `/api/notifications/:id/test` | Re-test a saved notifier | -## Dashboard / audit / system +## Dashboard -| Endpoint | Description | -|----------|-------------| -| `GET /api/dashboard/stats` | Overview statistics | -| `GET /api/audit-logs` | Audit log list | -| `GET /api/system/info` | System information | -| `GET /api/system/update-check` | Check for a newer release | +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/dashboard/stats` | Overview statistics | +| `GET` | `/api/dashboard/timeline` | Recent activity timeline | + +## Audit / System / Settings + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/audit-logs` | Audit log list | +| `GET` | `/api/system/info` | System information | +| `GET` | `/api/system/update-check` | Check for a newer release | +| `GET` | `/api/settings` | System-level settings | +| `PUT` | `/api/settings` | Update system settings | + +## Response Envelope + +All successful responses follow the shape: + +```json +{ + "code": "OK", + "message": "", + "data": { /* actual payload */ } +} +``` + +Errors return an HTTP 4xx/5xx plus: + +```json +{ + "code": "BACKUP_TASK_NOT_FOUND", + "message": "备份任务不存在", + "data": null +} +``` diff --git a/docs-site/i18n/zh-Hans/code.json b/docs-site/i18n/zh-Hans/code.json index b6b3e41..57998b0 100644 --- a/docs-site/i18n/zh-Hans/code.json +++ b/docs-site/i18n/zh-Hans/code.json @@ -1,26 +1,82 @@ { + "home.badge": { + "message": "开源 · v1.6.0", + "description": "Version badge on the hero" + }, + "home.title.part1": { + "message": "为每一台服务器提供", + "description": "Hero title, first line" + }, + "home.title.part2": { + "message": "自托管备份管理。", + "description": "Hero title accent second line" + }, "home.tagline": { - "message": "自托管服务器备份管理 — 一个二进制,一条命令,管好所有备份", + "message": "一个二进制,一条命令。文件 / 数据库 / SAP HANA 备份直送 70+ 存储后端。", "description": "Tagline on the home page" }, + "home.pageTitle": { + "message": "自托管备份管理", + "description": "Page
{description}
-{description}
+ {link && ( + +
+
+
{current.description}
+ +
-
+
+
+ # Docker one-liner{'\n'}
+ $ docker run -d --name backupx \{'\n'}
+ {' '}-p 8340:8340 \{'\n'}
+ {' '}-v backupx-data:/app/data \{'\n'}
+ {' '}awuqing/backupx:latest{'\n'}
+ {'\n'}
+ # Open http://localhost:8340{'\n'}
+ # Deploy an Agent on a remote host{'\n'}
+ $ backupx agent \{'\n'}
+ {' '}--master http://master:8340 \{'\n'}
+ {' '}--token <token>
+
+
+ m$M-x1&V7NDDe{~ghoR=PkpIt#N_-Zl
z^e3Vq)ddUkJ}d}Qpatziry(jM$k873U!EiKi1Mz?(M6zNk#=gk+v16xmCCMvrKk}#
ztA^UMb2OzVr!KM@2;%xV%2c_|ZfzQ_bIEiu+c+8-o9ODOG)JoS)_lCw
zH1&(?=>ywq5o$mhI2JF;3js4bfWTQjJ%bst(<^t!W@hvZ-Y)NL&CZm?SJ7<2r{&=d
zUT3+A5_GwZ1)ii|93alnFP9yJ9@L;xnA
ZC?+aOTB``kLrzObs15cca1+)i;oDMvA#5Tv=SxdXO@3us#>TTQfga{M
zI`lhP&-^E5Y90K}m$d@V+k1OUDkhz7UPig>fftLpNojHSb>Hdh>XMddAYtX=?MHo0
zOG_uS&eT`0wjItc940K(6AvJJsbVg>muO_&PqwE4MFj@+)x6U`I7mXsHElKPoA!Jt
zL^&OP7UEcW&q}S*-q_V0_QXi6Yt|7cH8IfMoa2g`y7&{Ay3bjsI(S>V9ty31R=BX!
zp9c^avs~3AL$%tbUgqEY#OP#e;#d>klvmQ^r8Qw8NoAyj68iECz$u+peQOcVu}KQ0
zpJ>=+BqU{&eEVh01G)WI>X0*(>2pmf0^de0)vpkAjVE85xz!=$HRbPpA1-MdJsiXq
zRm&w9KetKA5{{?V#SJ+PFQLP((|DUJfwantOY@8$2|sLT%ZU>>ujyH#H}!p-&y;C6
z>R`WBy5@7c6W1?wH$83R>yZ7O_VyQcYY#HVe&unWShJ=kNF-g)4_?-09yEWb;&PK$
zG%OMlnVOmEwt8B8SgosiRa?Z>%}xSoylk1f;XdQoBAq59;imY(2dx5i$-kAm(E48E
zT{dxc6Qd#`takR&w$s-X98$%GhA+|Pe7XQS264Saqk*Pr@-oHc&tE9E*m6LtUMh&y
ztCp#XMmKq#ReNv#@SFZUxj=YWk=<=s#Y%leCg8zu1%F5Pu=#gGM^Wv(L$oytwR`O9
zkjG8u0O}V_kM{DAhFvzR@djl$I9|U&U6@{2SXbUyFy1N>F|S8krUKjY9f&IKRSZjH
z;sq_Wq%yZn8@@3txa|64CR^qj^);iG=dE+wQyk>%l)*npLkDB49YW5i%YJ4vb$sgh
zmnot1zU78(vBa+81VqI`)k=ugB)_pVpu<}LP
Z7(1`2)WTo1++K1)LE^VM%iQgZU|0HZ}5jKGWk;&HXD
z*d8vuj9%?I@cr92l&1U#8g(BOR+mEM6*=^tO(AMtnH_