feat: include device hostname in monitoring page and enhance event view toggle functionality
All checks were successful
CI / test (push) Successful in 7s
All checks were successful
CI / test (push) Successful in 7s
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user