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=""):