Files
Nexus/docs/changelog/2026-07-09-btpanel-not-installed-hint.md
T
r a16ba169fd
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / e2e (push) Blocked by required conditions
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run
fix(btpanel): 未装宝塔时一键登录返回友好提示
SSH/API 登录前检测面板;将 public 模块 Traceback 映射为可读中文;
bootstrap bt_not_installed 不再回退 SSH。AGENTS 约定改完推 Gitea。
2026-07-09 01:25:54 +08:00

1.0 KiB
Raw Blame History

宝塔未安装时一键登录友好提示

日期2026-07-09

摘要

未安装宝塔的子机点击「宝塔一键登录」时,不再抛出 Python ModuleNotFoundError: public 堆栈,改为明确中文:该机未检测到宝塔面板…

动机

运维误对无宝塔机器点登录,SSH 回退脚本 import public 失败,前端只显示晦涩 Traceback。

涉及文件

路径 说明
server/infrastructure/btpanel/ssh_login.py BtPanelNotInstalledErrorhumanize_ssh_login_error、SSH 前检测 common.py
server/application/services/btpanel_service.py bootstrap bt_not_installed 不再回退 SSH
server/api/btpanel.py 400 + 友好 detail
tests/test_btpanel_ssh_login.py 未安装 / public 模块报错映射

验证

.venv/bin/pytest tests/test_btpanel_ssh_login.py tests/test_btpanel_temp_login_ttl.py -q

对未装宝塔机器 POST /api/btpanel/servers/{id}/login-url → HTTP 400,detail 含「未检测到宝塔面板」。