Files
Nexus/docs/reports/2026-06-09-server-list-expand-metrics-deploy-verification.md
T

48 lines
1.7 KiB
Markdown
Raw Normal View History

# 部署验证 — 服务器列表展开刷新 + 单机指标历史
**日期**: 2026-06-09
**范围**: `server_metric_samples``GET /servers/{id}/metrics`、展开区 `ServerInlineDetail` + `ServerMetricSparklines`
## 本地验证
| 项 | 结果 |
|----|------|
| `pytest tests/test_server_metrics.py` | 7/7 PASS |
| `bash scripts/local_verify.sh` | 26/26 PASS |
| `npm run type-check` | PASS |
| `vite build` | PASS`ServersPage-rQyapRTV.js` |
| `bash deploy/pre_deploy_check.sh` | 7/7 PASS |
## 生产部署
命令:`bash deploy/deploy-production.sh`
结果:**Deploy successful**
| 检查项 | 结果 |
|--------|------|
| 容器健康 | `nexus-prod-nexus-1` healthy |
| 内网 `/health` | ok |
| 外网 `https://api.synaglobal.vip/health` | HTTP 200(部署脚本输出) |
| 前端入口 | `index-DUJUpEbL.js` → HTTP 200 |
| 前端 bundle | `ServersPage-rQyapRTV.js` 已同步至容器 |
## 终验(浏览器,运维)
1. 打开 `https://api.synaglobal.vip/app/#/servers`
2. 点击某台服务器 **名称** 展开行
3. Network 应出现:
- `GET /api/servers/{id}`
- `GET /api/servers/{id}/logs?limit=1`
- `GET /api/servers/{id}/metrics?hours=24`
4. 展开区:状态 chip、实时 CPU/内存、24h sparkline(有 Agent 且部署满 ~10min 后有数据)、离线 chip(若曾离线)
5. 折叠再展开 → 上述请求再次发出
## 冷启动说明
`server_metric_samples` 自本次部署后每 10 分钟写入;部署后 10 分钟内展开可能显示「暂无历史数据」,属预期。
## 回滚
- 前端:回滚 `web/app` 至上一版 `ServersPage-*.js`
- 后端:回滚镜像/代码;`server_metric_samples` 表可保留(只读无害)