From 7276cfe585592a15c38e1387eba53219993174b1 Mon Sep 17 00:00:00 2001 From: butubb <1422726308@qq.com> Date: Fri, 4 Sep 2026 08:08:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BE=85=E8=BF=9E=E6=8E=A5=E6=B1=A0?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=BF=87=E6=BB=A4=E7=A6=BB=E7=BA=BF=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E2=80=94=E2=80=94list=5Fpending=20=E5=8F=AA=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=BD=93=E5=89=8D=E5=9C=A8=E7=BA=BF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=EF=BC=88=E7=A6=BB=E7=BA=BF=E5=80=99=E9=80=89=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=EF=BC=89=EF=BC=8C=E4=B8=8D=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=20JS=20=E7=BC=93=E5=AD=98=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E4=BB=BB=E4=BD=95=E5=AE=A2=E6=88=B7=E7=AB=AF=E9=83=BD?= =?UTF-8?q?=E6=8B=BF=E4=B8=8D=E5=88=B0=E7=A6=BB=E7=BA=BF=E6=9D=A1=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/device_discovery.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/device_discovery.py b/core/device_discovery.py index 9a6e2d3..410dfe9 100644 --- a/core/device_discovery.py +++ b/core/device_discovery.py @@ -301,14 +301,16 @@ def get_status(): def list_pending(): - """待连接列表(含当前在线状态:本机 adb 一次解析)。""" + """待连接列表:只返回当前在线的设备(离线候选不可确认,不展示)。 + + 后端直接过滤(2026-09-04):不依赖前端 JS 版本,任何客户端都拿不到 + 离线条目;设备恢复在线后扫描自动更新 last_seen 并重新出现在列表。 + """ online = _parse_adb_devices(_adb("devices")) with _ctx(): rows = [p.to_dict() for p in PendingDevice.query.order_by( PendingDevice.first_seen.desc()).all()] - for r in rows: - r["online"] = r["serial"] in online - return rows + return [dict(r, online=True) for r in rows if r["serial"] in online] def confirm_pending(serial, name=""):