From b721a1440240e82a8d0b838050662820591a4303 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Mon, 13 Nov 2023 16:06:32 -0800 Subject: [PATCH] saving progress --- lwsadmin/lws/routes/htmx.py | 11 ++++++++++- lwsadmin/lws/routes/wallet.py | 16 ++++------------ lwsadmin/lws/static/main.css | 14 ++++++++++++++ lwsadmin/lws/templates/htmx/import_wallet.html | 9 +++++---- lwsadmin/lws/templates/htmx/set_height.html | 14 ++++++++++++++ lwsadmin/lws/templates/htmx/show_wallets.html | 10 +++++++--- 6 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 lwsadmin/lws/templates/htmx/set_height.html diff --git a/lwsadmin/lws/routes/htmx.py b/lwsadmin/lws/routes/htmx.py index 8d39828..ec27110 100644 --- a/lwsadmin/lws/routes/htmx.py +++ b/lwsadmin/lws/routes/htmx.py @@ -36,6 +36,16 @@ async def label_wallet(): label=label ) +@bp.route("/set_height") +async def set_height(): + address = request.args.get("address") + height = request.args.get("height") + return await render_template( + "htmx/set_height.html", + address=address, + height=height + ) + @bp.route("/show_wallets") @login_required async def show_wallets(): @@ -46,7 +56,6 @@ async def show_wallets(): del accounts["hidden"] # make wallets if they don't exist for status in accounts: - print(status) for account in accounts[status]: w = Wallet.select().where(Wallet.address == account["address"]).first() if not w: diff --git a/lwsadmin/lws/routes/wallet.py b/lwsadmin/lws/routes/wallet.py index a2dd786..d3e8ae8 100644 --- a/lwsadmin/lws/routes/wallet.py +++ b/lwsadmin/lws/routes/wallet.py @@ -49,19 +49,11 @@ async def add(): return "" -@bp.route("/wallet/rescan") +@bp.route("/wallet/
/rescan/") @login_required -async def rescan(): - address = request.args.get("address") - height = request.args.get("height") - if not address or not height: - await flash("you need to provide both address and height") - return redirect("/") - if lws.rescan(address, int(height)): - await flash(f"rescanning {address} from block {height}") - else: - await flash("probz") - return redirect(f"/") +async def rescan(address, height): + lws.rescan(address, int(height)) + return redirect(url_for("htmx.show_wallets")) @bp.route("/wallet/
/") diff --git a/lwsadmin/lws/static/main.css b/lwsadmin/lws/static/main.css index c7f8c54..4ac36de 100644 --- a/lwsadmin/lws/static/main.css +++ b/lwsadmin/lws/static/main.css @@ -35,4 +35,18 @@ input { .htmx-request.indicator{ display:inline; +} + +.underline { + text-decoration: underline dotted; +} + +#show_wallets { + animation-name: example; + animation-duration: 4s; +} + +@keyframes example { + from {background-color: red;} + to {background-color: yellow;} } \ No newline at end of file diff --git a/lwsadmin/lws/templates/htmx/import_wallet.html b/lwsadmin/lws/templates/htmx/import_wallet.html index 7b75f72..df61d05 100644 --- a/lwsadmin/lws/templates/htmx/import_wallet.html +++ b/lwsadmin/lws/templates/htmx/import_wallet.html @@ -1,8 +1,9 @@
- - - - + + + +

12, 13, or 25 word seeds

+ diff --git a/lwsadmin/lws/templates/htmx/set_height.html b/lwsadmin/lws/templates/htmx/set_height.html new file mode 100644 index 0000000..c812445 --- /dev/null +++ b/lwsadmin/lws/templates/htmx/set_height.html @@ -0,0 +1,14 @@ + + +
+ \ 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 569e92e..2856d8f 100644 --- a/lwsadmin/lws/templates/htmx/show_wallets.html +++ b/lwsadmin/lws/templates/htmx/show_wallets.html @@ -33,12 +33,12 @@
- {{ account['address'] | find_label }} + {{ account['address'] | find_label }}
- {{ status | upper }} + {{ status | capitalize }} @@ -50,7 +50,11 @@ {{ account['address'] | shorten }} - {{ account['scan_height'] }} +
+ {{ account['scan_height'] }} + + +
{% endfor %}