From 1921691040f551671d8f9bf79786ef7472e35937 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Mon, 13 Nov 2023 23:21:47 -0800 Subject: [PATCH] cleanup --- lwsadmin/lws/config.py | 5 ++++- lwsadmin/lws/routes/htmx.py | 7 ++++++- lwsadmin/lws/routes/wallet.py | 6 +++--- lwsadmin/lws/templates/htmx/create_wallet.html | 4 ++-- lwsadmin/lws/templates/htmx/import_wallet.html | 2 +- lwsadmin/lws/templates/htmx/mouse.html | 1 - lwsadmin/lws/templates/htmx/show_wallets.html | 9 +++++---- lwsadmin/lws/templates/index.html | 6 ++++++ 8 files changed, 27 insertions(+), 13 deletions(-) delete mode 100644 lwsadmin/lws/templates/htmx/mouse.html diff --git a/lwsadmin/lws/config.py b/lwsadmin/lws/config.py index 506f082..ec99c9e 100644 --- a/lwsadmin/lws/config.py +++ b/lwsadmin/lws/config.py @@ -19,4 +19,7 @@ LWS_URL = env.get("LWS_URL", "http://127.0.0.1:8080") LWS_ADMIN_URL = env.get("LWS_ADMIN_URL", "http://127.0.0.1:8081") # Monerod -MONEROD_URL = env.get("MONEROD_URL", "http://singapore.node.xmr.pm:18089") \ No newline at end of file +MONEROD_URL = env.get("MONEROD_URL", "http://singapore.node.xmr.pm:18089") + +# MyMonero +MYMONERO_URL = env.get("MYMONERO_URL", "http://localhost:9110") \ No newline at end of file diff --git a/lwsadmin/lws/routes/htmx.py b/lwsadmin/lws/routes/htmx.py index ec27110..aab9b1a 100644 --- a/lwsadmin/lws/routes/htmx.py +++ b/lwsadmin/lws/routes/htmx.py @@ -11,6 +11,7 @@ bp = Blueprint('htmx', 'htmx', url_prefix="/htmx") @bp.route("/create_wallet") async def create_wallet(): + """Creating a new wallet with newly generated seeds""" seed = Seed() return await render_template( "htmx/create_wallet.html", @@ -24,10 +25,12 @@ async def create_wallet(): @bp.route("/import_wallet") async def import_wallet(): + """Importing an existing wallet""" return await render_template("htmx/import_wallet.html") @bp.route("/label_wallet") async def label_wallet(): + """Changing the label on a stored wallet""" address = request.args.get("address") label = request.args.get("label") return await render_template( @@ -38,6 +41,7 @@ async def label_wallet(): @bp.route("/set_height") async def set_height(): + """Setting a new height to scan from""" address = request.args.get("address") height = request.args.get("height") return await render_template( @@ -49,12 +53,13 @@ async def set_height(): @bp.route("/show_wallets") @login_required async def show_wallets(): + """Showing all wallets in the database in a table""" admin = User.select().first() lws.init(admin.view_key) accounts = lws.list_accounts() if 'hidden' in accounts: del accounts["hidden"] - # make wallets if they don't exist + # save wallets if they don't exist in the db for status in accounts: for account in accounts[status]: w = Wallet.select().where(Wallet.address == account["address"]).first() diff --git a/lwsadmin/lws/routes/wallet.py b/lwsadmin/lws/routes/wallet.py index 51f354a..d81a81f 100644 --- a/lwsadmin/lws/routes/wallet.py +++ b/lwsadmin/lws/routes/wallet.py @@ -45,21 +45,21 @@ async def rescan(address, height): return redirect(url_for("htmx.show_wallets")) -@bp.route("/wallet/
/") +@bp.route("/wallet/
/modify/") @login_required async def modify(address, status): lws.modify_wallet(address, status) return redirect(url_for("htmx.show_wallets")) -@bp.route("/wallet/
/approve") +@bp.route("/wallet/
/accept") @login_required async def accept(address): lws.accept_request(address) return redirect(url_for("htmx.show_wallets")) -@bp.route("/wallet/
/deny") +@bp.route("/wallet/
/reject") @login_required async def reject(address): lws.reject_request(address) diff --git a/lwsadmin/lws/templates/htmx/create_wallet.html b/lwsadmin/lws/templates/htmx/create_wallet.html index 53a2393..464eb27 100644 --- a/lwsadmin/lws/templates/htmx/create_wallet.html +++ b/lwsadmin/lws/templates/htmx/create_wallet.html @@ -1,5 +1,5 @@
-
+

Seed: {{ seed }}

@@ -11,8 +11,8 @@ - +