diff --git a/app.py b/app.py index fc60e3d..7bf0bb1 100644 --- a/app.py +++ b/app.py @@ -7062,7 +7062,7 @@ def index(): @login_required def key_monitor_page(): # CoinOX 去掉单独永续关键位开仓入口 - flash("CoinOX 不提供关键位自动开仓,请使用期权或对冲计划") + flash("本仓仅对冲,请使用对冲计划") return redirect("/hedge-plan") @@ -7070,51 +7070,41 @@ def key_monitor_page(): @login_required def trade_page(): # CoinOX 去掉单独永续下单入口 - flash("CoinOX 不提供单独永续下单,请使用期权或对冲计划") + flash("本仓仅对冲,请使用对冲计划") return redirect("/hedge-plan") @app.route("/records") @login_required def records_page(): - # CoinOX 已移除「交易记录与复盘」 - flash("CoinOX 不提供交易记录与复盘,请使用期权复盘或对冲计划") - return redirect("/hedge-plan") + flash("本仓仅对冲,请使用对冲复盘") + return redirect("/hedge-plan/review") @app.route("/stats") @login_required def stats_page(): - # CoinOX 已移除全站「统计分析」(对冲计划内统计仍保留) - flash("CoinOX 不提供全站统计分析,请在对冲计划内查看") + flash("本仓不提供全站统计分析,请在对冲计划内查看") return redirect("/hedge-plan") @app.route("/dashboard") @login_required def dashboard_page(): - redir = redirect_to_embed_shell_if_enabled("dashboard") - if redir is not None: - return redir - return render_main_page("dashboard") + return redirect("/hedge-plan") @app.route("/risk_policy") @login_required def risk_policy_page(): - redir = redirect_to_embed_shell_if_enabled("risk_policy") - if redir is not None: - return redir - return render_main_page("risk_policy") + # 本仓已去掉风控说明产品面 + return redirect("/hedge-plan") @app.route("/system_guide") @login_required def system_guide_page(): - redir = redirect_to_embed_shell_if_enabled("system_guide") - if redir is not None: - return redir - return render_main_page("system_guide") + return redirect("/hedge-plan") @app.route("/env_config") diff --git a/lib/common/static/instance_embed.js b/lib/common/static/instance_embed.js index 705a364..56e596b 100644 --- a/lib/common/static/instance_embed.js +++ b/lib/common/static/instance_embed.js @@ -44,7 +44,7 @@ const t = new URLSearchParams(location.search).get("tab"); if (t) return t; } catch (_) {} - return document.body.getAttribute("data-page") || "trade"; + return document.body.getAttribute("data-page") || "hedge_plan"; } function listWindowQueryString() { @@ -401,7 +401,7 @@ const options = opts || {}; if (!tab) return; if (!pageNavAllowed(tab)) { - void loadTab("trade", { replace: true }); + void loadTab("hedge_plan", { replace: true }); return; } @@ -564,7 +564,7 @@ initBootPane(); const bootTab = getTab(); if (!pageNavAllowed(bootTab)) { - void loadTab("trade", { replace: true }); + void loadTab("hedge_plan", { replace: true }); return; } if (bootTab === "settings") { diff --git a/lib/common/static/instance_mobile_nav.js b/lib/common/static/instance_mobile_nav.js index 4402a89..df59282 100644 --- a/lib/common/static/instance_mobile_nav.js +++ b/lib/common/static/instance_mobile_nav.js @@ -2,7 +2,7 @@ * 实例手机壳: ≤720px 底栏 +「更多」,与 embed soft-nav 同步. */ (function (global) { - const PRIMARY = { trade: 1, key_monitor: 1, options: 1 }; + const PRIMARY = { hedge_plan: 1, options: 1 }; const MQ = "(max-width: 720px)"; function isEmbedShell() { @@ -26,7 +26,7 @@ const t = new URLSearchParams(location.search).get("tab"); if (t) return t; } catch (_) {} - return (document.body && document.body.getAttribute("data-page")) || "trade"; + return (document.body && document.body.getAttribute("data-page")) || "hedge_plan"; } function closeMore() { @@ -106,7 +106,7 @@ env_config: "/env_config", settings: "/settings", }; - location.href = pathMap[tab] || "/trade"; + location.href = pathMap[tab] || "/hedge-plan"; } function bindChrome() { diff --git a/lib/env/env_ui_manifest.py b/lib/env/env_ui_manifest.py index b9c9430..be8d532 100644 --- a/lib/env/env_ui_manifest.py +++ b/lib/env/env_ui_manifest.py @@ -501,8 +501,14 @@ def ui_sections_for_exchange( if not m: m = _okx_mode_for_env_ui() sections.append(_MODE_SECTION) - # 单独期权模式才展示「期权账户」;对冲模式相关项已并入下方对冲分区 - if m == "options": + # 本仓默认无「期权账户」;仅紧急打开 STANDALONE_OPTIONS_UI 且单独期权模式才展示 + try: + from lib.hedge_plan.okx_trade_mode_lib import standalone_options_ui_enabled + + _show_opt_acct = standalone_options_ui_enabled() and m == "options" + except Exception: + _show_opt_acct = False + if _show_opt_acct: sections.append({"title": "期权账户", "fields": _options_fields_for_mode(m)}) hedge_fields = _hedge_fields_for_mode(m) if hedge_fields: diff --git a/lib/instance/instance_display_prefs_lib.py b/lib/instance/instance_display_prefs_lib.py index 8eba6f2..355b01d 100644 --- a/lib/instance/instance_display_prefs_lib.py +++ b/lib/instance/instance_display_prefs_lib.py @@ -20,7 +20,7 @@ DEFAULT_INSTANCE_DISPLAY: dict[str, bool] = { "show_nav_risk_policy": False, # 本仓对冲不需要风控说明页 "show_nav_system_guide": False, "show_nav_env_config": True, - "show_nav_options": True, + "show_nav_options": False, # 本仓不装单独期权页 "show_nav_options_review": True, "show_nav_hedge_plan": True, "show_settings_transfer": False, # CoinOX 不需要永续自动划转 @@ -87,6 +87,7 @@ def normalize_display_prefs(raw: dict | None) -> dict[str, bool]: out["show_nav_strategy_records"] = False out["show_nav_system_guide"] = False out["show_nav_risk_policy"] = False + out["show_nav_options"] = False out["show_settings_options_swap"] = False out["show_settings_transfer"] = False # 本仓不装单独期权 UI:系统设置不展示期权划转/兑换(避免缺模板/缺 API 500) @@ -133,10 +134,10 @@ def tab_allowed(tab: str, display: Optional[dict[str, bool]] = None) -> bool: def display_meta_for_ui() -> list[dict[str, Any]]: - # CoinOX 顶栏仅保留对冲相关入口 + # CoinOX 顶栏:对冲优先 nav_keys = [ - "show_nav_options_review", "show_nav_hedge_plan", + "show_nav_options_review", "show_nav_env_config", ] settings_keys = [ diff --git a/lib/instance/instance_embed_lib.py b/lib/instance/instance_embed_lib.py index 37f1842..9282e4c 100644 --- a/lib/instance/instance_embed_lib.py +++ b/lib/instance/instance_embed_lib.py @@ -29,7 +29,7 @@ EMBED_TABS: tuple[str, ...] = ( ) PATH_TO_EMBED_TAB: dict[str, str] = { - "/": "trade", + "/": "hedge_plan", "/trade": "trade", "/dashboard": "dashboard", "/account_ledger": "account_ledger", @@ -183,9 +183,9 @@ def register_embed_routes( @login_required @app.route("/embed") def embed_shell_page(): - tab = (request.args.get("tab") or "trade").strip() + tab = (request.args.get("tab") or "hedge_plan").strip() if tab not in EMBED_TABS: - tab = "trade" + tab = "hedge_plan" session["hub_embed_shell"] = True resp = make_response(render_main_page_fn(tab, embed_mode="shell")) resp.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0" diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index 9b6f1e2..e9dce51 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -31,21 +31,18 @@

okx对冲