Add option to see BTC RPC password in GUI

This commit is contained in:
Taylor Helsper 2020-02-12 20:51:40 -06:00
parent cca84c780b
commit 912d29ae2d
2 changed files with 21 additions and 0 deletions

View File

@ -110,6 +110,7 @@ def bitcoind_status_page():
peerdata = get_bitcoin_peers() peerdata = get_bitcoin_peers()
mempooldata = get_bitcoin_mempool() mempooldata = get_bitcoin_mempool()
version = get_bitcoin_version() version = get_bitcoin_version()
rpc_password = get_bitcoin_rpc_password()
# Mempool info # Mempool info
mempool = {} mempool = {}
@ -172,6 +173,7 @@ def bitcoind_status_page():
"difficulty": "{:.3g}".format(info["difficulty"]), "difficulty": "{:.3g}".format(info["difficulty"]),
"block_num": info["blocks"], "block_num": info["blocks"],
"header_num": info["headers"], "header_num": info["headers"],
"rpc_password": rpc_password,
"disk_size": (int(info["size_on_disk"]) / 1000 / 1000 / 1000), "disk_size": (int(info["size_on_disk"]) / 1000 / 1000 / 1000),
"mempool_tx": mempool["size"], "mempool_tx": mempool["size"],
"mempool_size": "{:.3} MB".format(float(mempool["bytes"]) / 1000 / 1000), "mempool_size": "{:.3} MB".format(float(mempool["bytes"]) / 1000 / 1000),

View File

@ -2,6 +2,18 @@
<head> <head>
<title>{{ title }}</title> <title>{{ title }}</title>
{% include 'includes/head.html' %} {% include 'includes/head.html' %}
<script>
$(document).ready(function() {
$("#show_rpc_password").on("click", function() {
$("#show_rpc_password").hide(0);
$("#rpc_password").show();
});
});
</script>
</head> </head>
<body> <body>
@ -45,6 +57,13 @@
<div class="info_tile_header">Mempool Size</div> <div class="info_tile_header">Mempool Size</div>
<div class="info_tile_contents">{{mempool_size}}</div> <div class="info_tile_contents">{{mempool_size}}</div>
</div> </div>
<div class="info_tile">
<div class="info_tile_header">RPC Password</div>
<div class="info_tile_contents">
<span id="rpc_password" style="display: none;">{{rpc_password}}</span>
<a id="show_rpc_password" class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 70%;">show</a>
</div>
</div>
<div class="info_tile"> <div class="info_tile">
<div class="info_tile_header">Bitcoin Config</div> <div class="info_tile_header">Bitcoin Config</div>
<div class="info_tile_contents"> <div class="info_tile_contents">