Add LND version to Lightning page

This commit is contained in:
Taylor Helsper 2019-07-31 23:27:16 -05:00
parent 5e39f67b62
commit cc5e64a2c1
3 changed files with 13 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from bitcoin_info import *
# Variables # Variables
lightning_info = None lightning_info = None
lnd_ready = False lnd_ready = False
lnd_version = None
LND_FOLDER = "/mnt/hdd/mynode/lnd/" LND_FOLDER = "/mnt/hdd/mynode/lnd/"
MACAROON_FILE = "/mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon" MACAROON_FILE = "/mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon"
@ -150,3 +151,8 @@ def get_lnd_channels():
print("EXCEPTION: {}".format(str(e))) print("EXCEPTION: {}".format(str(e)))
return False return False
def get_lnd_version():
global lnd_version
if lnd_version == None:
lnd_version = subprocess.check_output("lnd --version | egrep -o '[0-9]+\\.[0-9]+\\.[0-9]+' | head -n 1", shell=True)
return lnd_version

View File

@ -63,6 +63,7 @@ def page_lnd():
"title": "myNode Lightning Wallet", "title": "myNode Lightning Wallet",
"wallet_exists": wallet_exists, "wallet_exists": wallet_exists,
"wallet_logged_in": wallet_logged_in, "wallet_logged_in": wallet_logged_in,
"version": get_lnd_version(),
"status": status, "status": status,
"message": message "message": message
} }
@ -74,6 +75,7 @@ def page_lnd():
"wallet_exists": wallet_exists, "wallet_exists": wallet_exists,
"wallet_logged_in": wallet_logged_in, "wallet_logged_in": wallet_logged_in,
"status": get_lnd_status(), "status": get_lnd_status(),
"version": get_lnd_version(),
"message": message "message": message
} }
return render_template('lnd.html', **templateData) return render_template('lnd.html', **templateData)
@ -107,6 +109,7 @@ def page_lnd():
"title": "myNode Lightning Status", "title": "myNode Lightning Status",
"wallet_exists": wallet_exists, "wallet_exists": wallet_exists,
"wallet_logged_in": wallet_logged_in, "wallet_logged_in": wallet_logged_in,
"version": get_lnd_version(),
"channel_backup_exists": channel_backup_exists, "channel_backup_exists": channel_backup_exists,
"status": status, "status": status,
"height": height, "height": height,

View File

@ -132,6 +132,10 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="info_tile">
<div class="info_tile_header">Version</div>
<div class="info_tile_contents">{{version}}</div>
</div>
</div> </div>
{% if wallet_exists or channel_backup_exists %} {% if wallet_exists or channel_backup_exists %}