Commit 5a627eaa authored by zk's avatar zk
Browse files

Add HYHAL env fallback for hy-smi

parent 7e88c254
# 更新记录
## 2026-06-04
- 增加 `hy-smi` 采集兜底:当默认环境和登录 Shell 都找不到命令时,会尝试先加载 `/opt/hyhal/env.sh`,兼容需要手动 source HYHAL 环境的机器。
## 2026-05-29
- 新增多站点入口切换,页面侧边栏可以在昆山 / 天津中心、太原中心等独立部署之间跳转。
......
......@@ -669,7 +669,8 @@ function buildAssetCommand() {
function buildHySmiCommand(args) {
const command = ["hy-smi", args].filter(Boolean).join(" ");
return `(${command} 2>/dev/null || bash -ilc ${shellQuote(command)})`;
const hyhalCommand = `. /opt/hyhal/env.sh >/dev/null 2>&1 && ${command}`;
return `(${command} 2>/dev/null || bash -ilc ${shellQuote(command)} || bash -lc ${shellQuote(hyhalCommand)})`;
}
function shellQuote(value) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment