From f86562e168654067f11477858d4136467d77a8fb Mon Sep 17 00:00:00 2001 From: jagottsicher Date: Sat, 10 Feb 2024 22:04:47 +0800 Subject: [PATCH] added automated display update of amount on frontend --- wallet_server/templates/index.html | 32 +++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/wallet_server/templates/index.html b/wallet_server/templates/index.html index 001aa75..76bd6ef 100644 --- a/wallet_server/templates/index.html +++ b/wallet_server/templates/index.html @@ -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) }); - +

Wallet

0 +

Public Key

Private Key