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:
@@ -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 };
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user