From 1bf353c5056061d6a1e961b76e9c6c6935a1a216 Mon Sep 17 00:00:00 2001 From: dekun Date: Wed, 21 Oct 2026 20:32:24 +0800 Subject: [PATCH] Show buy/sell as Chinese labels on live dashboard rows. Co-authored-by: Cursor --- app/templates/dashboard.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 41d7e8f..23c5a79 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -58,7 +58,7 @@ {{ t.time_fmt }} {{ t.machine_name or '—' }} {{ t.symbol }} - {{ t.side }} + {% if t.side=='buy' %}买入{% elif t.side=='sell' %}卖出{% else %}{{ t.side }}{% endif %} {{ t.volume if t.volume is not none else '—' }} {% if t.profit is none %}—{% else %}{{ '%.2f'|format(t.profit) }}{% endif %} @@ -143,11 +143,12 @@ } body.innerHTML = list.map(function (t) { var sideCls = t.side === 'buy' ? 'green' : 'red'; + var sideCn = t.side === 'buy' ? '买入' : (t.side === 'sell' ? '卖出' : (t.side || '—')); return '' + '' + esc(t.time_fmt) + '' + '' + esc(t.machine_name || '—') + '' + '' + esc(t.symbol) + '' + - '' + esc(t.side) + '' + + '' + esc(sideCn) + '' + '' + esc(t.volume != null ? t.volume : '—') + '' + '' + (t.profit == null || t.profit === '' ? '—' : Number(t.profit).toFixed(2)) +