From 659b2708a29124797e8a623d5b8941df07433a3a Mon Sep 17 00:00:00 2001 From: Marc Blatter Date: Wed, 15 Jul 2026 11:13:52 +0200 Subject: [PATCH] Bugfix: v0.32 - Holdings spacing margin (no green bg), Chart timestamps hourly (10:00, 11:00), Swiss date format (15.7.26) --- src/web_dashboard.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/web_dashboard.py b/src/web_dashboard.py index 6f5a766..3ffb9c4 100644 --- a/src/web_dashboard.py +++ b/src/web_dashboard.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Trading Bot Dashboard v0.32 - with Collapsible Holdings, USD values, Mobile-optimized""" +"""Trading Bot Dashboard v0.32 - Bug fixes: Holdings spacing, Chart timestamps (Swiss format, hourly)""" from fastapi import FastAPI from fastapi.responses import HTMLResponse from binance.client import Client @@ -69,9 +69,25 @@ async def history(hours: int = 24): conn.close() ts_list, pcts, usdts = [], [], [] + seen_ts = set() + for t, p, u in rows: dt = datetime.fromtimestamp(t) - ts_list.append(dt.strftime('%H:%M' if hours <= 24 else '%m-%d')) + + # Format timestamps: hourly for 1-day, Swiss format for longer periods + if hours <= 24: + # Round to hour: "10:00", "11:00" + ts = dt.strftime('%H:00') + else: + # Swiss format: "15.7" or "15.07.26" - using dd.m format + ts = dt.strftime('%d.%m.%y') + + # Skip duplicate timestamps + if ts in seen_ts: + continue + + seen_ts.add(ts) + ts_list.append(ts) pcts.append(round(p, 2)) usdts.append(round(u, 2)) @@ -116,7 +132,7 @@ body{font-family:Segoe UI,Arial;background:#1e1e1e;color:#d0d0d0;min-height:100v .val{font-size:24px;color:#00ff88;font-weight:bold} @media(max-width:768px){.val{font-size:20px}} .sub{font-size:14px;color:#999} -.collapse-header{display:flex;justify-content:space-between;align-items:center;padding:15px 20px;background:rgba(0,255,136,.05);border:1px solid rgba(0,255,136,.2);border-radius:10px;cursor:pointer;margin:20px 0 0 0} +.collapse-header{display:flex;justify-content:space-between;align-items:center;padding:15px 20px;background:transparent;border:1px solid rgba(0,255,136,.2);border-radius:10px;cursor:pointer;margin:20px 0 15px 0} @media(max-width:768px){.collapse-header{padding:12px 15px}} .collapse-header h3{color:#00ff88;font-size:16px;margin:0} @media(max-width:768px){.collapse-header h3{font-size:14px}}