2021-08-20 12:44:03 +01:00
|
|
|
from quart import g, abort, render_template
|
|
|
|
from http import HTTPStatus
|
|
|
|
|
|
|
|
from lnbits.decorators import check_user_exists, validate_uuids
|
|
|
|
|
|
|
|
from . import watchonly_ext
|
2021-08-21 01:55:07 +01:00
|
|
|
from fastapi import FastAPI, Request
|
|
|
|
from fastapi.templating import Jinja2Templates
|
2021-08-20 12:44:03 +01:00
|
|
|
|
2021-08-21 01:55:07 +01:00
|
|
|
templates = Jinja2Templates(directory="templates")
|
2021-08-20 12:44:03 +01:00
|
|
|
|
2021-08-20 20:12:03 +01:00
|
|
|
@watchonly_ext.get("/")
|
2021-08-20 12:44:03 +01:00
|
|
|
@validate_uuids(["usr"], required=True)
|
|
|
|
@check_user_exists()
|
2021-08-21 01:55:07 +01:00
|
|
|
async def index(request: Request):
|
2021-08-21 02:05:45 +01:00
|
|
|
return await templates.TemplateResponse("watchonly/index.html", {"request":request,"user":g.user})
|
2021-08-20 12:44:03 +01:00
|
|
|
|