diff --git a/rootfs/standard/var/www/mynode/api.py b/rootfs/standard/var/www/mynode/api.py index 32afdfd2..96b8bb8c 100644 --- a/rootfs/standard/var/www/mynode/api.py +++ b/rootfs/standard/var/www/mynode/api.py @@ -34,6 +34,7 @@ def api_get_bitcoin_info(): data["peer_count"] = get_bitcoin_peer_count() #data["difficulty"] = get_bitcoin_difficulty() # Dont send difficulty, it causes errors in jsonify data["mempool_size"] = get_bitcoin_mempool_size() + data["recommended_fees"] = get_bitcoin_recommended_fees() # Add blocks data["recent_blocks"] = None @@ -120,6 +121,7 @@ def api_get_device_info(): data["cpu"] = get_cpu_usage() data["ram"] = get_ram_usage() data["temp"] = get_device_temp() + data["uptime"] = get_system_uptime() data["is_installing_docker_images"] = is_installing_docker_images() data["is_electrs_active"] = is_electrs_active() diff --git a/rootfs/standard/var/www/mynode/bitcoin_info.py b/rootfs/standard/var/www/mynode/bitcoin_info.py index 3defebcd..cbb3a9b3 100644 --- a/rootfs/standard/var/www/mynode/bitcoin_info.py +++ b/rootfs/standard/var/www/mynode/bitcoin_info.py @@ -1,6 +1,8 @@ from config import * from utilities import * +from systemctl_info import * from threading import Timer +import requests from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import urllib import subprocess @@ -18,6 +20,7 @@ bitcoin_peers = [] bitcoin_network_info = None bitcoin_wallets = None bitcoin_mempool = None +bitcoin_recommended_fees = None bitcoin_version = None # Functions @@ -73,6 +76,7 @@ def update_bitcoin_other_info(): global bitcoin_peers global bitcoin_network_info global bitcoin_mempool + global bitcoin_recommended_fees global bitcoin_wallets while bitcoin_blockchain_info == None: @@ -118,6 +122,22 @@ def update_bitcoin_other_info(): wallet_info = wallet_rpc_connection.getwalletinfo() wallet_data.append(wallet_info) bitcoin_wallets = wallet_data + + # Get recommended fee info (from mempool on port 4080) + if is_service_enabled("mempool"): + try: + r = requests.get("http://localhost:4080/api/v1/fees/recommended", timeout=1) + data = r.json() + bitcoin_recommended_fees = "" + bitcoin_recommended_fees += "Low priority: {} sat/vB".format(data["hourFee"]) + bitcoin_recommended_fees += "             " + bitcoin_recommended_fees += "Medium priority: {} sat/vB".format(data["halfHourFee"]) + bitcoin_recommended_fees += "             " + bitcoin_recommended_fees += "High priority: {} sat/vB".format(data["fastestFee"]) + except Exception as e: + bitcoin_recommended_fees = "Fee error - " . str(e) + else: + bitcoin_recommended_fees = None except Exception as e1: log_message("ERROR: In update_bitcoin_other_info - {}".format( str(e1) )) @@ -201,6 +221,10 @@ def get_bitcoin_mempool_size(): size = float(info["bytes"]) / 1000 / 1000 return "{:.3} MB".format(size) +def get_bitcoin_recommended_fees(): + global bitcoin_recommended_fees + return bitcoin_recommended_fees + def get_bitcoin_wallets(): global bitcoin_wallets return copy.deepcopy(bitcoin_wallets) diff --git a/rootfs/standard/var/www/mynode/static/css/mynode.css b/rootfs/standard/var/www/mynode/static/css/mynode.css index a7e19c51..66591b07 100644 --- a/rootfs/standard/var/www/mynode/static/css/mynode.css +++ b/rootfs/standard/var/www/mynode/static/css/mynode.css @@ -249,7 +249,7 @@ td, th { background: #f0f0f0; } /* width of four tiles (full width) */ -.app_tile_price_ticker { +.app_tile_ticker { display: inline-block; position: relative; border: none; diff --git a/rootfs/standard/var/www/mynode/static/css/mynode_dark.css b/rootfs/standard/var/www/mynode/static/css/mynode_dark.css index 0928bc58..9ed1b579 100644 --- a/rootfs/standard/var/www/mynode/static/css/mynode_dark.css +++ b/rootfs/standard/var/www/mynode/static/css/mynode_dark.css @@ -40,7 +40,7 @@ a:active { .device_status_info, .bitcoin_block, .pair_wallet_text, -.app_tile_price_ticker, +.app_tile_ticker, .app_tile_lightning_details, .lightning_channel_container, .settings_block_subheader, @@ -55,7 +55,7 @@ table, .app_tile, .app_tile_short, .app_tile_wide, -.app_tile_price_ticker, +.app_tile_ticker, .app_tile_bitcoin_recent_blocks, .app_tile_lightning_details, .info_tile { @@ -64,7 +64,7 @@ table, .app_tile, .app_tile_wide, -.app_tile_price_ticker, +.app_tile_ticker, .app_tile_bitcoin_recent_blocks, .app_tile_lightning_details, .app_tile_short { diff --git a/rootfs/standard/var/www/mynode/templates/includes/services.html b/rootfs/standard/var/www/mynode/templates/includes/services.html index a839a928..0e5d4d9e 100644 --- a/rootfs/standard/var/www/mynode/templates/includes/services.html +++ b/rootfs/standard/var/www/mynode/templates/includes/services.html @@ -100,9 +100,9 @@ -