Add display toggles to hide monitor cards and strategy tabs.

Keep unused exchanges/docs out of the UI without disabling accounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-24 00:24:00 +08:00
parent 29d59d6a53
commit 6f1ae14b3d
7 changed files with 367 additions and 200 deletions
+20 -2
View File
@@ -74,6 +74,14 @@
function renderExchangeTabs() {
if (!tabsEl) return;
if (!tabsMeta.length) {
tabsEl.innerHTML = "";
if (statusEl) statusEl.textContent = "当前无可显示的策略页签(可在系统设置·显示与导航中开启)";
if (docBody) docBody.innerHTML = "";
if (docToc) docToc.innerHTML = "";
if (checklistBody) checklistBody.innerHTML = "";
return;
}
tabsEl.innerHTML = tabsMeta
.map(
(t) =>
@@ -274,6 +282,15 @@
renderExchangeTabs();
}
async function reloadMeta() {
try {
await loadMeta();
if (tabsMeta.length) await loadExchange(activeKey);
} catch (e) {
if (statusEl) statusEl.textContent = String(e);
}
}
async function printSection(mode) {
const part = mode === "checklist" ? "checklist" : "doc";
const url = `/api/strategy/${encodeURIComponent(activeKey)}/print?part=${encodeURIComponent(part)}`;
@@ -334,7 +351,8 @@
setView(activeView);
try {
await loadMeta();
await loadExchange(activeKey);
if (tabsMeta.length) await loadExchange(activeKey);
else if (statusEl) statusEl.textContent = "当前无可显示的策略页签(可在系统设置·显示与导航中开启)";
} catch (e) {
if (statusEl) statusEl.textContent = String(e);
}
@@ -347,5 +365,5 @@
}
}
window.hubStrategyPage = { init, destroy };
window.hubStrategyPage = { init, destroy, reloadMeta };
})();