Skip to content

Commit

Permalink
added automated display update of amount on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jagottsicher committed Feb 10, 2024
1 parent c6c53f4 commit f86562e
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions wallet_server/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,43 @@
alert('Send failed');
}
})
})
});

function reload_amount() {
let data = {'blockchain_address': $('#blockchain_address').val()}
$.ajax({
url: '/wallet/amount',
type: 'GET',
data: data,
success: function (response) {
let amount = response['amount'];
$('#wallet_amount').text(amount);
console.info(amount)
},
error: function(error) {
console.error(error)
}
})
}

/*
$('#reload_wallet').click(function(){
reload_amount();
});
*/

setInterval(reload_amount, 3000)
});
</script>

</head>

<body style="background-color: darkslategray; color:beige">
<div>
<h3>Wallet</h3>
<span style="font-size: larger;" id="wallet_amount">0</span>
<!--
<button id="reload_wallet">Reload</button>

-->
<p>Public Key</p>
<textarea id="public_key" rows="2" cols="63"></textarea>
<p>Private Key</p>
Expand Down

0 comments on commit f86562e

Please sign in to comment.