diff --git a/FireWalletBrowser.bsdesign b/FireWalletBrowser.bsdesign index d89b3ef..fd14601 100644 Binary files a/FireWalletBrowser.bsdesign and b/FireWalletBrowser.bsdesign differ diff --git a/main.py b/main.py index dc456af..637a753 100644 --- a/main.py +++ b/main.py @@ -1509,6 +1509,30 @@ def api_hsd(function): return jsonify({"error": "Invalid function", "result": "Invalid function"}), 400 + +@app.route('/api/v1/hsd//mobile', methods=["GET"]) +def api_hsd_mobile(function): + # Check if the user is logged in + if request.cookies.get("account") is None: + return jsonify({"error": "Not logged in"}) + + account = account_module.check_account(request.cookies.get("account")) + if not account: + return jsonify({"error": "Invalid account"}) + + if function == "sync": + sync = account_module.getNodeSync() + if sync == 100: + # Don't show sync percentage on mobile + sync = "" + elif sync == -1: + sync = "HSD Error" + else: + sync = f"{sync}%" + return jsonify({"result": sync}) + + return jsonify({"error": "Invalid function", "result": "Invalid mobile function"}), 400 + @app.route('/api/v1/wallet/', methods=["GET"]) def api_wallet(function): # Check if the user is logged in @@ -1614,6 +1638,30 @@ def api_wallet(function): return send_file('templates/assets/img/HNS.png') return jsonify({"error": "Invalid function", "result": "Invalid function"}), 400 + +@app.route('/api/v1/wallet//mobile', methods=["GET"]) +def api_wallet_mobile(function): + # Check if the user is logged in + if request.cookies.get("account") is None: + return jsonify({"error": "Not logged in"}) + + account = account_module.check_account(request.cookies.get("account")) + password = request.cookies.get("account").split(":")[1] + if not account: + return jsonify({"error": "Invalid account"}) + + if function == "sync": + sync = account_module.getWalletStatus() + if sync == "Ready": + # Don't show sync percentage on mobile + sync = "" + elif sync == "Error wallet ahead of node": + sync = "HSW Sync Error" + else: + sync = "HSW Syncing" + return jsonify({"result": sync}) + + return jsonify({"error": "Invalid function", "result": "Invalid mobile function"}), 400 @app.route('/api/v1/icon/') def api_icon(account): diff --git a/templates/404.html b/templates/404.html index fd958bf..6083fd3 100644 --- a/templates/404.html +++ b/templates/404.html @@ -43,7 +43,7 @@
Sync: {{sync}}%Wallet: {{wallet_status}}Height: {{height}} + {{sync}}{{wallet_status}}Sync: {{sync}}%Wallet: {{wallet_status}}Height: {{height}}