修复bot前端

This commit is contained in:
dekun
2026-05-21 22:05:36 +08:00
parent f7dce1a004
commit ed6b56ff87
2 changed files with 17 additions and 60 deletions
+7 -40
View File
@@ -205,14 +205,13 @@
</div>
<div class="top-nav">
<a href="/trade" class="{% if page == 'trade' %}active{% endif %}">交易执行</a>
<a href="/records" class="{% if page == 'records' %}active{% endif %}">交易记录</a>
<a href="/plan_history" class="{% if page == 'plan_history' %}active{% endif %}">计划历史</a>
<a href="/records" class="{% if page == 'records' %}active{% endif %}">交易记录与复盘</a>
<a href="/stats" class="{% if page == 'stats' %}active{% endif %}">统计分析</a>
</div>
{% with msg=get_flashed_messages() %}{% if msg %}<div class="flash">{{ msg[0] }}</div>{% endif %}{% endwith %}
{% if page in ('records', 'plan_history') %}
{% if page == 'records' %}
<div class="list-window-bar">
<span style="color:#cfd3ef">列表筛选(<strong>UTC</strong>,默认当日):{{ list_window.label }}</span>
<label>预设
@@ -556,7 +555,7 @@
{% if page == 'records' %}
<div class="card full records-card">
<h2>交易记录 & 错过机会</h2>
<h2>交易记录与复盘</h2>
<div class="form-row" style="margin-bottom:10px;gap:8px">
<label style="display:flex;align-items:center;gap:6px;font-size:.82rem;color:#cfd3ef">
<input id="review-mode-toggle" type="checkbox">
@@ -738,41 +737,7 @@
</div>
</div>
{% endif %}
</div>
{% if page == 'plan_history' %}
<div class="card full" style="margin-bottom:12px">
<h2 style="margin-bottom:6px">已结束的趋势回调计划</h2>
<div class="rule-tip" style="margin-bottom:8px">删除将同时移除 <code>trend_plan_id</code> 关联的「趋势回调」交易记录及该计划对应的预览快照归档。交易所平仓同步起点(北京日期):<strong>{{ exchange_sync_from_label }}</strong><code>EXCHANGE_POSITION_SYNC_FROM_BJ</code>)。</div>
{% if plan_history and plan_history|length > 0 %}
<div class="table-wrap">
<table>
<tr><th>ID</th><th>品种</th><th>方向</th><th>杠杆</th><th>状态</th><th>结束</th><th>开仓时间</th><th>计划保证金≈</th><th>操作</th></tr>
{% for p in plan_history %}
<tr>
<td>{{ p.id }}</td>
<td>{{ p.symbol }}</td>
<td><span class="badge {{ 'direction-long' if p.direction == 'long' else 'direction-short' }}">{{ '做多' if p.direction == 'long' else '做空' }}</span></td>
<td>{{ p.leverage }}x</td>
<td>{{ p.status_label }}</td>
<td>{{ p.message or '-' }}</td>
<td>{{ (p.opened_at or '-')[:16] }}</td>
<td>{% if p.plan_margin_capital is not none %}{{ money_fmt(p.plan_margin_capital) }}{% else %}-{% endif %}</td>
<td>
<form action="{{ url_for('delete_trend_plan_history', pid=p.id) }}" method="post" style="display:inline" onsubmit="return confirm('确定删除该计划历史及关联趋势交易记录?');">
<button type="submit" class="table-del">删除</button>
</form>
</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
<div class="rule-tip" style="color:#8892b0">暂无已结束的计划</div>
{% endif %}
</div>
<div class="card full" style="margin-bottom:12px">
<div class="card full" id="preview-snapshots" style="margin-bottom:12px">
<h2 style="margin-bottom:6px">预览快照(自本版本起留存)</h2>
<div class="rule-tip" style="margin-bottom:8px">每次「生成预览」自动归档;取消、过期或执行后仍可点开查看当时参数。执行后状态为「已执行」并带关联计划 ID。</div>
{% if preview_snapshots and preview_snapshots|length > 0 %}
@@ -797,7 +762,9 @@
<div class="rule-tip" style="color:#8892b0">暂无预览快照(新版本生成预览后将出现在此)</div>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
{% if page == 'stats' %}
<div class="card stats-card full" id="stats-card">