diff --git a/manual_trading_hub/hub.py b/manual_trading_hub/hub.py index 4db9565..1bf4492 100644 --- a/manual_trading_hub/hub.py +++ b/manual_trading_hub/hub.py @@ -1101,14 +1101,14 @@ class SettingsDisplayBody(BaseModel): show_account_pnl: bool = True show_nav_funds: bool = True show_nav_dashboard: bool = True - show_nav_plan: bool = True - show_nav_archive: bool = True - show_nav_quotes: bool = True + show_nav_plan: bool = False + show_nav_archive: bool = False + show_nav_quotes: bool = False show_nav_ai: bool = True show_nav_calculator: bool = True - show_nav_strategy: bool = True - show_nav_help: bool = True - show_nav_logs: bool = True + show_nav_strategy: bool = False + show_nav_help: bool = False + show_nav_logs: bool = False class SupervisorSettingsBody(BaseModel): diff --git a/manual_trading_hub/settings_store.py b/manual_trading_hub/settings_store.py index df57760..e2e3ede 100644 --- a/manual_trading_hub/settings_store.py +++ b/manual_trading_hub/settings_store.py @@ -24,16 +24,26 @@ DEFAULT_DISPLAY = { "show_account_pnl": True, "show_nav_funds": True, "show_nav_dashboard": True, - "show_nav_plan": True, - "show_nav_archive": True, - "show_nav_quotes": True, + "show_nav_plan": False, + "show_nav_archive": False, + "show_nav_quotes": False, "show_nav_ai": True, "show_nav_calculator": True, - "show_nav_strategy": True, - "show_nav_help": True, - "show_nav_logs": True, + "show_nav_strategy": False, + "show_nav_help": False, + "show_nav_logs": False, } +# 用户版中控已下线的顶栏入口:读/写设置时强制关闭 +REMOVED_NAV_DISPLAY_KEYS = ( + "show_nav_plan", + "show_nav_archive", + "show_nav_quotes", + "show_nav_strategy", + "show_nav_help", + "show_nav_logs", +) + DEFAULT_EXCHANGES = [ { "id": "0", @@ -86,6 +96,8 @@ def normalize_display_prefs(raw: dict | None) -> dict: for key in DEFAULT_DISPLAY: if key in raw: out[key] = bool(raw.get(key)) + for key in REMOVED_NAV_DISPLAY_KEYS: + out[key] = False return out diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index 5d475f4..c765062 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -21,18 +21,6 @@ return displayPref("show_nav_dashboard", true); } - function showNavPlanPref() { - return displayPref("show_nav_plan", true); - } - - function showNavArchivePref() { - return displayPref("show_nav_archive", true); - } - - function showNavQuotesPref() { - return displayPref("show_nav_quotes", true); - } - function showNavAiPref() { return displayPref("show_nav_ai", true); } @@ -41,31 +29,13 @@ return displayPref("show_nav_calculator", true); } - function showNavStrategyPref() { - return displayPref("show_nav_strategy", true); - } - - function showNavHelpPref() { - return displayPref("show_nav_help", true); - } - - function showNavLogsPref() { - return displayPref("show_nav_logs", true); - } - function syncNavVisibility(data) { const d = (data && data.display) || {}; const pairs = [ ["nav-funds", "m-nav-funds", d.show_nav_funds === false], ["nav-dashboard", "m-nav-dashboard", d.show_nav_dashboard === false], - ["nav-plan", "m-nav-plan", d.show_nav_plan === false], - ["nav-archive", "m-nav-archive", d.show_nav_archive === false], - ["nav-quotes", "m-nav-quotes", d.show_nav_quotes === false], ["nav-ai", "m-tab-ai", d.show_nav_ai === false], ["nav-calculator", "m-tab-calculator", d.show_nav_calculator === false], - ["nav-strategy", "m-nav-strategy", d.show_nav_strategy === false], - ["nav-help", "m-nav-help", d.show_nav_help === false], - ["nav-logs", "m-nav-logs", d.show_nav_logs === false], ]; pairs.forEach(([desktopId, mobileId, hide]) => { const a = document.getElementById(desktopId); @@ -130,14 +100,18 @@ function pageNavAllowed(page) { if (page === "funds") return showNavFundsPref(); if (page === "dashboard") return showNavDashboardPref(); - if (page === "plan") return showNavPlanPref(); - if (page === "archive") return showNavArchivePref(); - if (page === "quotes") return showNavQuotesPref(); + if ( + page === "plan" || + page === "archive" || + page === "quotes" || + page === "strategy" || + page === "help" || + page === "logs" + ) { + return false; + } if (page === "ai") return showNavAiPref(); if (page === "calculator") return showNavCalculatorPref(); - if (page === "strategy") return showNavStrategyPref(); - if (page === "help") return showNavHelpPref(); - if (page === "logs") return showNavLogsPref(); return true; } @@ -146,25 +120,13 @@ const pnlCb = document.getElementById("pref-show-account-pnl"); const fundsCb = document.getElementById("pref-show-nav-funds"); const dashCb = document.getElementById("pref-show-nav-dashboard"); - const planCb = document.getElementById("pref-show-nav-plan"); - const archiveCb = document.getElementById("pref-show-nav-archive"); - const quotesCb = document.getElementById("pref-show-nav-quotes"); const aiCb = document.getElementById("pref-show-nav-ai"); const calcCb = document.getElementById("pref-show-nav-calculator"); - const strategyCb = document.getElementById("pref-show-nav-strategy"); - const helpCb = document.getElementById("pref-show-nav-help"); - const logsCb = document.getElementById("pref-show-nav-logs"); if (pnlCb) pnlCb.checked = d.show_account_pnl !== false; if (fundsCb) fundsCb.checked = d.show_nav_funds !== false; if (dashCb) dashCb.checked = d.show_nav_dashboard !== false; - if (planCb) planCb.checked = d.show_nav_plan !== false; - if (archiveCb) archiveCb.checked = d.show_nav_archive !== false; - if (quotesCb) quotesCb.checked = d.show_nav_quotes !== false; if (aiCb) aiCb.checked = d.show_nav_ai !== false; if (calcCb) calcCb.checked = d.show_nav_calculator !== false; - if (strategyCb) strategyCb.checked = d.show_nav_strategy !== false; - if (helpCb) helpCb.checked = d.show_nav_help !== false; - if (logsCb) logsCb.checked = d.show_nav_logs !== false; syncNavVisibility(data); } @@ -5034,14 +4996,8 @@ const pnlCb = document.getElementById("pref-show-account-pnl"); const fundsCb = document.getElementById("pref-show-nav-funds"); const dashCb = document.getElementById("pref-show-nav-dashboard"); - const planCb = document.getElementById("pref-show-nav-plan"); - const archiveCb = document.getElementById("pref-show-nav-archive"); - const quotesCb = document.getElementById("pref-show-nav-quotes"); const aiCb = document.getElementById("pref-show-nav-ai"); const calcCb = document.getElementById("pref-show-nav-calculator"); - const strategyCb = document.getElementById("pref-show-nav-strategy"); - const helpCb = document.getElementById("pref-show-nav-help"); - const logsCb = document.getElementById("pref-show-nav-logs"); const supEnabled = document.getElementById("supervisor-enabled"); const supProg = document.getElementById("supervisor-wechat-program"); const supWebhook = document.getElementById("supervisor-wechat-webhook"); @@ -5057,14 +5013,14 @@ show_account_pnl: pnlCb ? !!pnlCb.checked : true, show_nav_funds: fundsCb ? !!fundsCb.checked : true, show_nav_dashboard: dashCb ? !!dashCb.checked : true, - show_nav_plan: planCb ? !!planCb.checked : true, - show_nav_archive: archiveCb ? !!archiveCb.checked : true, - show_nav_quotes: quotesCb ? !!quotesCb.checked : true, + show_nav_plan: false, + show_nav_archive: false, + show_nav_quotes: false, show_nav_ai: aiCb ? !!aiCb.checked : true, show_nav_calculator: calcCb ? !!calcCb.checked : true, - show_nav_strategy: strategyCb ? !!strategyCb.checked : true, - show_nav_help: helpCb ? !!helpCb.checked : true, - show_nav_logs: logsCb ? !!logsCb.checked : true, + show_nav_strategy: false, + show_nav_help: false, + show_nav_logs: false, }, supervisor: { enabled: supEnabled ? !!supEnabled.checked : true, diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index 4da8fd3..38e1e2d 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -49,17 +49,11 @@ SYNC @@ -1094,18 +1088,6 @@ 顶栏显示「数据看板」 - - - - - -

保存至 hub_settings.json,换浏览器同样生效.关闭导航后对应页面将不可从顶栏进入,直接访问 URL 会跳回监控区.

@@ -1307,13 +1277,7 @@

次要功能 · 完整界面请用电脑/平板

@@ -1382,6 +1346,6 @@ - +