feat(backup): 只读盘点真实批次、子库路径与容量

为什么:28189 验收里历史批次/子库路径/容量都没有真实接口,页面只能占位;
用户要求修实际接口而不是继续改文案,同时不得写主机或触发备份。

怎么改:新增 GET /api/v1/backup-schedule/inventory,只读盘点 statfs 实测容量、
st_blocks 实际占盘、全部批次与 MANIFEST 状态、每个子库完整主机路径。目录必须
只读挂载;用设备号区分挂载文件系统与容器根盘,同设备时不给主机容量。清单
missing/invalid、未接线、不可读分别展示。SSH 计划读回与盘点独立加载。
前端消费该接口:整盘色带、批次列表、子库路径复制、清单失败与容器根盘提示。

怎么验:Go 单测覆盖清单/占盘/符号链接/容器根盘;handler 契约;appconfig 接线校验;
vitest 627 项、tsc、vite build、prettier 通过;本地页面夹具核对 8 批与路径复制,
1440/1024/768 无横向溢出。未连接真实主机、未执行备份、未改真实计划。
This commit is contained in:
姚章浩
2026-11-20 00:58:18 +08:00
parent 9eacf6473e
commit 033f702d41
18 changed files with 2317 additions and 118 deletions
+23
View File
@@ -1972,6 +1972,29 @@
}
}
},
"/api/v1/backup-schedule/inventory": {
"get": {
"tags": [
"Settings"
],
"operationId": "getBackupScheduleInventory",
"summary": "只读盘点备份批次、子库完整路径与实际占盘、挂载文件系统实测容量",
"responses": {
"200": {
"$ref": "#/components/responses/Envelope"
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v1/backup-schedule/apply": {
"post": {
"tags": [