2022-02-07 13:22:43 +00:00
|
|
|
from http import HTTPStatus
|
|
|
|
|
|
|
|
from fastapi import Request
|
|
|
|
from fastapi.param_functions import Query
|
|
|
|
from fastapi.params import Depends
|
|
|
|
from fastapi.templating import Jinja2Templates
|
|
|
|
from starlette.exceptions import HTTPException
|
|
|
|
from starlette.responses import HTMLResponse
|
|
|
|
|
|
|
|
from lnbits.core.crud import update_payment_status
|
|
|
|
from lnbits.core.models import User
|
|
|
|
from lnbits.core.views.api import api_payment
|
|
|
|
from lnbits.decorators import check_user_exists
|
|
|
|
|
|
|
|
from . import nostr_ext, nostr_renderer
|
|
|
|
|
|
|
|
templates = Jinja2Templates(directory="templates")
|
|
|
|
|
|
|
|
|
|
|
|
@nostr_ext.get("/", response_class=HTMLResponse)
|
|
|
|
async def index(request: Request, user: User = Depends(check_user_exists)):
|
|
|
|
return nostr_renderer().TemplateResponse(
|
2022-02-08 10:35:20 +00:00
|
|
|
"nostradmin/index.html", {"request": request, "user": user.dict()}
|
2022-02-07 13:22:43 +00:00
|
|
|
)
|