Add settings toggles for plan, archive, and AI coach nav items.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -790,6 +790,9 @@ class SettingsDisplayBody(BaseModel):
|
|||||||
show_account_pnl: bool = True
|
show_account_pnl: bool = True
|
||||||
show_nav_funds: bool = True
|
show_nav_funds: bool = True
|
||||||
show_nav_dashboard: bool = True
|
show_nav_dashboard: bool = True
|
||||||
|
show_nav_plan: bool = True
|
||||||
|
show_nav_archive: bool = True
|
||||||
|
show_nav_ai: bool = True
|
||||||
|
|
||||||
|
|
||||||
class SettingsBody(BaseModel):
|
class SettingsBody(BaseModel):
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ DEFAULT_DISPLAY = {
|
|||||||
"show_account_pnl": True,
|
"show_account_pnl": True,
|
||||||
"show_nav_funds": True,
|
"show_nav_funds": True,
|
||||||
"show_nav_dashboard": True,
|
"show_nav_dashboard": True,
|
||||||
|
"show_nav_plan": True,
|
||||||
|
"show_nav_archive": True,
|
||||||
|
"show_nav_ai": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_EXCHANGES = [
|
DEFAULT_EXCHANGES = [
|
||||||
|
|||||||
@@ -21,17 +21,38 @@
|
|||||||
return displayPref("show_nav_dashboard", true);
|
return displayPref("show_nav_dashboard", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showNavPlanPref() {
|
||||||
|
return displayPref("show_nav_plan", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNavArchivePref() {
|
||||||
|
return displayPref("show_nav_archive", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNavAiPref() {
|
||||||
|
return displayPref("show_nav_ai", true);
|
||||||
|
}
|
||||||
|
|
||||||
function syncNavVisibility(data) {
|
function syncNavVisibility(data) {
|
||||||
const d = (data && data.display) || {};
|
const d = (data && data.display) || {};
|
||||||
const navFunds = document.getElementById("nav-funds");
|
const navFunds = document.getElementById("nav-funds");
|
||||||
const navDash = document.getElementById("nav-dashboard");
|
const navDash = document.getElementById("nav-dashboard");
|
||||||
|
const navPlan = document.getElementById("nav-plan");
|
||||||
|
const navArchive = document.getElementById("nav-archive");
|
||||||
|
const navAi = document.getElementById("nav-ai");
|
||||||
if (navFunds) navFunds.classList.toggle("nav-hidden", d.show_nav_funds === false);
|
if (navFunds) navFunds.classList.toggle("nav-hidden", d.show_nav_funds === false);
|
||||||
if (navDash) navDash.classList.toggle("nav-hidden", d.show_nav_dashboard === false);
|
if (navDash) navDash.classList.toggle("nav-hidden", d.show_nav_dashboard === false);
|
||||||
|
if (navPlan) navPlan.classList.toggle("nav-hidden", d.show_nav_plan === false);
|
||||||
|
if (navArchive) navArchive.classList.toggle("nav-hidden", d.show_nav_archive === false);
|
||||||
|
if (navAi) navAi.classList.toggle("nav-hidden", d.show_nav_ai === false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pageNavAllowed(page) {
|
function pageNavAllowed(page) {
|
||||||
if (page === "funds") return showNavFundsPref();
|
if (page === "funds") return showNavFundsPref();
|
||||||
if (page === "dashboard") return showNavDashboardPref();
|
if (page === "dashboard") return showNavDashboardPref();
|
||||||
|
if (page === "plan") return showNavPlanPref();
|
||||||
|
if (page === "archive") return showNavArchivePref();
|
||||||
|
if (page === "ai") return showNavAiPref();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +61,15 @@
|
|||||||
const pnlCb = document.getElementById("pref-show-account-pnl");
|
const pnlCb = document.getElementById("pref-show-account-pnl");
|
||||||
const fundsCb = document.getElementById("pref-show-nav-funds");
|
const fundsCb = document.getElementById("pref-show-nav-funds");
|
||||||
const dashCb = document.getElementById("pref-show-nav-dashboard");
|
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 aiCb = document.getElementById("pref-show-nav-ai");
|
||||||
if (pnlCb) pnlCb.checked = d.show_account_pnl !== false;
|
if (pnlCb) pnlCb.checked = d.show_account_pnl !== false;
|
||||||
if (fundsCb) fundsCb.checked = d.show_nav_funds !== false;
|
if (fundsCb) fundsCb.checked = d.show_nav_funds !== false;
|
||||||
if (dashCb) dashCb.checked = d.show_nav_dashboard !== 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 (aiCb) aiCb.checked = d.show_nav_ai !== false;
|
||||||
syncNavVisibility(data);
|
syncNavVisibility(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3740,12 +3767,18 @@
|
|||||||
const pnlCb = document.getElementById("pref-show-account-pnl");
|
const pnlCb = document.getElementById("pref-show-account-pnl");
|
||||||
const fundsCb = document.getElementById("pref-show-nav-funds");
|
const fundsCb = document.getElementById("pref-show-nav-funds");
|
||||||
const dashCb = document.getElementById("pref-show-nav-dashboard");
|
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 aiCb = document.getElementById("pref-show-nav-ai");
|
||||||
return {
|
return {
|
||||||
version: 1,
|
version: 1,
|
||||||
display: {
|
display: {
|
||||||
show_account_pnl: pnlCb ? !!pnlCb.checked : true,
|
show_account_pnl: pnlCb ? !!pnlCb.checked : true,
|
||||||
show_nav_funds: fundsCb ? !!fundsCb.checked : true,
|
show_nav_funds: fundsCb ? !!fundsCb.checked : true,
|
||||||
show_nav_dashboard: dashCb ? !!dashCb.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_ai: aiCb ? !!aiCb.checked : true,
|
||||||
},
|
},
|
||||||
exchanges: rows.map((card) => {
|
exchanges: rows.map((card) => {
|
||||||
const caps = [];
|
const caps = [];
|
||||||
|
|||||||
@@ -723,7 +723,19 @@
|
|||||||
<input type="checkbox" id="pref-show-nav-dashboard" checked />
|
<input type="checkbox" id="pref-show-nav-dashboard" checked />
|
||||||
顶栏显示「数据看板」
|
顶栏显示「数据看板」
|
||||||
</label>
|
</label>
|
||||||
<p class="settings-display-hint">保存至 hub_settings.json,换浏览器同样生效。关闭导航后对应页面将不可从顶栏进入。</p>
|
<label class="chk-label settings-display-chk">
|
||||||
|
<input type="checkbox" id="pref-show-nav-plan" checked />
|
||||||
|
顶栏显示「开仓计划」
|
||||||
|
</label>
|
||||||
|
<label class="chk-label settings-display-chk">
|
||||||
|
<input type="checkbox" id="pref-show-nav-archive" checked />
|
||||||
|
顶栏显示「内照明心」
|
||||||
|
</label>
|
||||||
|
<label class="chk-label settings-display-chk">
|
||||||
|
<input type="checkbox" id="pref-show-nav-ai" checked />
|
||||||
|
顶栏显示「AI 教练」
|
||||||
|
</label>
|
||||||
|
<p class="settings-display-hint">保存至 hub_settings.json,换浏览器同样生效。关闭导航后对应页面将不可从顶栏进入,直接访问 URL 会跳回监控区。</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-macro-panel card">
|
<div class="settings-macro-panel card">
|
||||||
<h3 class="settings-display-title">宏观关键数据(风控前置)</h3>
|
<h3 class="settings-display-title">宏观关键数据(风控前置)</h3>
|
||||||
@@ -816,6 +828,6 @@
|
|||||||
<script src="/assets/dashboard.js?v=20260612-dash-monitor-count"></script>
|
<script src="/assets/dashboard.js?v=20260612-dash-monitor-count"></script>
|
||||||
<script src="/assets/ai_review_render.js?v=3"></script>
|
<script src="/assets/ai_review_render.js?v=3"></script>
|
||||||
<script src="/assets/time_close_ui.js?v=2"></script>
|
<script src="/assets/time_close_ui.js?v=2"></script>
|
||||||
<script src="/assets/app.js?v=20260614-open-instance-responsive"></script>
|
<script src="/assets/app.js?v=20260614-nav-feature-toggles"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user