fix: 待连接池后端过滤离线设备——list_pending 只返回当前在线设备(离线候选不可确认),不依赖前端 JS 缓存版本,任何客户端都拿不到离线条目
This commit is contained in:
@@ -301,14 +301,16 @@ def get_status():
|
|||||||
|
|
||||||
|
|
||||||
def list_pending():
|
def list_pending():
|
||||||
"""待连接列表(含当前在线状态:本机 adb 一次解析)。"""
|
"""待连接列表:只返回当前在线的设备(离线候选不可确认,不展示)。
|
||||||
|
|
||||||
|
后端直接过滤(2026-09-04):不依赖前端 JS 版本,任何客户端都拿不到
|
||||||
|
离线条目;设备恢复在线后扫描自动更新 last_seen 并重新出现在列表。
|
||||||
|
"""
|
||||||
online = _parse_adb_devices(_adb("devices"))
|
online = _parse_adb_devices(_adb("devices"))
|
||||||
with _ctx():
|
with _ctx():
|
||||||
rows = [p.to_dict() for p in PendingDevice.query.order_by(
|
rows = [p.to_dict() for p in PendingDevice.query.order_by(
|
||||||
PendingDevice.first_seen.desc()).all()]
|
PendingDevice.first_seen.desc()).all()]
|
||||||
for r in rows:
|
return [dict(r, online=True) for r in rows if r["serial"] in online]
|
||||||
r["online"] = r["serial"] in online
|
|
||||||
return rows
|
|
||||||
|
|
||||||
|
|
||||||
def confirm_pending(serial, name=""):
|
def confirm_pending(serial, name=""):
|
||||||
|
|||||||
Reference in New Issue
Block a user