feat: compact instance toolbar, stats strip and settings two-column layout
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1031,6 +1031,21 @@ function refreshAccountSnapshot(){
|
||||
const el = document.getElementById("current-capital");
|
||||
if(el) el.innerText = `${Number(data.current_capital).toFixed(2)}U`;
|
||||
}
|
||||
if (typeof data.unrealized_pnl !== "undefined") {
|
||||
const pnlEl = document.getElementById("realtime-pnl");
|
||||
if (pnlEl) {
|
||||
if (data.unrealized_pnl === null || data.unrealized_pnl === undefined) {
|
||||
pnlEl.innerText = "—";
|
||||
pnlEl.classList.remove("pnl-pos", "pnl-neg");
|
||||
} else {
|
||||
const v = Number(data.unrealized_pnl);
|
||||
const sign = v > 0 ? "+" : "";
|
||||
pnlEl.innerText = `${sign}${v.toFixed(2)}U`;
|
||||
pnlEl.classList.toggle("pnl-pos", v > 0);
|
||||
pnlEl.classList.toggle("pnl-neg", v < 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof data.available_trading_usdt !== "undefined" && data.available_trading_usdt !== null) {
|
||||
latestAvailableUsdt = Number(data.available_trading_usdt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user