mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-26 23:51:55 +01:00
27 lines
781 B
Python
27 lines
781 B
Python
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,
|
|
domain_desc=domain.description,
|
|
domain_cost=domain.cost,
|
|
)
|