generated from nathanwoodburn/python-webserver-template
feat: Update some styling
All checks were successful
Build Docker / BuildImage (push) Successful in 28s
All checks were successful
Build Docker / BuildImage (push) Successful in 28s
This commit is contained in:
parent
ef2b7611ed
commit
e9bad16917
10
server.py
10
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/<path:path>", 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)
|
||||
|
||||
|
@ -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;
|
||||
}
|
@ -10,6 +10,12 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="header">
|
||||
<div class="logo">
|
||||
<img src="/assets/img/favicon.png" alt="Woodburn" width="50" height="50">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="centre">
|
||||
<h2 style="color: red;">{{error}}</h2>
|
||||
@ -23,6 +29,9 @@
|
||||
<button type="submit">Renew</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<a href="https://nathan.woodburn.au" target="_blank">Nathan.Woodburn/</a>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user