From 9a63099b7601f78e1a7ffbb8384f6648de65da14 Mon Sep 17 00:00:00 2001 From: Harwinder Sekhon Date: Sun, 16 Aug 2026 21:02:24 -0400 Subject: [PATCH] dashboard: color ladder levels red/green on cells (Bootstrap table overrides row colors), add direction icons --- static/dashboard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/static/dashboard.js b/static/dashboard.js index 03f96c5..721112a 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -281,14 +281,16 @@ function ladder(levels, price) { if (price != null) rows.push({ here: true, v: +price }); rows.sort((a, b) => b.v - a.v); const body = rows.map(row => { - if (row.here) return `current price + if (row.here) return `current price ${fmt$(row.v)}—spot`; const d = price != null ? row.v - price : null; - return ` 0 ? "text-danger" : "text-success"}"> + const cls = d == null ? "" : d > 0 ? "text-danger" : "text-success"; + const icon = d == null ? "" : d > 0 ? "bi-arrow-up-short" : "bi-arrow-down-short"; + return ` ${esc(row.label)} - ${fmt$(row.v)} - ${d == null ? "" : signed(d) + (atr ? ` · ${signed(d / atr, 2)} ATR` : "")} - ${d == null ? "" : d > 0 ? "resistance" : "support"}`; + ${fmt$(row.v)} + ${d == null ? "" : signed(d) + (atr ? ` · ${signed(d / atr, 2)} ATR` : "")} + ${d == null ? "" : `${d > 0 ? "resistance" : "support"}`}`; }).join(""); return `${body}
LevelPrice vs. spotRole
`;