条件单客户端勾选按 sim / live 分组,没有对应模式则不显示该组。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 18:14:46 +08:00
parent 10515ad1b1
commit b9f76f4d53
5 changed files with 89 additions and 34 deletions
+5
View File
@@ -635,6 +635,10 @@ def api_cond_order_candidates():
has_pos = isinstance(brief, list) and len(brief) > 0
locked = bool(snap.get("cond_order_locked"))
selectable = bool(row.get("online")) and not has_pos and not locked
inst = snap.get("instance") if isinstance(snap.get("instance"), dict) else {}
mode = str(inst.get("mode") or "").strip().lower()
if mode not in ("sim", "live"):
mode = ""
out.append(
{
"id": row.get("id"),
@@ -643,6 +647,7 @@ def api_cond_order_candidates():
"has_position": has_pos,
"cond_order_locked": locked,
"selectable": selectable,
"mode": mode,
"error": row.get("error") or "",
}
)