feat: collapse fund overview help and bind start day to env
Fold the stats description by default and render history_start_day and keep_days from the API so HUB_FUND_HISTORY_START_DAY in .env drives the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -99,5 +99,6 @@ AI_MODEL=huihui_ai/deepseek-r1-abliterated:latest
|
|||||||
TRADING_DAY_RESET_HOUR=8
|
TRADING_DAY_RESET_HOUR=8
|
||||||
# 资金概况 / AI 上下文:分户资金快照保留交易日数(默认 180)
|
# 资金概况 / AI 上下文:分户资金快照保留交易日数(默认 180)
|
||||||
# HUB_FUND_HISTORY_DAYS=180
|
# HUB_FUND_HISTORY_DAYS=180
|
||||||
# 资金曲线与回撤统计起始交易日(默认 2026-06-09,该日之前不记、不展示)
|
# 资金概况:曲线与回撤统计起始交易日(页面说明与曲线均读取此项;该日之前不记、不展示)
|
||||||
# HUB_FUND_HISTORY_START_DAY=2026-06-09
|
# 修改后须重启 manual-trading-hub(pm2 restart manual-trading-hub)
|
||||||
|
HUB_FUND_HISTORY_START_DAY=2026-06-09
|
||||||
|
|||||||
@@ -4501,9 +4501,38 @@ html[data-theme="light"] .funds-stage {
|
|||||||
border-color: rgba(0, 212, 255, 0.45);
|
border-color: rgba(0, 212, 255, 0.45);
|
||||||
box-shadow: 0 0 18px rgba(0, 212, 255, 0.2);
|
box-shadow: 0 0 18px rgba(0, 212, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
.funds-desc-fold {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.funds-desc-toggle {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
color: var(--accent);
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none;
|
||||||
|
user-select: none;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
}
|
||||||
|
.funds-desc-toggle::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.funds-desc-toggle::before {
|
||||||
|
content: "▸";
|
||||||
|
font-size: 0.68rem;
|
||||||
|
transition: transform 0.15s ease;
|
||||||
|
}
|
||||||
|
.funds-desc-fold[open] .funds-desc-toggle::before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
.funds-desc {
|
.funds-desc {
|
||||||
|
margin: 8px 0 0;
|
||||||
color: color-mix(in srgb, var(--muted) 88%, var(--accent));
|
color: color-mix(in srgb, var(--muted) 88%, var(--accent));
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
|
line-height: 1.45;
|
||||||
|
font-size: 0.78rem;
|
||||||
}
|
}
|
||||||
.funds-live-pill {
|
.funds-live-pill {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
const elDdPct = document.getElementById("funds-total-dd-pct");
|
const elDdPct = document.getElementById("funds-total-dd-pct");
|
||||||
const elDelta = document.getElementById("funds-total-delta");
|
const elDelta = document.getElementById("funds-total-delta");
|
||||||
const elMeta = document.getElementById("funds-meta");
|
const elMeta = document.getElementById("funds-meta");
|
||||||
|
const elDescBody = document.getElementById("funds-desc-body");
|
||||||
|
const elChartSub = document.getElementById("funds-chart-sub");
|
||||||
const elChartHost = document.getElementById("funds-chart-total");
|
const elChartHost = document.getElementById("funds-chart-total");
|
||||||
const elAccounts = document.getElementById("funds-accounts");
|
const elAccounts = document.getElementById("funds-accounts");
|
||||||
const elBtnRefresh = document.getElementById("funds-btn-refresh");
|
const elBtnRefresh = document.getElementById("funds-btn-refresh");
|
||||||
@@ -266,7 +268,7 @@
|
|||||||
const parts = [
|
const parts = [
|
||||||
"资金户 + 交易户(不含浮盈)",
|
"资金户 + 交易户(不含浮盈)",
|
||||||
"交易日 " + (meta.trading_day || "—"),
|
"交易日 " + (meta.trading_day || "—"),
|
||||||
"自 " + (meta.history_start_day || "2026-06-09") + " 起",
|
"自 " + (meta.history_start_day || "—") + " 起",
|
||||||
];
|
];
|
||||||
elFsSub.textContent = parts.join(" · ");
|
elFsSub.textContent = parts.join(" · ");
|
||||||
}
|
}
|
||||||
@@ -319,8 +321,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderDesc(data) {
|
||||||
|
const start = (data && data.history_start_day) || "—";
|
||||||
|
const keep = (data && data.keep_days) || 180;
|
||||||
|
const hour = data && data.reset_hour != null ? data.reset_hour : 8;
|
||||||
|
if (elDescBody) {
|
||||||
|
elDescBody.textContent =
|
||||||
|
"总资金 = 各监控户(资金账户 + 交易账户);自 " +
|
||||||
|
start +
|
||||||
|
" 起按北京时间 " +
|
||||||
|
hour +
|
||||||
|
":00 交易日切日快照,最多保留 " +
|
||||||
|
keep +
|
||||||
|
" 天。起算日由环境变量 HUB_FUND_HISTORY_START_DAY 配置。";
|
||||||
|
}
|
||||||
|
if (elChartSub) {
|
||||||
|
elChartSub.textContent = keep + " TRADING DAYS";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function renderOverview(data) {
|
function renderOverview(data) {
|
||||||
lastOverview = data;
|
lastOverview = data;
|
||||||
|
renderDesc(data);
|
||||||
const totals = data.totals || {};
|
const totals = data.totals || {};
|
||||||
const dd = totals.drawdown || {};
|
const dd = totals.drawdown || {};
|
||||||
if (elTotal) {
|
if (elTotal) {
|
||||||
@@ -339,7 +361,7 @@
|
|||||||
const parts = [
|
const parts = [
|
||||||
"交易日 " + (data.trading_day || "—"),
|
"交易日 " + (data.trading_day || "—"),
|
||||||
"切日 " + (data.reset_hour != null ? data.reset_hour : 8) + ":00 北京",
|
"切日 " + (data.reset_hour != null ? data.reset_hour : 8) + ":00 北京",
|
||||||
"自 " + (data.history_start_day || "2026-06-09") + " 起",
|
"自 " + (data.history_start_day || "—") + " 起",
|
||||||
"最多 " + (data.keep_days || 180) + " 交易日",
|
"最多 " + (data.keep_days || 180) + " 交易日",
|
||||||
];
|
];
|
||||||
if (data.updated_at) parts.push("刷新 " + data.updated_at);
|
if (data.updated_at) parts.push("刷新 " + data.updated_at);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
||||||
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
|
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
|
||||||
<link rel="stylesheet" href="/assets/app.css?v=20260609-hub-funds-read" />
|
<link rel="stylesheet" href="/assets/app.css?v=20260609-hub-funds-fold" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app-bg" aria-hidden="true"></div>
|
<div class="app-bg" aria-hidden="true"></div>
|
||||||
@@ -339,7 +339,10 @@
|
|||||||
<div class="page-head funds-head">
|
<div class="page-head funds-head">
|
||||||
<div class="funds-head-main">
|
<div class="funds-head-main">
|
||||||
<h1><span class="head-tag funds-tag">CAP</span> 资金概况</h1>
|
<h1><span class="head-tag funds-tag">CAP</span> 资金概况</h1>
|
||||||
<p class="page-desc funds-desc">总资金 = 各监控户(资金账户 + 交易账户);自 2026-06-09 起按北京时间交易日切日快照,最多保留 180 天</p>
|
<details class="funds-desc-fold">
|
||||||
|
<summary class="funds-desc-toggle">统计说明</summary>
|
||||||
|
<p id="funds-desc-body" class="page-desc funds-desc">加载配置中…</p>
|
||||||
|
</details>
|
||||||
</div>
|
</div>
|
||||||
<div class="funds-live-pill" aria-hidden="true">
|
<div class="funds-live-pill" aria-hidden="true">
|
||||||
<span class="funds-live-dot"></span>
|
<span class="funds-live-dot"></span>
|
||||||
@@ -368,7 +371,7 @@
|
|||||||
<div class="funds-chart-panel">
|
<div class="funds-chart-panel">
|
||||||
<div class="funds-chart-head">
|
<div class="funds-chart-head">
|
||||||
<span class="funds-chart-tag">EQUITY CURVE</span>
|
<span class="funds-chart-tag">EQUITY CURVE</span>
|
||||||
<span class="funds-chart-sub">180 TRADING DAYS</span>
|
<span id="funds-chart-sub" class="funds-chart-sub">— TRADING DAYS</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="funds-chart-total" class="funds-chart-host"></div>
|
<div id="funds-chart-total" class="funds-chart-host"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -498,7 +501,7 @@
|
|||||||
<script src="/assets/chart_draw.js?v=20260609-market-day-split"></script>
|
<script src="/assets/chart_draw.js?v=20260609-market-day-split"></script>
|
||||||
<script src="/assets/chart.js?v=20260609-market-day-split"></script>
|
<script src="/assets/chart.js?v=20260609-market-day-split"></script>
|
||||||
<script src="/assets/archive.js?v=20260608-hub-archive-history"></script>
|
<script src="/assets/archive.js?v=20260608-hub-archive-history"></script>
|
||||||
<script src="/assets/funds.js?v=20260609-hub-funds-ai"></script>
|
<script src="/assets/funds.js?v=20260609-hub-funds-fold"></script>
|
||||||
<script src="/assets/ai_review_render.js?v=2"></script>
|
<script src="/assets/ai_review_render.js?v=2"></script>
|
||||||
<script src="/assets/app.js?v=20260609-hub-funds-ai"></script>
|
<script src="/assets/app.js?v=20260609-hub-funds-ai"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user