From 3719d57269bbeb2c4019c077b6af5fe0fd98c357 Mon Sep 17 00:00:00 2001 From: 3970260761 <3970260761@qq.com> Date: Mon, 9 Nov 2026 12:01:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8A=B6=E6=80=81=E6=A0=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BD=93=E5=89=8D=E7=94=9F=E6=95=88=E5=9C=B0=E5=9D=80?= =?UTF-8?q?(=E8=BF=9C=E7=A8=8B=E7=94=A8=E6=88=B7=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E4=BD=BF=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 9 +++++++++ index.html | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/app.py b/app.py index 1e8e55b..89666fb 100644 --- a/app.py +++ b/app.py @@ -409,7 +409,16 @@ def run_check(): s.append(f"✗ NPS {nps_server} 不可达") with lock: + # 当前生效: 每个域名最后被更新到的目标 (即远程用户实际使用的地址) + _active = {} + for c in connected: + if c.get("domain"): + for d in str(c["domain"]).split(", "): + d = d.strip() + if d: + _active[d] = {"target": c.get("target"), "type": c.get("type")} STATUS["connected"] = connected + STATUS["active"] = [{"domain": d, "target": v["target"], "type": v["type"]} for d, v in _active.items()] STATUS["last_run"] = time.strftime("%Y-%m-%d %H:%M:%S") _det_msg = " | ".join(s) _det_level = "warn" if "✗" in _det_msg else "info" diff --git a/index.html b/index.html index 5f5cc30..c2dfb65 100644 --- a/index.html +++ b/index.html @@ -280,6 +280,10 @@ async function poll(){ html+=row('EasyTier',s.easytier); html+=row('NPS',s.nps); html+=`
上次检测: ${s.last_run||'-'}
`; + if((s.active||[]).length){ + html+=`
当前生效(远程用户实际使用的地址):
`; + (s.active||[]).forEach(a=>{html+=`
${a.domain} → ${a.target} (${a.type})
`;}); + } document.getElementById('st').innerHTML=html; const tb=document.getElementById('conn');tb.innerHTML=''; (s.connected||[]).forEach(c=>{const tr=document.createElement('tr');tr.innerHTML=`${c.type}${c.target||''}${c.domain||''}`;tb.appendChild(tr);});