diff --git a/lwsadmin/lws/helpers.py b/lwsadmin/lws/helpers.py index d02df8b..a5495a7 100644 --- a/lwsadmin/lws/helpers.py +++ b/lwsadmin/lws/helpers.py @@ -18,15 +18,6 @@ from lws import config # webhook_delete_uuid: {"event_ids": [...]} # webhook_list: {} -def get_height() -> int: - try: - r = requests.get(f"{config.MONEROD_URL}/get_info") - print(r.content) - return int(r.json()["height"]) - except Exception as e: - print(e) - return 0 - class LWS: def __init__(self): pass diff --git a/lwsadmin/lws/routes/htmx.py b/lwsadmin/lws/routes/htmx.py index aab9b1a..fb4f15b 100644 --- a/lwsadmin/lws/routes/htmx.py +++ b/lwsadmin/lws/routes/htmx.py @@ -23,11 +23,13 @@ async def create_wallet(): svk=seed.secret_view_key() ) + @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""" @@ -39,6 +41,7 @@ async def label_wallet(): label=label ) + @bp.route("/set_height") async def set_height(): """Setting a new height to scan from""" @@ -50,6 +53,7 @@ async def set_height(): height=height ) + @bp.route("/show_wallets") @login_required async def show_wallets(): @@ -73,4 +77,4 @@ async def show_wallets(): "htmx/show_wallets.html", accounts=accounts, requests=requests - ) \ No newline at end of file + ) diff --git a/lwsadmin/lws/routes/wallet.py b/lwsadmin/lws/routes/wallet.py index d81a81f..aec9293 100644 --- a/lwsadmin/lws/routes/wallet.py +++ b/lwsadmin/lws/routes/wallet.py @@ -1,7 +1,7 @@ import monero.address from monero.seed import Seed -from quart import Blueprint, render_template, request, flash, redirect, url_for -from quart_auth import login_required, current_user +from quart import Blueprint, request, flash, redirect, url_for +from quart_auth import login_required from lws.helpers import lws from lws.models import Wallet, get_random_words @@ -15,7 +15,6 @@ bp = Blueprint("wallet", "wallet") async def add(): form = await request.form if form: - address = None label = form.get("label") seed = form.get("seed") restore_height = form.get("restore_height", None) @@ -29,7 +28,7 @@ async def add(): svk = str(seed.secret_view_key()) lws.add_wallet(address, svk) if restore_height != "-1": - lws.rescan(address, str(restore_height)) + lws.rescan(address, int(restore_height)) w = Wallet( address=seed.public_address(), label=label if label else get_random_words() diff --git a/lwsadmin/lws/templates/htmx/create_wallet.html b/lwsadmin/lws/templates/htmx/create_wallet.html index 464eb27..c6d3975 100644 --- a/lwsadmin/lws/templates/htmx/create_wallet.html +++ b/lwsadmin/lws/templates/htmx/create_wallet.html @@ -11,8 +11,8 @@ + - \ No newline at end of file + document.getElementById('label-input-{{ address }}').focus(); + + \ No newline at end of file diff --git a/lwsadmin/lws/templates/htmx/set_height.html b/lwsadmin/lws/templates/htmx/set_height.html index c812445..ef8b3ae 100644 --- a/lwsadmin/lws/templates/htmx/set_height.html +++ b/lwsadmin/lws/templates/htmx/set_height.html @@ -1,14 +1,16 @@ -
- -
- \ No newline at end of file + document.getElementById('height-input-{{ address }}').focus(); + + \ No newline at end of file diff --git a/lwsadmin/lws/templates/htmx/show_wallets.html b/lwsadmin/lws/templates/htmx/show_wallets.html index afc1bc0..6a3dbb4 100644 --- a/lwsadmin/lws/templates/htmx/show_wallets.html +++ b/lwsadmin/lws/templates/htmx/show_wallets.html @@ -19,7 +19,6 @@ - @@ -53,7 +52,6 @@
{{ account['scan_height'] }} -