mirror of
https://github.com/Retropex/custom-ocean.xyz-dashboard.git
synced 2025-05-13 03:30:46 +02:00
Update BitcoinProgressBar.js
This commit is contained in:
parent
7aee1fe982
commit
9656368478
@ -703,6 +703,9 @@ const BitcoinMinuteRefresh = (function () {
|
|||||||
/**
|
/**
|
||||||
* Update the uptime display
|
* Update the uptime display
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* Update the uptime display
|
||||||
|
*/
|
||||||
function updateUptime() {
|
function updateUptime() {
|
||||||
if (serverStartTime) {
|
if (serverStartTime) {
|
||||||
try {
|
try {
|
||||||
@ -715,9 +718,19 @@ const BitcoinMinuteRefresh = (function () {
|
|||||||
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
|
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
|
||||||
|
|
||||||
// Update the main uptime display with digital clock style
|
// Update the main uptime display with digital clock style
|
||||||
document.getElementById('uptime-hours').textContent = String(hours).padStart(2, '0');
|
const uptimeHoursElement = document.getElementById('uptime-hours');
|
||||||
document.getElementById('uptime-minutes').textContent = String(minutes).padStart(2, '0');
|
const uptimeMinutesElement = document.getElementById('uptime-minutes');
|
||||||
document.getElementById('uptime-seconds').textContent = String(seconds).padStart(2, '0');
|
const uptimeSecondsElement = document.getElementById('uptime-seconds');
|
||||||
|
|
||||||
|
if (uptimeHoursElement) {
|
||||||
|
uptimeHoursElement.textContent = String(hours).padStart(2, '0');
|
||||||
|
}
|
||||||
|
if (uptimeMinutesElement) {
|
||||||
|
uptimeMinutesElement.textContent = String(minutes).padStart(2, '0');
|
||||||
|
}
|
||||||
|
if (uptimeSecondsElement) {
|
||||||
|
uptimeSecondsElement.textContent = String(seconds).padStart(2, '0');
|
||||||
|
}
|
||||||
|
|
||||||
// Update the minimized uptime display
|
// Update the minimized uptime display
|
||||||
const minimizedUptimeElement = document.getElementById('minimized-uptime-value');
|
const minimizedUptimeElement = document.getElementById('minimized-uptime-value');
|
||||||
@ -725,17 +738,13 @@ const BitcoinMinuteRefresh = (function () {
|
|||||||
minimizedUptimeElement.textContent = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
minimizedUptimeElement.textContent = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEW CODE: Update the dashboard's uptime display if it exists
|
|
||||||
const dashboardUptimeElement = document.getElementById('uptimeTimer');
|
|
||||||
if (dashboardUptimeElement) {
|
|
||||||
dashboardUptimeElement.innerHTML = `<strong>Uptime:</strong> ${String(hours).padStart(2, '0')}h ${String(minutes).padStart(2, '0')}m ${String(seconds).padStart(2, '0')}s`;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("BitcoinMinuteRefresh: Error updating uptime:", e);
|
console.error("BitcoinMinuteRefresh: Error updating uptime:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify other tabs that data has been refreshed
|
* Notify other tabs that data has been refreshed
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user