diff --git a/web/app.js b/web/app.js index d4114e1..15962c9 100644 --- a/web/app.js +++ b/web/app.js @@ -910,7 +910,36 @@ function renderStructure(s) { // Circuit Breaker — roter Banner wenn ausgelöst, bernstein wenn nah (>60% des Limits). function renderCircuitBreaker(cb) { - const el = $("circuit-banner"); + // ⚠⚠ KOMPAKT und IM Feld TAG P/L (User-Vorgabe 2026-08-21). Das breite + // Banner über der Karte ist per CSS ausgeblendet; `#cb-mini` hängt direkt + // an der Zahl, die den Breaker auslöst — dort wird sie auch gelesen. + // ⚠ Das alte Element bleibt als Halter im DOM und wird weiter befüllt, + // damit ein Zurückholen eine einzige CSS-Zeile ist. + { + const mini = $streng("cb-mini"); + if (mini) { + if (!cb || !cb.enabled) { + mini.textContent = ""; mini.className = "cb-mini"; + mini.title = "Tagesverlust-Stopp ist AUS."; + } else if (cb.tripped) { + mini.textContent = "⛔ Stopp"; + mini.className = "cb-mini tripped"; + mini.title = `Circuit Breaker AUSGELÖST — Tagesverlust ${fmt(cb.day_total, 2)} € ` + + `erreicht (Limit −${fmt(cb.limit_eur, 0)} €). Keine Auto-Trades mehr heute.`; + } else if (cb.limit_eur && cb.day_total < 0) { + const pct = Math.round(100 * Math.abs(cb.day_total) / cb.limit_eur); + mini.textContent = pct + " %"; + mini.className = "cb-mini" + (pct >= 60 ? " near" : ""); + mini.title = `${pct} % des Tagesverlust-Limits verbraucht ` + + `(${fmt(cb.day_total, 2)} von −${fmt(cb.limit_eur, 0)} €). Bei 100 % ` + + `schließt der Bot und sperrt Auto-Trades bis morgen.`; + } else { + mini.textContent = ""; mini.className = "cb-mini"; + mini.title = `Tagesverlust-Limit −${fmt(cb.limit_eur, 0)} € — heute noch nicht im Minus.`; + } + } + } + const el = $streng("circuit-banner"); if (!el) return; if (!cb || !cb.enabled) { el.className = "circuit hidden"; el.textContent = ""; return; } const limit = cb.limit_eur, day = cb.day_total; @@ -2490,7 +2519,7 @@ async function closeSlot(slot, label, pnl) { // und der Browser zeigte Altes. Statt das jedes Mal von Hand zu diagnostizieren, // sagt die Seite es jetzt selbst. // ⚠ Bewusst SICHTBAR statt nur Konsole: die Konsole sieht am Handy niemand. -const _JS_V = "214"; +const _JS_V = "215"; { const htmlV = document.body && document.body.dataset ? document.body.dataset.htmlV : null; diff --git a/web/index.html b/web/index.html index d2768c2..2d3d2ad 100644 --- a/web/index.html +++ b/web/index.html @@ -12,9 +12,9 @@ ⚠ LOKAL eingebunden, kein CDN: die PWA laeuft ueber WireGuard und muss offline funktionieren. --> - + -
+