feat: include device hostname in monitoring page and enhance event view toggle functionality
All checks were successful
CI / test (push) Successful in 7s

This commit is contained in:
Space-Banane
2026-05-27 21:29:33 +02:00
parent 595375e1a7
commit 52e09ce3b0
2 changed files with 77 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ from __future__ import annotations
import asyncio
import secrets
import socket
from contextlib import asynccontextmanager
from pathlib import Path
from typing import Any
@@ -89,6 +90,7 @@ def create_app(config: AppConfig | None = None) -> FastAPI:
app.state.db = db
app.state.ws_hub = ws_hub
app.state.manager = manager
device_hostname = socket.gethostname()
def _extract_token(
authorization: str | None,
@@ -196,7 +198,7 @@ def create_app(config: AppConfig | None = None) -> FastAPI:
if not app_config.disable_ui:
@app.get("/", response_class=HTMLResponse)
def ui_root() -> str:
return monitoring_page_html()
return monitoring_page_html(device_hostname=device_hostname)
@app.websocket("/ws")
async def ws_endpoint(websocket: WebSocket, token: str = Query(default="")) -> None: