From e9bad16917497d5405124d38a9d3eece904dbe82 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 3 Oct 2024 15:33:08 +1000 Subject: [PATCH] feat: Update some styling --- server.py | 10 ++++++++-- templates/assets/css/index.css | 23 +++++++++++++++++++++++ templates/index.html | 9 +++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index b5576cc..20296ec 100644 --- a/server.py +++ b/server.py @@ -118,7 +118,7 @@ def renew(): if req["data"]["owner_tx_data"]["address"] not in allowed_owners: return redirect("/?error=not_anyone") - return redirect(f"https://pay.hns.au/p/renew?amount=10&data={domain}&redirect=https://renew.hns.au/?message=Success:%20the%20domain%20will%20renew%20soon") + return redirect(f"https://pay.hns.au/p/renew?amount=10&data={domain}&redirect=https://renew.hns.au/?message=Pending:%20The%20domain%20will%20renew%20when%20the%20payment%20has%20arrived") @app.route("/renew/", methods=["POST"]) def renew_path(path: str): @@ -151,7 +151,13 @@ def renew_path(path: str): # Send discord webhook webhook = os.getenv("DISCORD") if webhook: - requests.post(webhook, json={"content": json.dumps(output)}) + # Parse output + message = "Renewing " + data["data"] + if req["output"]["error"] != "": + message += "\n\nError: " + req["output"]["error"] + message += "\n\nTX: https://hns.cymon.de/tx/" + req["output"]["output"].split("'")[1] + + requests.post(webhook, json={"content": json.dumps(message)}) return jsonify(output) diff --git a/templates/assets/css/index.css b/templates/assets/css/index.css index 9635f9c..7428417 100644 --- a/templates/assets/css/index.css +++ b/templates/assets/css/index.css @@ -17,4 +17,27 @@ a { } a:hover { text-decoration: underline; +} +.footer { + position: fixed; + bottom: 0; + width: 100%; + height: 50px; + text-align: center; +} +input { + padding: 10px; + + border-radius: 5px; + border: 1px solid #000000; +} +button { + padding: 10px; + border-radius: 5px; + border: 1px solid #000000; +} +button:hover { + background-color: #000000; + color: #ffffff; + border: 1px solid #ffffff; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 2601c18..3cb95cb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10,6 +10,12 @@ +
+ + +

{{error}}

@@ -23,6 +29,9 @@
+ \ No newline at end of file