SLM return to project button added.

This commit is contained in:
serversdwn
2026-01-13 18:57:31 +00:00
parent d93785c230
commit e9216b9abc
8 changed files with 588 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse, FileResponse, JSONResponse
from fastapi.exceptions import RequestValidationError
from sqlalchemy.orm import Session
from typing import List, Dict
from typing import List, Dict, Optional
from pydantic import BaseModel
# Configure logging
@@ -158,11 +158,24 @@ async def sound_level_meters_page(request: Request):
@app.get("/slm/{unit_id}", response_class=HTMLResponse)
async def slm_legacy_dashboard(request: Request, unit_id: str):
async def slm_legacy_dashboard(
request: Request,
unit_id: str,
from_project: Optional[str] = None,
db: Session = Depends(get_db)
):
"""Legacy SLM control center dashboard for a specific unit"""
# Get project details if from_project is provided
project = None
if from_project:
from backend.models import Project
project = db.query(Project).filter_by(id=from_project).first()
return templates.TemplateResponse("slm_legacy_dashboard.html", {
"request": request,
"unit_id": unit_id
"unit_id": unit_id,
"from_project": from_project,
"project": project
})