Basic Table
All checks were successful
Build and push Docker image at git tag / build (push) Successful in 1m44s
All checks were successful
Build and push Docker image at git tag / build (push) Successful in 1m44s
This commit is contained in:
@ -10,7 +10,10 @@
|
||||
|
||||
import os
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
from ums.management.interface import Interface
|
||||
@ -44,13 +47,21 @@ class WebMain():
|
||||
directory=TEMPLATE_PATH,
|
||||
auto_reload=True
|
||||
)
|
||||
self.template.env.globals["timestamp2date"] = lambda t: \
|
||||
datetime.fromtimestamp(t).strftime("%H:%M:%S %d.%m.%Y")
|
||||
|
||||
def _add_routers(self):
|
||||
interface_router = Interface(self.template, self.db)
|
||||
self.app.include_router(interface_router.router)
|
||||
|
||||
|
||||
def _add_routes(self):
|
||||
|
||||
@self.app.get("/index", response_class=HTMLResponse, summary="Link list")
|
||||
def index(request: Request):
|
||||
return self.template.TemplateResponse(
|
||||
'index.html',
|
||||
{"request" : request}
|
||||
)
|
||||
|
||||
@self.app.get("/test", summary="Test")
|
||||
def huhu(request: Request) -> AgentMessage:
|
||||
|
Reference in New Issue
Block a user