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:
2025-09-02 17:54:56 +10:00
parent 83bd6b9643
commit 6d318a597b
3 changed files with 18 additions and 0 deletions

Binary file not shown.

12
main.py
View File

@@ -1221,6 +1221,18 @@ def settings_action(action):
return render_template("message.html", account=account,
title="Restarting",
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")

View File

@@ -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>
</div>
</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&#39;s API</span>
</div>
</li>
{% if internal %}
<li class="list-group-item">
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>