Status in Title Bar
This commit is contained in:
20
installer
20
installer
@ -362,6 +362,7 @@ $stratum = 'stratum+tcp://' . $host . ':3333';
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Bitcoin Node for Solo Miners</title>
|
<title>Bitcoin Node for Solo Miners</title>
|
||||||
|
<link id="app-favicon" rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Crect width='64' height='64' fill='%23222'/%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-size='32' fill='%23ffb347'%3E%E2%9A%A0%3C/text%3E%3C/svg%3E">
|
||||||
<style>
|
<style>
|
||||||
body { font-family: sans-serif; background: #111; color: #eee; margin: 0; }
|
body { font-family: sans-serif; background: #111; color: #eee; margin: 0; }
|
||||||
header { background: #222; padding: 1rem 2rem; display:flex; justify-content:space-between; align-items:center; }
|
header { background: #222; padding: 1rem 2rem; display:flex; justify-content:space-between; align-items:center; }
|
||||||
@ -472,6 +473,9 @@ async function loadStatus() {
|
|||||||
progress = (data.blocks / data.headers) * 100;
|
progress = (data.blocks / data.headers) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update favicon dynamically
|
||||||
|
setFaviconAndTitle(ibd, progress);
|
||||||
|
|
||||||
// update window + estimate
|
// update window + estimate
|
||||||
updateSamples(progress);
|
updateSamples(progress);
|
||||||
const etaSeconds = ibd ? estimateEta(progress) : null;
|
const etaSeconds = ibd ? estimateEta(progress) : null;
|
||||||
@ -518,6 +522,22 @@ async function loadStatus() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inline SVG favicons
|
||||||
|
const FAV_SYNC = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Crect width='64' height='64' fill='%23222'/%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-size='32' fill='%23ffb347'%3E%E2%9A%A0%3C/text%3E%3C/svg%3E";
|
||||||
|
const FAV_READY = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Crect width='64' height='64' fill='%23161717'/%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-size='34' fill='%238f8'%3E%E2%9C%94%3C/text%3E%3C/svg%3E";
|
||||||
|
|
||||||
|
function setFaviconAndTitle(isSyncing, progress) {
|
||||||
|
const link = document.getElementById('app-favicon');
|
||||||
|
if (!link) return;
|
||||||
|
if (isSyncing) {
|
||||||
|
link.href = FAV_SYNC;
|
||||||
|
document.title = "Syncing… " + progress.toFixed(1) + "% | Bitcoin Node";
|
||||||
|
} else {
|
||||||
|
link.href = FAV_READY;
|
||||||
|
document.title = "Ready • Bitcoin Node";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
loadStatus();
|
loadStatus();
|
||||||
setInterval(loadStatus, 5000);
|
setInterval(loadStatus, 5000);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user