Update web/index.html
Connect web interface to status API
This commit is contained in:
+37
-6
@@ -10,20 +10,51 @@
|
||||
<h1>Munin Bitcoin</h1>
|
||||
|
||||
<h2>Service</h2>
|
||||
<p>🟢 Running</p>
|
||||
<p id="service">Loading...</p>
|
||||
|
||||
<h2>Bitcoin Node</h2>
|
||||
<p>⚪ Not connected</p>
|
||||
<p id="bitcoinNode">Loading...</p>
|
||||
|
||||
<h2>Wallet</h2>
|
||||
<p>⚪ Not configured</p>
|
||||
<p id="wallet">Loading...</p>
|
||||
|
||||
<h2>Statistics</h2>
|
||||
<p>Labels: 0</p>
|
||||
<p>Transactions: 0</p>
|
||||
<p>Labels: <span id="labels">0</span></p>
|
||||
<p>Transactions: <span id="transactions">0</span></p>
|
||||
|
||||
<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>
|
||||
</html>
|
||||
Reference in New Issue
Block a user