Update UI and functionality for wallet and fees

- Adjust footer CSS and increase padding in dashboard.
- Update chart title for clarity on hashrate units.
- Implement Alt+W keyboard shortcut to reset wallet address with confirmation and error handling.
- Add version number to footer in base.html.
- Change "Network Fee (%)" label to "Firmware Fee (%)" with updated tooltip in boot.html.
This commit is contained in:
DJObleezy 2025-04-26 20:35:27 -07:00
parent 57d8a9ab45
commit 9ef1260347
5 changed files with 96 additions and 8 deletions

View File

@ -1,14 +1,10 @@
.footer {
margin-top: 30px;
padding: 10px 0;
color: grey;
font-size: 0.9rem;
border-top: 1px solid rgba(128, 128, 128, 0.2);
}
</style >
<!-- Preload theme to prevent flicker -->
<style id="theme-preload" >
/* Theme-aware loading state */
html.bitcoin-theme {
background-color: #111111;

View File

@ -184,7 +184,7 @@
}
/* Add bottom padding to accommodate minimized system monitor */
.container-fluid {
padding-bottom: 60px !important; /* Enough space for minimized monitor */
padding-bottom: 100px !important; /* Enough space for minimized monitor */
}
/* Add these styles to dashboard.css */

View File

@ -2309,7 +2309,7 @@ $(document).ready(function () {
y: {
title: {
display: true,
text: 'HASHRATE',
text: 'HASHRATE (TH/S)',
color: theme.PRIMARY,
font: {
family: "'VT323', monospace",
@ -2644,6 +2644,97 @@ $(document).ready(function () {
}
});
// Add keyboard event listener for Alt+W to reset wallet address
$(document).keydown(function (event) {
// Check if Alt+W is pressed (key code 87 is 'W')
if (event.altKey && event.keyCode === 87) {
resetWalletAddress();
// Prevent default browser behavior
event.preventDefault();
}
});
// Function to reset wallet address in configuration and clear chart data
function resetWalletAddress() {
if (confirm("Are you sure you want to reset your wallet address? This will also clear all chart data and redirect you to the configuration page.")) {
// First clear chart data using the existing API endpoint
$.ajax({
url: '/api/reset-chart-data',
method: 'POST',
success: function () {
console.log("Chart data reset successfully");
// Then reset the chart display locally
if (trendChart) {
trendChart.data.labels = [];
trendChart.data.datasets[0].data = [];
trendChart.update('none');
}
// Then reset wallet address
fetch('/api/config')
.then(response => response.json())
.then(config => {
// Reset the wallet address to default
config.wallet = "yourwallethere";
// Save the updated configuration
return fetch('/api/config', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(config)
});
})
.then(response => response.json())
.then(data => {
console.log("Wallet address reset successfully:", data);
// Also clear arrow indicator states
arrowIndicator.clearAll();
// Redirect to the boot page for reconfiguration
window.location.href = window.location.origin + "/";
})
.catch(error => {
console.error("Error resetting wallet address:", error);
alert("There was an error resetting your wallet address. Please try again.");
});
},
error: function (xhr, status, error) {
console.error("Error clearing chart data:", error);
// Continue with wallet reset even if chart reset fails
resetWalletAddressOnly();
}
});
}
}
// Fallback function if chart reset fails
function resetWalletAddressOnly() {
fetch('/api/config')
.then(response => response.json())
.then(config => {
config.wallet = "yourwallethere";
return fetch('/api/config', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(config)
});
})
.then(response => response.json())
.then(data => {
console.log("Wallet address reset successfully (without chart reset):", data);
window.location.href = window.location.origin + "/";
})
.catch(error => {
console.error("Error resetting wallet address:", error);
alert("There was an error resetting your wallet address. Please try again.");
});
}
// Apply any saved arrows to DOM on page load
arrowIndicator.forceApplyArrows();

View File

@ -135,6 +135,7 @@
<!-- Footer -->
<footer class="footer text-center">
<p>Not affiliated with <a href="https://www.Ocean.xyz">Ocean.xyz</a></p>
<p>v0.8.7 - Public Beta </p>
</footer>
</div>

View File

@ -131,10 +131,10 @@ v.21
</div>
<div class="form-group">
<label for="network-fee">
Network Fee (%)
Firmware Fee (%)
<span class="tooltip">
?
<span class="tooltip-text">Additional fees beyond pool fee, like Firmware fees</span>
<span class="tooltip-text">Additional fees beyond pool fee, like Firmware fees from LuxOS and Vnish</span>
</span>
</label>
<input type="number" id="network-fee" step="0.1" min="0" max="10" placeholder="0.0" value="">