Bot auto-update: src/web_dashboard.py
This commit is contained in:
parent
c856478c1a
commit
1885ef468e
|
|
@ -59,7 +59,9 @@ async def dashboard():
|
||||||
const r = await fetch("/api/state");
|
const r = await fetch("/api/state");
|
||||||
const d = await r.json();
|
const d = await r.json();
|
||||||
|
|
||||||
const usdt = (d.balance && d.balance.USDT) ? d.balance.USDT.free || 0 : 0;
|
const usdt_data = d.balance && d.balance.USDT ? d.balance.USDT : {free: 0};
|
||||||
|
const usdt = parseFloat(usdt_data.free) || 0;
|
||||||
|
console.log("USDT from API:", usdt_data, "parsed:", usdt);
|
||||||
document.getElementById("usdt").textContent = usdt.toFixed(2);
|
document.getElementById("usdt").textContent = usdt.toFixed(2);
|
||||||
document.getElementById("trades").textContent = d.trades_today || 0;
|
document.getElementById("trades").textContent = d.trades_today || 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue