From 0b57c9a436d51d47dbd00a830329a4b2eff5e1d5 Mon Sep 17 00:00:00 2001 From: 3970260761 <3970260761@qq.com> Date: Mon, 9 Nov 2026 10:04:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=84=E7=BD=91=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=BE=BE=E5=9C=B0=E5=9D=80=E6=97=B6=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E2=9C=97=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 94e2e4f..1327c7e 100644 --- a/app.py +++ b/app.py @@ -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")