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);});