Update Status Badge to show LIVE TRADING or PAPER TRADING”
This commit is contained in:
1 parent
0dff4b0e5b
commit
9e8970459f
1 file changed
+20
-1
+20
-1
@@ -241,6 +241,11 @@
|
|||||||
color:var(--accent-green);
|
color:var(--accent-green);
|
||||||
border:1px solid var(--accent-green);
|
border:1px solid var(--accent-green);
|
||||||
}
|
}
|
||||||
|
.status-paper{
|
||||||
|
background:rgba(0,212,255,.15);
|
||||||
|
color:var(--accent-blue);
|
||||||
|
border:1px solid var(--accent-blue);
|
||||||
|
}
|
||||||
.account-number{
|
.account-number{
|
||||||
font-family:'JetBrains Mono',monospace;
|
font-family:'JetBrains Mono',monospace;
|
||||||
color:var(--text-secondary);
|
color:var(--text-secondary);
|
||||||
@@ -523,7 +528,7 @@
|
|||||||
<div id="dashboard">
|
<div id="dashboard">
|
||||||
<div class="dashboard-header">
|
<div class="dashboard-header">
|
||||||
<div class="account-info">
|
<div class="account-info">
|
||||||
<span class="status-badge status-active">● LIVE</span>
|
<span id="tradingModeBadge" class="status-badge status-active">● LIVE</span>
|
||||||
<span id="accountNumber" class="account-number" onmouseenter="revealAccountNumber()" onmouseleave="hideAccountNumber()" onclick="copyAccountNumber(event)" oncontextmenu="copyAccountNumber(event)">#PA••••••••</span>
|
<span id="accountNumber" class="account-number" onmouseenter="revealAccountNumber()" onmouseleave="hideAccountNumber()" onclick="copyAccountNumber(event)" oncontextmenu="copyAccountNumber(event)">#PA••••••••</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-logout" onclick="logout()">Logout</button>
|
<button class="btn-logout" onclick="logout()">Logout</button>
|
||||||
@@ -588,6 +593,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
updateTradingModeBadge(tradingMode);
|
||||||
document.getElementById('loginForm').style.display = 'none';
|
document.getElementById('loginForm').style.display = 'none';
|
||||||
document.getElementById('dashboard').style.display = 'block';
|
document.getElementById('dashboard').style.display = 'block';
|
||||||
await loadDashboard();
|
await loadDashboard();
|
||||||
@@ -601,6 +607,19 @@
|
|||||||
errorDiv.innerHTML = '<div class="error">Invalid credentials. Please check your API Key and Secret.</div>';
|
errorDiv.innerHTML = '<div class="error">Invalid credentials. Please check your API Key and Secret.</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateTradingModeBadge(mode) {
|
||||||
|
const badge = document.getElementById('tradingModeBadge');
|
||||||
|
if (!badge) return;
|
||||||
|
badge.classList.remove('status-active', 'status-paper');
|
||||||
|
if (mode === 'live') {
|
||||||
|
badge.classList.add('status-active');
|
||||||
|
badge.textContent = '● LIVE TRADING';
|
||||||
|
} else {
|
||||||
|
badge.classList.add('status-paper');
|
||||||
|
badge.textContent = '● PAPER TRADING';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function loadDashboard() {
|
async function loadDashboard() {
|
||||||
try {
|
try {
|
||||||
const [accountData, positions] = await Promise.all([
|
const [accountData, positions] = await Promise.all([
|
||||||
|
|||||||
Reference in new issue
Block a user