Hide zero USDT in options balance labels and add swap/transfer all buttons.

Skip 0 balances in header display; fill max funding/trading amount on 全部兑换/全部划转.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-12 08:55:30 +08:00
parent 551c86264a
commit bb53beb22d
9 changed files with 141 additions and 41 deletions
@@ -1134,8 +1134,8 @@ function paintRealtimePnlFromSnapshot(data){
function formatOptionsFundingLabel(usdc, usdt) {
const parts = [];
if (usdc !== null && usdc !== undefined) parts.push(`${Number(usdc).toFixed(2)} USDC`);
if (usdt !== null && usdt !== undefined) parts.push(`${Number(usdt).toFixed(2)} USDT`);
if (usdc !== null && usdc !== undefined && Number(usdc) > 0) parts.push(`${Number(usdc).toFixed(2)} USDC`);
if (usdt !== null && usdt !== undefined && Number(usdt) > 0) parts.push(`${Number(usdt).toFixed(2)} USDT`);
return parts.length ? parts.join(" · ") : "—";
}
+2 -2
View File
@@ -1779,8 +1779,8 @@ function paintRealtimePnlFromSnapshot(data){
function formatOptionsFundingLabel(usdc, usdt) {
const parts = [];
if (usdc !== null && usdc !== undefined) parts.push(`${Number(usdc).toFixed(2)} USDC`);
if (usdt !== null && usdt !== undefined) parts.push(`${Number(usdt).toFixed(2)} USDT`);
if (usdc !== null && usdc !== undefined && Number(usdc) > 0) parts.push(`${Number(usdc).toFixed(2)} USDC`);
if (usdt !== null && usdt !== undefined && Number(usdt) > 0) parts.push(`${Number(usdt).toFixed(2)} USDT`);
return parts.length ? parts.join(" · ") : "—";
}