Update web/index.html

Connect web interface to status API
This commit is contained in:
2026-08-06 18:49:45 +00:00
parent eecb3f6a03
commit 5c242a1e00
+37 -6
View File
@@ -10,20 +10,51 @@
<h1>Munin Bitcoin</h1> <h1>Munin Bitcoin</h1>
<h2>Service</h2> <h2>Service</h2>
<p>🟢 Running</p> <p id="service">Loading...</p>
<h2>Bitcoin Node</h2> <h2>Bitcoin Node</h2>
<p>⚪ Not connected</p> <p id="bitcoinNode">Loading...</p>
<h2>Wallet</h2> <h2>Wallet</h2>
<p>⚪ Not configured</p> <p id="wallet">Loading...</p>
<h2>Statistics</h2> <h2>Statistics</h2>
<p>Labels: 0</p> <p>Labels: <span id="labels">0</span></p>
<p>Transactions: 0</p> <p>Transactions: <span id="transactions">0</span></p>
<h2>Last scan</h2> <h2>Last scan</h2>
<p>Never</p> <p id="lastScan">Loading...</p>
<script>
fetch('/api/status')
.then(response => response.json())
.then(status => {
document.getElementById('service').textContent =
'🟢 ' + status.service;
document.getElementById('bitcoinNode').textContent =
status.bitcoinNode;
document.getElementById('wallet').textContent =
status.wallet;
document.getElementById('labels').textContent =
status.labels;
document.getElementById('transactions').textContent =
status.transactions;
document.getElementById('lastScan').textContent =
status.lastScan;
})
.catch(error => {
document.getElementById('service').textContent =
'🔴 Error loading status';
console.error(error);
});
</script>
</body> </body>
</html> </html>