Add initial funds to fleet stats and color total PnL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-02 12:51:47 +08:00
parent 51aef1c2fb
commit 60b3743e8d
4 changed files with 37 additions and 0 deletions
+6
View File
@@ -6,6 +6,7 @@ type FleetStatsRow = {
name: string;
ok: boolean;
error?: string | null;
initial_funds?: number | null;
latest_funds?: number | null;
groups?: number | null;
fees_perp?: number | null;
@@ -82,6 +83,7 @@ export default function StatsPage() {
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
@@ -103,6 +105,9 @@ export default function StatsPage() {
</div>
) : null}
</td>
<td className="mono">
{row.ok ? fmt(row.initial_funds ?? 0, 2) : "—"}
</td>
<td className="mono">
{row.ok ? fmt(row.latest_funds ?? 0, 2) : "—"}
</td>
@@ -139,6 +144,7 @@ export default function StatsPage() {
({okRows.length}/{fleetStats.length})
</span>
</td>
<td className="mono">{fmt(sum("initial_funds"), 2)}</td>
<td className="mono">{fmt(sum("latest_funds"), 2)}</td>
<td className="mono">{sum("groups")}</td>
<td className="mono">{fmt(sum("fees_perp"), 4)}</td>
+12
View File
@@ -422,6 +422,18 @@ input {
color: var(--accent);
}
.stats-table tfoot .stats-total-row td.pnl-pos {
color: var(--pnl-pos);
}
.stats-table tfoot .stats-total-row td.pnl-neg {
color: var(--pnl-neg);
}
.stats-table tfoot .stats-total-row td.pnl-flat {
color: var(--text);
}
.btn-sm {
padding: 4px 8px;
font-size: 0.78rem;