Add hub system logs page with PM2 stdout/stderr tabs for all exchanges.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-09 10:33:14 +08:00
parent 9eb10ba771
commit 5214794f95
8 changed files with 479 additions and 2 deletions
+20 -2
View File
@@ -41,6 +41,10 @@
return displayPref("show_nav_strategy", true);
}
function showNavLogsPref() {
return displayPref("show_nav_logs", true);
}
function syncNavVisibility(data) {
const d = (data && data.display) || {};
const navFunds = document.getElementById("nav-funds");
@@ -50,6 +54,7 @@
const navAi = document.getElementById("nav-ai");
const navCalc = document.getElementById("nav-calculator");
const navStrategy = document.getElementById("nav-strategy");
const navLogs = document.getElementById("nav-logs");
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 (navPlan) navPlan.classList.toggle("nav-hidden", d.show_nav_plan === false);
@@ -57,6 +62,7 @@
if (navAi) navAi.classList.toggle("nav-hidden", d.show_nav_ai === false);
if (navCalc) navCalc.classList.toggle("nav-hidden", d.show_nav_calculator === false);
if (navStrategy) navStrategy.classList.toggle("nav-hidden", d.show_nav_strategy === false);
if (navLogs) navLogs.classList.toggle("nav-hidden", d.show_nav_logs === false);
}
function pageNavAllowed(page) {
@@ -67,6 +73,7 @@
if (page === "ai") return showNavAiPref();
if (page === "calculator") return showNavCalculatorPref();
if (page === "strategy") return showNavStrategyPref();
if (page === "logs") return showNavLogsPref();
return true;
}
@@ -80,6 +87,7 @@
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 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;
@@ -88,6 +96,7 @@
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 (logsCb) logsCb.checked = d.show_nav_logs !== false;
syncNavVisibility(data);
}
@@ -1200,6 +1209,7 @@
if (p.includes("plan")) return "plan";
if (p.includes("calculator")) return "calculator";
if (p.includes("strategy")) return "strategy";
if (p.includes("logs")) return "logs";
if (p.includes("market")) return "market";
if (p.includes("/ai")) return "ai";
return "monitor";
@@ -1213,6 +1223,7 @@
if (page === "plan") return "page-plan";
if (page === "calculator") return "page-calculator";
if (page === "strategy") return "page-strategy";
if (page === "logs") return "page-logs";
if (page === "market") return "page-market";
if (page === "ai") return "page-ai";
return "page-monitor";
@@ -1264,13 +1275,18 @@
}
if (page === "funds" && window.hubFundsPage) {
window.hubFundsPage.init();
} else if (window.hubFundsPage && window.hubFundsPage.destroy) {
window.hubFundsPage.destroy();
}
if (page === "strategy" && window.hubStrategyPage) {
window.hubStrategyPage.init();
} else if (window.hubStrategyPage && window.hubStrategyPage.destroy) {
window.hubStrategyPage.destroy();
} else if (window.hubFundsPage && window.hubFundsPage.destroy) {
window.hubFundsPage.destroy();
}
if (page === "logs" && window.hubLogsPage) {
window.hubLogsPage.init();
} else if (window.hubLogsPage && window.hubLogsPage.destroy) {
window.hubLogsPage.destroy();
}
if (page === "market" && window.hubMarketChart) {
window.hubMarketChart.init();
@@ -4667,6 +4683,7 @@
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 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");
@@ -4687,6 +4704,7 @@
show_nav_ai: aiCb ? !!aiCb.checked : true,
show_nav_calculator: calcCb ? !!calcCb.checked : true,
show_nav_strategy: strategyCb ? !!strategyCb.checked : true,
show_nav_logs: logsCb ? !!logsCb.checked : true,
},
supervisor: {
enabled: supEnabled ? !!supEnabled.checked : true,