Files
Nexus/docs/changelog/2026-06-09-agent-diagnose-ui-button.md
T
2026-07-08 22:31:31 +08:00

1001 B

2026-06-09 — 服务器页 Agent 诊断按钮

摘要

服务器列表操作列新增「诊断」按钮,调用 POST /api/servers/{id}/agent-diagnose,弹窗展示中心心跳、SSH、systemctl、错误日志与 /health 探测结果。

动机

CLI 脚本 agent_remote_diagnose.py 已可用于运维排查;需在后台 UI 一键触发,降低登录子机成本。

涉及文件

  • server/application/agent_diagnose_service.py — 诊断逻辑下沉(脚本与 API 共用)
  • server/api/servers.py — 新端点 + 审计 agent_diagnose
  • scripts/agent_remote_diagnose.py — 改为引用 service
  • frontend/src/components/servers/AgentDiagnoseDialog.vue
  • frontend/src/pages/ServersPage.vueServerUnsetPathPanel.vue
  • tests/test_agent_diagnose_service.py

验证

pytest tests/test_agent_diagnose_service.py tests/test_agent_remote_diagnose.py -q
cd frontend && npm run type-check

部署

需后端重启 + 前端 vite build 热更新。