fix(binance): show orphan recover banner on trade page load

Trade tab uses refreshPriceSnapshotConditional, not refreshPriceSnapshot; render recover banner there and on server when live exchange position lacks active monitor.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 16:59:20 +08:00
parent 7fe7c2e918
commit 6287ca9129
2 changed files with 17 additions and 0 deletions
@@ -402,7 +402,19 @@
</div>
<div class="card">
<h2 style="margin-bottom:8px">实时持仓</h2>
{% if not order and orphan_live_positions %}
{% set o = orphan_live_positions[0] %}
<div id="orphan-position-recover" class="orphan-recover-banner" style="display:block;margin-bottom:10px;padding:10px 12px;background:#2a2210;border:1px solid #6b5420;border-radius:6px;font-size:.9rem;color:#e8d5a8">
检测到交易所仍有 <strong>{{ o.symbol }}</strong> {{ '空' if o.direction == 'short' else '多' }}仓,但本地监控已中断(误同步时可能无交易记录)。
{% if o.recoverable_monitor_id %}
<button type="button" class="pos-entrust-btn" onclick="recoverLivePosition({{ o.recoverable_monitor_id }})">恢复监控{% if o.plan_stop_loss and o.plan_take_profit %}并挂止盈止损{% endif %}</button>
{% else %}
未找到可恢复的监控记录,需在服务器数据库处理。
{% endif %}
</div>
{% else %}
<div id="orphan-position-recover" class="orphan-recover-banner" style="display:none;margin-bottom:10px;padding:10px 12px;background:#2a2210;border:1px solid #6b5420;border-radius:6px;font-size:.9rem;color:#e8d5a8"></div>
{% endif %}
<div class="panel-scroll pos-list pos-list-live">
{% for o in order %}
<div class="pos-card" id="order-row-{{ o.id }}"
@@ -2252,6 +2264,7 @@ function refreshPriceSnapshotConditional(){
}
});
tickOrderHoldDurations();
renderOrphanRecoverBanner(data.orphan_live_positions);
}
}).catch(()=>{});
}