diff --git a/FireWalletBrowser.bsdesign b/FireWalletBrowser.bsdesign index 1c9e2f6..d17425c 100644 Binary files a/FireWalletBrowser.bsdesign and b/FireWalletBrowser.bsdesign differ diff --git a/main.py b/main.py index 678db3a..9a46a6e 100644 --- a/main.py +++ b/main.py @@ -1146,7 +1146,25 @@ def settings_action(action): return redirect("/settings?error=Invalid action") +@app.route('/settings/upload', methods=['POST']) +def upload_image(): + if not 'account' in request.cookies: + return redirect("/login?message=Not logged in") + + account = request.cookies.get("account") + if not os.path.exists('user_data/images'): + os.mkdir('user_data/images') + + if 'image' not in request.files: + return redirect("/settings?error=No file selected") + file = request.files['image'] + if file.filename == '': + return redirect("/settings?error=No file selected") + if file: + filepath = os.path.join(f'user_data/images/{account.split(":")[0]}.{file.filename.split(".")[-1]}') + file.save(filepath) + return redirect("/settings?success=File uploaded successfully") #endregion @@ -1159,7 +1177,6 @@ def login(): if 'message' in request.args: return render_template("login.html", - error=request.args.get("message"),wallets=wallets) return render_template("login.html", @@ -1497,17 +1514,32 @@ def api_wallet(function): if function == "domains": domains = account_module.getDomains(account) if 'error' in domains: - return jsonify({"result": [], "error": domains['error']}) - - - + return jsonify({"result": [], "error": domains['error']}) return jsonify({"result": domains}) - - + + if function == "icon": + # Check if there is an icon + if not os.path.exists(f'user_data/images'): + return send_file('templates/assets/img/HNS.png') + files = os.listdir(f'user_data/images') + for file in files: + if file.startswith(account): + return send_file(f'user_data/images/{file}') + + return send_file('templates/assets/img/HNS.png') return jsonify({"error": "Invalid function", "result": "Invalid function"}), 400 - +@app.route('/api/v1/icon/') +def api_icon(account): + if not os.path.exists(f'user_data/images'): + return send_file('templates/assets/img/HNS.png') + files = os.listdir(f'user_data/images') + for file in files: + if file.startswith(account): + return send_file(f'user_data/images/{file}') + + return send_file('templates/assets/img/HNS.png') #endregion diff --git a/templates/404.html b/templates/404.html index 17352dd..a5f4a58 100644 --- a/templates/404.html +++ b/templates/404.html @@ -55,7 +55,7 @@ diff --git a/templates/auction.html b/templates/auction.html index 038b360..04c4606 100644 --- a/templates/auction.html +++ b/templates/auction.html @@ -55,7 +55,7 @@ diff --git a/templates/auctions.html b/templates/auctions.html index cdecef5..c40a5e2 100644 --- a/templates/auctions.html +++ b/templates/auctions.html @@ -55,7 +55,7 @@ diff --git a/templates/confirm-password.html b/templates/confirm-password.html index fa7a62d..b64240c 100644 --- a/templates/confirm-password.html +++ b/templates/confirm-password.html @@ -55,7 +55,7 @@ diff --git a/templates/confirm.html b/templates/confirm.html index 30aa18f..cd08413 100644 --- a/templates/confirm.html +++ b/templates/confirm.html @@ -55,7 +55,7 @@ diff --git a/templates/index.html b/templates/index.html index f503510..b510a3a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -55,7 +55,7 @@ diff --git a/templates/login.html b/templates/login.html index e5f0e34..ee3eb1e 100644 --- a/templates/login.html +++ b/templates/login.html @@ -32,9 +32,21 @@

Welcome Back!

-
{{wallets|safe}} -
+ + +

diff --git a/templates/manage.html b/templates/manage.html index 2a21f5a..c29521f 100644 --- a/templates/manage.html +++ b/templates/manage.html @@ -55,7 +55,7 @@ diff --git a/templates/message.html b/templates/message.html index 8c1757f..7146d23 100644 --- a/templates/message.html +++ b/templates/message.html @@ -55,7 +55,7 @@ diff --git a/templates/plugin-output.html b/templates/plugin-output.html index fd40029..d968fd6 100644 --- a/templates/plugin-output.html +++ b/templates/plugin-output.html @@ -55,7 +55,7 @@ diff --git a/templates/plugin.html b/templates/plugin.html index 88c57a1..f8b20f0 100644 --- a/templates/plugin.html +++ b/templates/plugin.html @@ -55,7 +55,7 @@ diff --git a/templates/plugins.html b/templates/plugins.html index 6f6b0b8..7e6760d 100644 --- a/templates/plugins.html +++ b/templates/plugins.html @@ -55,7 +55,7 @@ diff --git a/templates/receive.html b/templates/receive.html index 100096e..162a76c 100644 --- a/templates/receive.html +++ b/templates/receive.html @@ -55,7 +55,7 @@ diff --git a/templates/search.html b/templates/search.html index 2614b3c..ec50a3d 100644 --- a/templates/search.html +++ b/templates/search.html @@ -55,7 +55,7 @@ diff --git a/templates/send.html b/templates/send.html index 15b662f..4ea379f 100644 --- a/templates/send.html +++ b/templates/send.html @@ -55,7 +55,7 @@ diff --git a/templates/settings.html b/templates/settings.html index 9185d79..a7043ce 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -56,7 +56,7 @@ @@ -101,6 +101,17 @@

xPub Key

Get your xPub key +
  • +
    +
    +

    Account Icon

    Customise your account +
    +
    +
  • diff --git a/templates/success.html b/templates/success.html index 9358a3d..346149e 100644 --- a/templates/success.html +++ b/templates/success.html @@ -55,7 +55,7 @@ diff --git a/templates/tx.html b/templates/tx.html index 5008d56..6053291 100644 --- a/templates/tx.html +++ b/templates/tx.html @@ -55,7 +55,7 @@