fix: 组网存在不可达地址时追加✗警告
This commit is contained in:
1 parent
a1d0bd0089
commit
0b57c9a436
1 file changed
+7
-4
@@ -362,14 +362,16 @@ def run_check():
|
||||
s.append("- 组网 未配置")
|
||||
else:
|
||||
reachable = [h for h in et_hosts if ping_ok(h)]
|
||||
STATUS["easytier"] = {"ok": bool(reachable), "hosts": et_hosts, "reachable": reachable}
|
||||
unreachable = [h for h in et_hosts if h not in reachable]
|
||||
STATUS["easytier"] = {"ok": bool(reachable), "hosts": et_hosts, "reachable": reachable, "unreachable": unreachable}
|
||||
if not reachable:
|
||||
s.append(f"✗ 组网 {', '.join(et_hosts)} 均不可达")
|
||||
else:
|
||||
et_host = reachable[0]
|
||||
warn_suffix = (f" ✗ 不可达: {', '.join(unreachable)}" if unreachable else "")
|
||||
if not domains:
|
||||
connected.append({"type": "easytier", "target": et_host, "domain": None})
|
||||
s.append(f"✓ 组网 {et_host} 可达" + (f" (共{len(reachable)}/{len(et_hosts)}可达)" if len(et_hosts) > 1 else ""))
|
||||
s.append(f"✓ 组网 {et_host} 可达" + (f" (共{len(reachable)}/{len(et_hosts)}可达)" if len(et_hosts) > 1 else "") + warn_suffix)
|
||||
else:
|
||||
done, bad = [], []
|
||||
for d in domains:
|
||||
@@ -379,9 +381,10 @@ def run_check():
|
||||
line += f" (失败: {', '.join(bad)})"
|
||||
if len(et_hosts) > 1:
|
||||
line += f" [可达 {len(reachable)}/{len(et_hosts)}]"
|
||||
line += warn_suffix
|
||||
s.append(line)
|
||||
if done:
|
||||
connected.append({"type": "easytier", "target": et_host, "domain": ", ".join(done)})
|
||||
if done:
|
||||
connected.append({"type": "easytier", "target": et_host, "domain": ", ".join(done)})
|
||||
|
||||
# 3. NPS
|
||||
nps_server = cfg.get("nps_server")
|
||||
|
||||
Reference in new issue
Block a user