Add instance data dashboard (default off).

Read-only overview of live orders, key monitors, and strategy; show options/hedge only when present. Toggle via system settings nav prefs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 12:09:29 +08:00
parent f7ba7c2f7d
commit c7aae67881
20 changed files with 825 additions and 20 deletions
@@ -0,0 +1,15 @@
{# 实例数据看板:只读活跃监控总览 #}
<div class="card full inst-dash-card" id="instance-dashboard" data-inst-dashboard="1">
<div class="inst-dash-head">
<div>
<h2 style="margin-bottom:4px">数据看板</h2>
<p class="muted inst-dash-desc">本户活跃监控总览 · 只读 · 期权/对冲有数据才显示</p>
</div>
<div class="inst-dash-head-actions">
<span class="muted inst-dash-updated" id="inst-dash-updated"></span>
<button type="button" class="btn-sm" id="inst-dash-refresh">刷新</button>
</div>
</div>
<p class="inst-dash-status muted" id="inst-dash-status"></p>
<div class="inst-dash-sections" id="inst-dash-sections"></div>
</div>
@@ -81,7 +81,9 @@
</div>
{% endmacro %}
<div class="grid">
{% if page == 'key_monitor' %}
{% if page == 'dashboard' %}
{% include 'dashboard_panel.html' %}
{% elif page == 'key_monitor' %}
{% include 'key_monitor_panel.html' %}
{% elif page == 'trade' %}
<div class="dual-panel-grid" style="grid-column:1/-1">
+6 -4
View File
@@ -6,7 +6,7 @@
<script src="/static/instance_theme.js?v=50"></script>
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
<link rel="stylesheet" href="/static/account_risk_badge.css?v=4">
<link rel="stylesheet" href="/static/instance_page.css?v=6">
<link rel="stylesheet" href="/static/instance_page.css?v=7">
<link rel="stylesheet" href="/static/instance_theme.css?v=95">
<script src="/static/account_risk_badge.js?v=4"></script>
<meta name="theme-color" content="#0b0d14">
@@ -29,6 +29,7 @@
<h1>加密货币|交易监控 + AI复盘一体化</h1>
</div>
<nav class="top-nav embed-top-nav" aria-label="实例导航">
<a href="/dashboard" data-embed-tab="dashboard" class="{% if initial_tab == 'dashboard' %}active{% endif %}"{% if not display.show_nav_dashboard %} style="display:none"{% endif %}>数据看板</a>
<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>
{% if not intraday_discipline and display.show_nav_strategy %}
@@ -109,11 +110,12 @@ const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | toj
<script src="/static/instance_stats.js?v=4"></script>
{% include 'embed_boot_scripts.html' %}
<script src="/static/records_review_page.js?v=2"></script>
<script src="/static/instance_dashboard.js?v=1"></script>
<script>
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
</script>
<script src="/static/instance_settings_prefs.js?v=13"></script>
<script src="/static/instance_live.js?v=5"></script>
<script src="/static/instance_embed.js?v=24"></script>
<script src="/static/instance_settings_prefs.js?v=14"></script>
<script src="/static/instance_live.js?v=6"></script>
<script src="/static/instance_embed.js?v=25"></script>
</body>
</html>
+12 -3
View File
@@ -16,7 +16,7 @@
<link rel="apple-touch-icon" href="/static/icons/apple-touch-icon.png">
<link rel="manifest" href="/static/icons/manifest.webmanifest">
<title>{{ pwa_app_name }}</title>
<link rel="stylesheet" href="/static/instance_page.css?v=3">
<link rel="stylesheet" href="/static/instance_page.css?v=7">
<link rel="stylesheet" href="/static/instance_theme.css?v=95">
</head>
@@ -116,6 +116,7 @@
<h1>加密货币|交易监控 + AI复盘一体化</h1>
</div>
<div class="top-nav">
<a href="/dashboard" data-embed-tab="dashboard" class="{% if page == 'dashboard' %}active{% endif %}"{% if not display.show_nav_dashboard %} style="display:none"{% endif %}>数据看板</a>
<a href="/key_monitor" class="{% if page == 'key_monitor' %}active{% endif %}">关键位监控</a>
<a href="/trade" class="{% if page == 'trade' %}active{% endif %}">实盘下单</a>
{% if not intraday_discipline and display.show_nav_strategy %}
@@ -155,7 +156,9 @@
{% endif %}
<div class="grid">
{% if page == 'key_monitor' %}
{% if page == 'dashboard' %}
{% include 'dashboard_panel.html' %}
{% elif page == 'key_monitor' %}
{% include 'key_monitor_panel.html' %}
{% elif page == 'trade' %}
<div class="dual-panel-grid" style="grid-column:1/-1">
@@ -1989,9 +1992,15 @@ tickOrderHoldDurations();
setInterval(refreshPriceSnapshotConditional, {{ price_refresh_seconds * 1000 }});
</script>
<script src="/static/records_review_page.js?v=2"></script>
<script src="/static/instance_dashboard.js?v=1"></script>
<script>
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
{% if page == 'dashboard' %}
document.addEventListener("DOMContentLoaded", function () {
if (window.InstanceDashboard) InstanceDashboard.init(true);
});
{% endif %}
</script>
<script src="/static/instance_settings_prefs.js?v=13"></script>
<script src="/static/instance_settings_prefs.js?v=14"></script>
</body>
</html>