feat: add ops-map text summaries for leverage and move periods

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-02 09:43:56 +08:00
parent 74021dae08
commit f798c11cf9
5 changed files with 327 additions and 9 deletions
+12 -5
View File
@@ -10,6 +10,7 @@ import AppNav from "../components/AppNav";
import LeverageChart from "../components/LeverageChart";
import LoginGate from "../components/LoginGate";
import MovePointsChart from "../components/MovePointsChart";
import { leverageSummary, moveSummary } from "../lib/opsSummary";
type RangeKey = "day" | "week" | "month";
type SideKey = "both" | "C" | "P";
@@ -157,6 +158,9 @@ export default function OpsMapPage() {
minLeverage={lev.min_leverage}
title={`上图 · 时段杠杆均值(${rangeLabel}`}
/>
<p className="chart-summary">
{leverageSummary(range, lev.buckets, lev.min_leverage)}
</p>
<div className="toolbar" style={{ marginTop: "1.25rem" }}>
<div className="seg">
@@ -189,11 +193,14 @@ export default function OpsMapPage() {
moveMode === "abs" ? "abs" : "signed"
}`}
/>
{mov?.message && (
<p style={{ color: "var(--muted)", fontSize: "0.85rem", marginTop: "0.75rem" }}>
{mov.message}
</p>
)}
<p className="chart-summary">
{moveSummary(range, mov?.buckets ?? [], {
pendingExpiry: mov?.pending_expiry,
pendingCount: mov?.pending_count,
mode: moveMode,
apiMessage: mov?.message,
})}
</p>
</>
)}
</div>