feat: Add API info to settings page
This is most useful when using an internal node with a random api key
This commit is contained in:
Binary file not shown.
12
main.py
12
main.py
@@ -1221,6 +1221,18 @@ def settings_action(action):
|
|||||||
return render_template("message.html", account=account,
|
return render_template("message.html", account=account,
|
||||||
title="Restarting",
|
title="Restarting",
|
||||||
content="The node is restarting. This may take a minute or two. You can close this window.")
|
content="The node is restarting. This may take a minute or two. You can close this window.")
|
||||||
|
|
||||||
|
if action == "api-info":
|
||||||
|
content = f"API URL: <code>http://{account_module.HSD_IP}:{account_module.HSD_NODE_PORT}</code><br>"
|
||||||
|
content += f"Wallet URL: <code>http://{account_module.HSD_IP}:{account_module.HSD_WALLET_PORT}</code><br>"
|
||||||
|
content += f"API Key: <code>{account_module.HSD_API}</code><br><br>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return render_template("message.html", account=account,
|
||||||
|
title="API Information",
|
||||||
|
content=content)
|
||||||
|
|
||||||
|
|
||||||
return redirect("/settings?error=Invalid action")
|
return redirect("/settings?error=Invalid action")
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,12 @@
|
|||||||
<h3>Delete unconfirmed transactions</h3><span>This will only remove pending tx from the wallet older than 20 minutes (~ 2 blocks)</span>
|
<h3>Delete unconfirmed transactions</h3><span>This will only remove pending tx from the wallet older than 20 minutes (~ 2 blocks)</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div><a class="btn btn-primary stick-right" role="button" href="/settings/api-info">API Info</a>
|
||||||
|
<h3>View API Information</h3><span>View information about the connected HSD node's API</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
{% if internal %}
|
{% if internal %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>
|
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user