feat: Add install instructions and update login to have a dropdown

This commit is contained in:
Nathan Woodburn 2024-01-29 15:19:38 +11:00
parent 86e4f1f2b9
commit 735bd68302
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
5 changed files with 41 additions and 4 deletions

View File

@ -1 +1,24 @@
# FireWalletBrowser
## Installation
```bash
git clone https://github.com/Nathanwoodburn/firewalletbrowser.git
cd firewalletbrowser
python3 -m pip install -r requirements.txt
cp example.env .env
# Edit .env to include your HSD API key
```
## Usage
Make sure HSD is running then run the following commands:
```bash
python3 server.py
# Or for more verbose output
python3 main.py
```
Then access the wallet at http://localhost:5000

1
example.env Normal file
View File

@ -0,0 +1 @@
hsd_api=123480615465636893475aCwyaae6s45

10
main.py
View File

@ -881,12 +881,16 @@ def settings_action(action):
#region Account
@app.route('/login')
def login():
wallets = account_module.listWallets()
wallets = render.wallets(wallets)
if 'message' in request.args:
return render_template("login.html", sync=account_module.getNodeSync(),
error=request.args.get("message"))
error=request.args.get("message"),wallets=wallets)
return render_template("login.html")
return render_template("login.html", sync=account_module.getNodeSync(),
wallets=wallets)
@app.route('/login', methods=["POST"])
def login_post():

View File

@ -171,4 +171,11 @@ def bids(bids,reveals):
else:
html += "<td>Unknown</td>"
html += "</tr>"
return html
def wallets(wallets):
html = ''
for wallet in wallets:
html += f'<option value="{wallet}">{wallet}</option>'
return html

View File

@ -31,7 +31,9 @@
<h4 class="text-dark mb-4">Welcome Back!</h4>
</div>
<form class="user" method="post">
<div class="mb-3"><input class="form-control form-control-user" type="text" placeholder="Enter Wallet Name..." name="account"></div>
<div class="mb-3"><select class="form-control form-select form-select-lg form-control-user" name="account" value="default">
{{wallets|safe}}
</select></div>
<div class="mb-3"><input class="form-control form-control-user" type="password" id="exampleInputPassword" placeholder="Password" name="password"></div><button class="btn btn-primary d-block btn-user w-100" type="submit">Login</button>
<hr>
</form>