add element web
This commit is contained in:
parent
98417edd8b
commit
000ec5d25f
9 changed files with 209 additions and 236 deletions
5
main.py
5
main.py
|
|
@ -19,6 +19,7 @@ BOOKSTACK_PORT = os.environ.get("BOOKSTACK_PORT", "6875")
|
|||
OPENWEBUI_PORT = os.environ.get("OPENWEBUI_PORT", "8080")
|
||||
PORTAINER_PORT = os.environ.get("PORTAINER_PORT", "9000")
|
||||
FORGEJO_PORT = os.environ.get("FORGEJO_PORT", "3003")
|
||||
ELEMENT_PORT = os.environ.get("ELEMENT_PORT", "8082")
|
||||
|
||||
# Courses CSV path
|
||||
COURSES_CSV = Path("data/courses.csv")
|
||||
|
|
@ -86,6 +87,7 @@ async def welcome(request: Request):
|
|||
"openwebui_port": OPENWEBUI_PORT,
|
||||
"portainer_port": PORTAINER_PORT,
|
||||
"forgejo_port": FORGEJO_PORT,
|
||||
"element_port": ELEMENT_PORT,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
@ -120,7 +122,8 @@ async def cost_dashboard(request: Request):
|
|||
|
||||
@app.post("/upload")
|
||||
async def upload_file(request: Request, file: UploadFile = File(...)):
|
||||
if not allowed_file(file.filename):
|
||||
# Ensure filename is present (UploadFile.filename can be None) before validation
|
||||
if not file.filename or not allowed_file(file.filename):
|
||||
return templates.TemplateResponse(
|
||||
"cost-calculator.html",
|
||||
{"request": request, "error": "Unsupported file type. Only PDF allowed."},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue