diff --git a/manual_trading_hub/hub.py b/manual_trading_hub/hub.py index aa7526a..41edd54 100644 --- a/manual_trading_hub/hub.py +++ b/manual_trading_hub/hub.py @@ -980,6 +980,7 @@ def root_redirect(): @app.get("/calculator") @app.get("/market") @app.get("/archive") +@app.get("/quotes") @app.get("/dashboard") @app.get("/funds") @app.get("/ai") @@ -1093,6 +1094,7 @@ class SettingsDisplayBody(BaseModel): show_nav_dashboard: bool = True show_nav_plan: bool = True show_nav_archive: bool = True + show_nav_quotes: bool = True show_nav_ai: bool = True show_nav_calculator: bool = True show_nav_strategy: bool = True diff --git a/manual_trading_hub/settings_store.py b/manual_trading_hub/settings_store.py index 270878f..df57760 100644 --- a/manual_trading_hub/settings_store.py +++ b/manual_trading_hub/settings_store.py @@ -26,6 +26,7 @@ DEFAULT_DISPLAY = { "show_nav_dashboard": True, "show_nav_plan": True, "show_nav_archive": True, + "show_nav_quotes": True, "show_nav_ai": True, "show_nav_calculator": True, "show_nav_strategy": True, diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index baa0826..8630b61 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -8087,6 +8087,95 @@ body.funds-fullscreen-open { flex-direction: column; gap: 8px; } + +/* —— 语录博客流 —— */ +#page-quotes .quotes-toolbar { + margin-bottom: 14px; + gap: 10px; + align-items: center; +} +#page-quotes .quotes-link-archive { + text-decoration: none; + padding: 6px 12px; + border-radius: 8px; + border: 1px solid var(--border-soft); +} +.quotes-feed { + display: flex; + flex-direction: column; + gap: 18px; + max-width: 820px; +} +.quotes-empty { + margin: 0; + color: var(--muted); + font-size: 0.88rem; +} +.quotes-day-group { + display: flex; + flex-direction: column; + gap: 10px; +} +.quotes-day-head { + display: flex; + flex-wrap: wrap; + align-items: baseline; + justify-content: space-between; + gap: 8px 14px; + padding-bottom: 6px; + border-bottom: 1px solid var(--border-soft); +} +.quotes-day-title { + margin: 0; + font-size: 1.05rem; + font-weight: 650; + letter-spacing: 0.02em; +} +.quotes-day-summary { + font-size: 0.8rem; + color: var(--muted); +} +.quotes-day-cards { + display: flex; + flex-direction: column; + gap: 10px; +} +.quotes-card { + background: var(--panel); + border: 1px solid var(--border-soft); + border-radius: var(--radius); + padding: 14px 16px; + display: flex; + flex-direction: column; + gap: 10px; +} +.quotes-card-body { + margin: 0; + font-size: 0.9rem; + line-height: 1.65; + color: var(--text); + white-space: pre-wrap; + word-break: break-word; +} +.quotes-card-actions { + display: flex; + flex-wrap: wrap; + gap: 8px; + align-items: center; +} +.quotes-ai-btn { + color: var(--accent); + border-color: color-mix(in srgb, var(--accent) 35%, var(--border-soft)); +} +@media (max-width: 720px) { + .quotes-feed { + max-width: none; + } + .quotes-day-head { + flex-direction: column; + align-items: flex-start; + } +} .archive-quote-block { display: flex; flex-direction: column; diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index ce87c16..5d475f4 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -29,6 +29,10 @@ return displayPref("show_nav_archive", true); } + function showNavQuotesPref() { + return displayPref("show_nav_quotes", true); + } + function showNavAiPref() { return displayPref("show_nav_ai", true); } @@ -56,6 +60,7 @@ ["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], @@ -127,6 +132,7 @@ if (page === "dashboard") return showNavDashboardPref(); if (page === "plan") return showNavPlanPref(); if (page === "archive") return showNavArchivePref(); + if (page === "quotes") return showNavQuotesPref(); if (page === "ai") return showNavAiPref(); if (page === "calculator") return showNavCalculatorPref(); if (page === "strategy") return showNavStrategyPref(); @@ -142,6 +148,7 @@ 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"); @@ -152,6 +159,7 @@ 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; @@ -1264,6 +1272,7 @@ const p = window.location.pathname.replace(/\/$/, "") || "/monitor"; if (p.includes("settings")) return "settings"; if (p.includes("archive")) return "archive"; + if (p.includes("quotes")) return "quotes"; if (p.includes("dashboard")) return "dashboard"; if (p.includes("funds")) return "funds"; if (p.includes("plan")) return "plan"; @@ -1279,6 +1288,7 @@ function pageElementId(page) { if (page === "settings") return "page-settings"; if (page === "archive") return "page-archive"; + if (page === "quotes") return "page-quotes"; if (page === "dashboard") return "page-dashboard"; if (page === "funds") return "page-funds"; if (page === "plan") return "page-plan"; @@ -1316,6 +1326,7 @@ document.body.classList.toggle("hub-page-calculator", page === "calculator"); document.body.classList.toggle("hub-page-settings", page === "settings"); document.body.classList.toggle("hub-page-archive", page === "archive"); + document.body.classList.toggle("hub-page-quotes", page === "quotes"); document.body.classList.toggle("hub-page-plan", page === "plan"); document.body.classList.toggle("hub-page-strategy", page === "strategy"); document.body.classList.toggle("hub-page-logs", page === "logs"); @@ -1339,6 +1350,11 @@ } else if (window.hubArchivePage && window.hubArchivePage.destroy) { window.hubArchivePage.destroy(); } + if (page === "quotes" && window.hubQuotesPage) { + window.hubQuotesPage.init(); + } else if (window.hubQuotesPage && window.hubQuotesPage.destroy) { + window.hubQuotesPage.destroy(); + } if (page === "plan" && window.hubPlanPage) { window.hubPlanPage.init(); } else if (window.hubPlanPage && window.hubPlanPage.destroy) { @@ -5020,6 +5036,7 @@ 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"); @@ -5042,6 +5059,7 @@ 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_ai: aiCb ? !!aiCb.checked : true, show_nav_calculator: calcCb ? !!calcCb.checked : true, show_nav_strategy: strategyCb ? !!strategyCb.checked : true, diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index 0872bfc..de7da2a 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -15,7 +15,7 @@ - + @@ -56,6 +56,7 @@ 行情区 计算器 内照明心 + 语录 数据看板 AI 教练 系统日志 @@ -567,6 +568,19 @@ +
+