Add OKX hedge-plan P0: env group, preview page, and PnL scenario math.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-14 11:00:15 +08:00
parent d27ccbea8f
commit 1fa98425e7
18 changed files with 2232 additions and 1 deletions
@@ -15,6 +15,7 @@ DEFAULT_INSTANCE_DISPLAY: dict[str, bool] = {
"show_nav_risk_policy": True,
"show_nav_env_config": True,
"show_nav_options": True,
"show_nav_hedge_plan": True,
"show_settings_transfer": True,
"show_settings_export": True,
"show_settings_password": True,
@@ -30,6 +31,7 @@ DISPLAY_LABELS: dict[str, str] = {
"show_nav_risk_policy": "风控说明",
"show_nav_env_config": "env配置",
"show_nav_options": "期权",
"show_nav_hedge_plan": "对冲计划",
"show_settings_transfer": "资金划转",
"show_settings_export": "数据导出",
"show_settings_password": "账户密码修改",
@@ -45,6 +47,7 @@ NAV_TAB_ALLOWED: dict[str, str] = {
"risk_policy": "show_nav_risk_policy",
"env_config": "show_nav_env_config",
"options": "show_nav_options",
"hedge_plan": "show_nav_hedge_plan",
}
@@ -104,6 +107,7 @@ def display_meta_for_ui() -> list[dict[str, Any]]:
"show_nav_risk_policy",
"show_nav_env_config",
"show_nav_options",
"show_nav_hedge_plan",
]
settings_keys = [
"show_settings_transfer",
+2
View File
@@ -16,6 +16,7 @@ EMBED_TABS: tuple[str, ...] = (
"strategy",
"strategy_records",
"options",
"hedge_plan",
"records",
"stats",
"risk_policy",
@@ -32,6 +33,7 @@ PATH_TO_EMBED_TAB: dict[str, str] = {
"/strategy/roll": "strategy",
"/strategy/records": "strategy_records",
"/options": "options",
"/hedge-plan": "hedge_plan",
"/records": "records",
"/stats": "stats",
"/risk_policy": "risk_policy",
@@ -293,6 +293,8 @@
{% include 'strategy_records_page.html' %}
{% elif page == 'options' %}
{% include 'options_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}
+3
View File
@@ -46,6 +46,9 @@
{% if options_nav_visible and display.show_nav_options %}
<a href="/options" data-embed-tab="options" class="{% if initial_tab == 'options' %}active{% endif %}">期权</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" data-embed-tab="hedge_plan" class="{% if initial_tab == 'hedge_plan' %}active{% endif %}">对冲计划</a>
{% endif %}
{% if display.show_nav_risk_policy %}
<a href="/risk_policy" data-embed-tab="risk_policy" class="{% if initial_tab == 'risk_policy' %}active{% endif %}">风控说明</a>
{% endif %}
+6 -1
View File
@@ -133,6 +133,9 @@
{% if options_nav_visible and display.show_nav_options %}
<a href="/options" class="{% if page == 'options' %}active{% endif %}">期权</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" class="{% if page == 'hedge_plan' %}active{% endif %}">对冲计划</a>
{% endif %}
{% if display.show_nav_risk_policy %}
<a href="/risk_policy" class="{% if page == 'risk_policy' %}active{% endif %}">风控说明</a>
{% endif %}
@@ -144,7 +147,7 @@
{% with msg=get_flashed_messages() %}{% if msg %}<div class="flash">{{ msg[0] }}</div>{% endif %}{% endwith %}
{% include 'instance_header_panel.html' %}
{% if page not in ('settings', 'risk_policy', 'env_config', 'options') %}
{% if page not in ('settings', 'risk_policy', 'env_config', 'options', 'hedge_plan') %}
{% include 'instance_top_bar.html' %}
{% endif %}
@@ -361,6 +364,8 @@
{% include 'strategy_records_page.html' %}
{% elif page == 'options' %}
{% include 'options_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}