Add hub order popup modal with compact instance trade embed (plan A).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 23:12:08 +08:00
parent ee011800e1
commit 1767566951
9 changed files with 334 additions and 12 deletions
+4 -2
View File
@@ -22,8 +22,8 @@
{% if page == 'key_monitor' %}
{% include 'key_monitor_panel.html' %}
{% elif page == 'trade' %}
<div class="dual-panel-grid" style="grid-column:1/-1">
<div class="card">
<div class="dual-panel-grid{% if order_popup %} order-popup-trade-grid{% endif %}" style="grid-column:1/-1">
<div class="card order-popup-form-card">
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px">
<h2 style="margin-bottom:0">实盘下单监控</h2>
{% if focus_order_id %}
@@ -77,6 +77,7 @@
</form>
{% include 'order_plan_preview_bar.html' %}
</div>
{% if not order_popup %}
<div class="card">
<h2 style="margin-bottom:8px">实时持仓</h2>
<div class="panel-scroll pos-list pos-list-live">
@@ -191,6 +192,7 @@
</div>
</div>
{% endif %}
</div>
{% elif page in ('strategy', 'strategy_trend', 'strategy_roll') %}
{% include 'strategy_trading_page.html' %}
+14 -6
View File
@@ -14,14 +14,18 @@
</head>
<body
data-embed-shell="1"
{% if order_popup %}data-order-popup="1"{% endif %}
data-risk-percent="{{ risk_percent }}"
data-page="{{ initial_tab }}"
data-balance-refresh-ms="{{ balance_refresh_seconds * 1000 }}"
data-price-refresh-ms="{{ price_refresh_seconds * 1000 }}"
>
<div class="container">
<div class="header">
<h1>加密货币|交易监控 + AI复盘一体化</h1>
{% if order_popup %}
<link rel="stylesheet" href="/static/embed_order_popup.css?v=1">
{% endif %}
<div class="container{% if order_popup %} embed-order-popup-shell{% endif %}">
<div class="header{% if order_popup %} embed-order-popup-head{% endif %}">
<h1>{% if order_popup %}{{ exchange_display }} · 实盘下单{% else %}加密货币|交易监控 + AI复盘一体化{% endif %}</h1>
<div class="header-row">
<div class="exchange-tag">{{ exchange_display }}</div>
<span class="risk-status-badge risk-status-{{ risk_status.status|default('normal') }}" id="account-risk-badge" role="status" title="{{ risk_status.reason|default('', true) }}" data-status-label="{{ risk_status.status_label|default('正常') }}"{% if risk_status.freeze_until_ms %} data-freeze-until-ms="{{ risk_status.freeze_until_ms }}"{% endif %}>{{ risk_status.status_label|default('正常') }}</span>
@@ -39,6 +43,7 @@
</div>
</div>
</div>
{% if not order_popup %}
<nav class="top-nav embed-top-nav" aria-label="实例导航">
<a href="/key_monitor" data-embed-tab="key_monitor" class="{% if initial_tab == 'key_monitor' %}active{% endif %}">关键位监控</a>
<a href="/trade" data-embed-tab="trade" class="{% if initial_tab == 'trade' %}active{% endif %}">实盘下单</a>
@@ -47,8 +52,10 @@
<a href="/records" data-embed-tab="records" class="{% if initial_tab == 'records' %}active{% endif %}">交易记录与复盘</a>
<a href="/stats" data-embed-tab="stats" class="{% if initial_tab == 'stats' %}active{% endif %}">统计分析</a>
</nav>
{% endif %}
<div id="embed-flash" class="flash" style="display:none" role="status"></div>
{% if not order_popup %}
<div class="list-window-bar">
<span style="color:#cfd3ef">列表筛选(<strong>UTC</strong>,默认当日):{{ list_window.label }}</span>
<label>预设
@@ -66,14 +73,15 @@
<button type="button" style="padding:6px 12px" onclick="applyListWindow()">应用</button>
<span style="color:#8892b0;font-size:.75rem">统计页仍按北京时间 {{ stats_bundle.stats_reset_hour|default(reset_hour) }}:00 切日</span>
</div>
<div class="export-bar instance-desktop-only">
{% endif %}
<div class="export-bar instance-desktop-only{% if order_popup %} embed-order-popup-hide{% endif %}">
<span style="color:#9aa">数据导出(v{{ data_export_version }} CSVUTF-8;交易记录含开仓类型列,复盘单独导出):</span>
<a href="/export/trade_records">交易记录</a>
<a href="/export/journal_entries">复盘记录</a>
<a href="/export/key_monitors">关键位(当前)</a>
<a href="/export/key_monitor_history">关键位历史</a>
</div>
<div class="stat-box instance-desktop-only">
<div class="stat-box instance-desktop-only{% if order_popup %} embed-order-popup-hide{% endif %}">
<div class="stat-item"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div>
<div class="stat-item"><div class="label">总交易</div><div class="value" id="stat-total">{{ total }}</div></div>
<div class="stat-item"><div class="label">错过次数</div><div class="value" id="stat-miss">{{ miss_count }}</div></div>
@@ -116,6 +124,6 @@
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/key_monitor_form.js?v=1"></script>
{% include 'embed_boot_scripts.html' %}
<script src="/static/instance_embed.js?v=4"></script>
<script src="/static/instance_embed.js?v=5"></script>
</body>
</html>