mirror of
https://github.com/Retropex/custom-ocean.xyz-dashboard.git
synced 2025-05-12 19:20:45 +02:00
Add last block earnings display to UI
Updated `updateUI()` in `main.js` to show last block earnings with a "+" prefix and "SATS" suffix. Modified `dashboard.html` to include a new span element that conditionally displays the earnings or defaults to "+0 SATS".
This commit is contained in:
parent
e0c5f085cc
commit
24c46f058b
@ -1693,6 +1693,13 @@ function updateUI() {
|
||||
data.btc_price != null ? "$" + numberWithCommas(parseFloat(data.btc_price).toFixed(2)) : "N/A"
|
||||
);
|
||||
|
||||
// Update last block earnings
|
||||
if (data.last_block_earnings !== undefined) {
|
||||
// Format with "+" prefix and "SATS" suffix
|
||||
updateElementText("last_block_earnings",
|
||||
"+" + numberWithCommas(data.last_block_earnings) + " SATS");
|
||||
}
|
||||
|
||||
// Network hashrate (already in EH/s but verify)
|
||||
// Improved version with ZH/s support:
|
||||
if (data.network_hashrate >= 1000) {
|
||||
|
@ -76,7 +76,7 @@
|
||||
{{ metrics.last_block_time if metrics and metrics.last_block_time else "N/A" }}
|
||||
</span>
|
||||
—
|
||||
<span class="green">
|
||||
<span id="last_block_earnings" class="metric-value green">
|
||||
{% if metrics and metrics.last_block_earnings %}
|
||||
+{{ metrics.last_block_earnings|int|commafy }} SATS
|
||||
{% else %}
|
||||
|
Loading…
Reference in New Issue
Block a user