mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-18 06:41:27 +02:00
fix admin balance display
This commit is contained in:
+15
-7
@@ -580,13 +580,21 @@
|
||||
walletEl.className = 'wallet-status disconnected';
|
||||
document.getElementById('walletBalance').textContent = 'RPC Error';
|
||||
} else {
|
||||
// Wallet connected - show balance
|
||||
const bal = overview.walletBalance.unlocked_balance || 0;
|
||||
const formatted = (bal / atomicDivisor).toFixed(4);
|
||||
document.getElementById('statBalance').textContent = formatted;
|
||||
document.getElementById('statUnlocked').textContent = `Unlocked: ${formatted}`;
|
||||
walletEl.className = 'wallet-status' + (bal < atomicDivisor ? ' warning' : ' healthy');
|
||||
document.getElementById('walletBalance').textContent = `${formatted} ${cryptoSymbol}`;
|
||||
// Wallet connected - show total balance and unlocked/locked breakdown
|
||||
const total = overview.walletBalance.balance || 0;
|
||||
const unlocked = overview.walletBalance.unlocked_balance || 0;
|
||||
const locked = total - unlocked;
|
||||
const totalFormatted = (total / atomicDivisor).toFixed(4);
|
||||
const unlockedFormatted = (unlocked / atomicDivisor).toFixed(4);
|
||||
document.getElementById('statBalance').textContent = totalFormatted;
|
||||
if (locked > 0) {
|
||||
const lockedFormatted = (locked / atomicDivisor).toFixed(4);
|
||||
document.getElementById('statUnlocked').textContent = `Unlocked: ${unlockedFormatted} | Locked: ${lockedFormatted}`;
|
||||
} else {
|
||||
document.getElementById('statUnlocked').textContent = `Unlocked: ${unlockedFormatted}`;
|
||||
}
|
||||
walletEl.className = 'wallet-status' + (unlocked < atomicDivisor ? ' warning' : ' healthy');
|
||||
document.getElementById('walletBalance').textContent = `${totalFormatted} ${cryptoSymbol}`;
|
||||
}
|
||||
} else {
|
||||
document.getElementById('statBalance').textContent = '-';
|
||||
|
||||
@@ -308,7 +308,8 @@ class AlertService {
|
||||
*/
|
||||
async alertPayoutFailed(payout) {
|
||||
const cryptoType = process.env.CRYPTO_TYPE || 'XMR';
|
||||
const amountFormatted = (payout.amount / 1e12).toFixed(6);
|
||||
const divisor = cryptoType === 'WOW' ? 1e11 : 1e12;
|
||||
const amountFormatted = (payout.amount / divisor).toFixed(6);
|
||||
|
||||
await this.sendAlert('payout_failed', {
|
||||
subject: `💀 Payout Permanently Failed - ${amountFormatted} ${cryptoType}`,
|
||||
|
||||
Reference in New Issue
Block a user