subdomains public window

This commit is contained in:
Kristjan
2020-12-29 19:16:04 +01:00
parent e96ec08f44
commit c0d7371137
4 changed files with 191 additions and 4 deletions
+17 -2
View File
@@ -1,12 +1,27 @@
from quart import g, render_template
from quart import g, abort, render_template
from lnbits.decorators import check_user_exists, validate_uuids
from http import HTTPStatus
from . import subdomains_ext
from .crud import get_domain
@subdomains_ext.route("/")
@validate_uuids(["usr"], required=True)
@check_user_exists()
async def index():
return await render_template("subdomains/index.html", user=g.user)
@subdomains_ext.route("/<domain_id>")
async def display(domain_id):
domain = await get_domain(domain_id)
if not domain:
abort(HTTPStatus.NOT_FOUND, "Domain does not exist.")
return await render_template(
"subdomains/display.html",
domain_id=domain.id,
domain_domain=domain.domain,
form_desc=domain.description,
form_cost=domain.cost,
)