feat: single-row funds strip on header and system settings page
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<link rel="manifest" href="/static/icons/manifest.webmanifest">
|
||||
<title>{{ exchange_display }} · 加密货币 | 交易监控复盘系统</title>
|
||||
<link rel="stylesheet" href="/static/instance_page.css?v=1">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=61">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=62">
|
||||
|
||||
</head>
|
||||
<body
|
||||
@@ -1598,6 +1598,13 @@ function sumOrdersFloatPnl(orders){
|
||||
return found ? total : null;
|
||||
}
|
||||
|
||||
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`);
|
||||
return parts.length ? parts.join(" · ") : "—";
|
||||
}
|
||||
|
||||
function refreshAccountSnapshot(){
|
||||
fetch("/api/account_snapshot").then(r=>r.json()).then(data=>{
|
||||
if (typeof data.funding_usdt !== "undefined") {
|
||||
@@ -1612,10 +1619,9 @@ function refreshAccountSnapshot(){
|
||||
const el = document.getElementById("current-capital");
|
||||
if(el) el.innerText = `${Number(data.current_capital).toFixed(2)}U`;
|
||||
}
|
||||
if (typeof data.options_funding_usdc !== "undefined") {
|
||||
if (typeof data.options_funding_usdc !== "undefined" || typeof data.options_funding_usdt !== "undefined") {
|
||||
const el = document.getElementById("options-funding-usdc");
|
||||
if (el) el.innerText = (data.options_funding_usdc === null || data.options_funding_usdc === undefined)
|
||||
? "—" : `${Number(data.options_funding_usdc).toFixed(2)} USDC`;
|
||||
if (el) el.innerText = formatOptionsFundingLabel(data.options_funding_usdc, data.options_funding_usdt);
|
||||
}
|
||||
if (typeof data.options_trading_usdc !== "undefined") {
|
||||
const el = document.getElementById("options-trading-usdc");
|
||||
@@ -1754,6 +1760,8 @@ if(window.ManualOrderRrPreview){
|
||||
});
|
||||
|
||||
refreshAccountSnapshot();
|
||||
const settingsRefreshFunds = document.getElementById("settings-refresh-funds");
|
||||
if (settingsRefreshFunds) settingsRefreshFunds.addEventListener("click", refreshAccountSnapshot);
|
||||
if (window.AccountRiskBadge) AccountRiskBadge.startTicker();
|
||||
const _journalFormEl = document.getElementById("journal-form");
|
||||
if(_journalFormEl){
|
||||
|
||||
Reference in New Issue
Block a user