{% with msg=get_flashed_messages() %}{% if msg %}
{{ msg[0] }}
{% endif %}{% endwith %}
{% include 'instance_header_panel.html' %}
{% if page not in ('settings', 'risk_policy', 'live_guide', 'system_guide', 'env_config', 'options', 'options_review', 'stats') %}
{% include 'instance_top_bar.html' %}
{% endif %}
{% if page == 'dashboard' %}
{% include 'dashboard_panel.html' %}
{% elif page == 'account_ledger' %}
{% include 'account_ledger_panel.html' %}
{% elif page == 'key_monitor' %}
{% include 'key_monitor_panel.html' %}
{% elif page == 'trade' %}
实时持仓
{% if ui_orphan_recovery_enabled %}
{% if not order and orphan_live_positions %}
{% set o = orphan_live_positions[0] %}
检测到交易所仍有 {{ o.symbol }} {{ '空' if o.direction == 'short' else '多' }}仓,但本地监控已中断(误同步时可能无交易记录).
{% if o.recoverable_monitor_id %}
{% else %}
未找到可恢复的监控记录,需在服务器数据库处理.
{% endif %}
{% else %}
{% endif %}
{% endif %}
{% elif page in ('strategy', 'strategy_trend', 'strategy_roll') %}
{% include 'strategy_trading_page.html' %}
{% elif page == 'strategy_records' %}
{% include 'strategy_records_page.html' %}
{% elif page == 'options' %}
{% include 'options_panel.html' %}
{% elif page == 'options_review' %}
{% include 'options_review_panel.html' %}
{% elif page == 'stats' %}
{% include 'options_data_stats_panel.html' %}
{% endif %}
{% if page == 'records' %}
{% include 'records_panel.html' %}
{% endif %}
{% if page == 'env_config' %}
{% include 'env_config_panel.html' %}
{% endif %}
{% if page == 'risk_policy' %}
{% include 'risk_policy_panel.html' %}
{% endif %}
{% if page == 'system_guide' %}
{% include 'system_guide_panel.html' %}
{% endif %}
{% if page == 'live_guide' %}
{% include 'live_guide_panel.html' %}
{% endif %}
{% if page == 'settings' %}
{% include 'settings_panel.html' %}
{% endif %}