从导航显示与顶栏去掉「对冲计划」开关与入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-09-30 23:28:01 +08:00
parent 0acba5e351
commit 56df9a596f
7 changed files with 20 additions and 30 deletions
+6 -4
View File
@@ -46,8 +46,6 @@
options: "show_nav_options",
"options-review": "show_nav_options_review",
options_review: "show_nav_options_review",
"hedge-plan": "show_nav_hedge_plan",
hedge_plan: "show_nav_hedge_plan",
risk_policy: "show_nav_risk_policy",
system_guide: "show_nav_system_guide",
env_config: "show_nav_env_config",
@@ -59,6 +57,11 @@
.forEach((a) => {
const tab = a.getAttribute("data-embed-tab") || (a.getAttribute("href") || "").replace(/^\//, "").split("?")[0];
if (tab === "more") return;
if (tab === "hedge_plan" || tab === "hedge-plan") {
a.classList.add("nav-hidden");
a.style.display = "none";
return;
}
const key = map[tab];
if (!key) return;
const show = navPrefShow(display, key);
@@ -70,6 +73,7 @@
function pageNavAllowed(tab) {
const d = DISPLAY();
if (tab === "hedge_plan" || tab === "hedge-plan") return false;
const map = {
dashboard: "show_nav_dashboard",
account_ledger: "show_nav_account_ledger",
@@ -82,8 +86,6 @@
options: "show_nav_options",
"options-review": "show_nav_options_review",
options_review: "show_nav_options_review",
"hedge-plan": "show_nav_hedge_plan",
hedge_plan: "show_nav_hedge_plan",
risk_policy: "show_nav_risk_policy",
system_guide: "show_nav_system_guide",
env_config: "show_nav_env_config",
+2 -6
View File
@@ -21,7 +21,6 @@ DEFAULT_INSTANCE_DISPLAY: dict[str, bool] = {
"show_nav_env_config": True,
"show_nav_options": True,
"show_nav_options_review": True,
"show_nav_hedge_plan": False,
"show_settings_transfer": False, # 永续资金划转默认隐藏
"show_settings_export": True,
"show_settings_password": True,
@@ -43,7 +42,6 @@ DISPLAY_LABELS: dict[str, str] = {
"show_nav_env_config": "env配置",
"show_nav_options": "期权",
"show_nav_options_review": "期权复盘",
"show_nav_hedge_plan": "对冲计划",
"show_settings_transfer": "永续资金划转",
"show_settings_export": "数据导出",
"show_settings_password": "账户密码修改",
@@ -65,7 +63,6 @@ NAV_TAB_ALLOWED: dict[str, str] = {
"env_config": "show_nav_env_config",
"options": "show_nav_options",
"options_review": "show_nav_options_review",
"hedge_plan": "show_nav_hedge_plan",
}
@@ -111,8 +108,8 @@ def display_prefs_template_context(get_db: Callable) -> dict[str, Any]:
def tab_allowed(tab: str, display: Optional[dict[str, bool]] = None) -> bool:
prefs = normalize_display_prefs(display or {})
t = (tab or "").strip()
if t in ("trade", "records", "stats"):
return False # 实盘下单 / 交易记录复盘 / 统计分析 已移除
if t in ("trade", "records", "stats", "hedge_plan"):
return False # 实盘下单 / 交易记录复盘 / 统计分析 / 对冲计划 已移除
key = NAV_TAB_ALLOWED.get(t)
if not key:
return True
@@ -129,7 +126,6 @@ def display_meta_for_ui() -> list[dict[str, Any]]:
"show_nav_env_config",
"show_nav_options",
"show_nav_options_review",
"show_nav_hedge_plan",
]
settings_keys = [
"show_settings_transfer",
+1 -2
View File
@@ -16,7 +16,6 @@ EMBED_TABS: tuple[str, ...] = (
"key_monitor",
"options",
"options_review",
"hedge_plan",
"risk_policy",
"system_guide",
"env_config",
@@ -33,7 +32,7 @@ PATH_TO_EMBED_TAB: dict[str, str] = {
"/key_monitor": "key_monitor",
"/options": "options",
"/options/review": "options_review",
"/hedge-plan": "hedge_plan",
"/hedge-plan": "options", # 对冲计划已移除,旧链接落到期权
"/risk_policy": "risk_policy",
"/system_guide": "system_guide",
"/env_config": "env_config",
@@ -127,8 +127,6 @@
{% include 'options_panel.html' %}
{% elif page == 'options_review' %}
{% include 'options_review_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}
+1 -10
View File
@@ -35,7 +35,7 @@
>
<div class="container">
<div class="header">
<h1>加密货币|OKX 期权与对冲</h1>
<h1>加密货币|OKX 期权</h1>
</div>
<nav class="top-nav embed-top-nav" aria-label="实例导航">
<div class="top-nav-links">
@@ -48,9 +48,6 @@
{% if options_nav_visible and display.show_nav_options_review %}
<a href="/options/review" data-embed-tab="options_review" class="{% if initial_tab == 'options_review' %}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 %}
@@ -97,9 +94,6 @@
{% if options_nav_visible and display.show_nav_options %}
<a href="/options" class="inst-m-tab{% if initial_tab == 'options' %} active{% endif %}" data-embed-tab="options">期权</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" class="inst-m-tab{% if initial_tab == 'hedge_plan' %} active{% endif %}" data-embed-tab="hedge_plan">对冲</a>
{% endif %}
<a href="/key_monitor" class="inst-m-tab{% if initial_tab == 'key_monitor' %} active{% endif %}" data-embed-tab="key_monitor"{% if not display.show_nav_key_monitor %} style="display:none"{% endif %}>关键位</a>
<button type="button" class="inst-m-tab" data-embed-tab="more" id="inst-m-tab-more" aria-haspopup="dialog" aria-expanded="false">更多</button>
</nav>
@@ -115,9 +109,6 @@
{% if options_nav_visible and display.show_nav_options_review %}
<a href="/options/review" data-embed-tab="options_review">期权复盘</a>
{% endif %}
{% if hedge_plan_nav_visible and display.show_nav_hedge_plan %}
<a href="/hedge-plan" data-embed-tab="hedge_plan">对冲计划</a>
{% endif %}
{% if display.show_nav_risk_policy %}
<a href="/risk_policy" data-embed-tab="risk_policy">风控说明</a>
{% endif %}
+1 -6
View File
@@ -176,9 +176,6 @@
{% if options_nav_visible and display.show_nav_options_review %}
<a href="/options/review" class="{% if page == 'options_review' %}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 %}
@@ -191,7 +188,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', 'system_guide', 'env_config', 'options', 'options_review', 'hedge_plan') %}
{% if page not in ('settings', 'risk_policy', 'system_guide', 'env_config', 'options', 'options_review') %}
{% include 'instance_top_bar.html' %}
{% endif %}
@@ -365,8 +362,6 @@
{% include 'options_panel.html' %}
{% elif page == 'options_review' %}
{% include 'options_review_panel.html' %}
{% elif page == 'hedge_plan' %}
{% include 'hedge_plan_panel.html' %}
{% endif %}