Split monitor UI into separate HTML and JS assets
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:
@@ -15,7 +15,7 @@ from pydantic import BaseModel, Field
|
||||
from .config import AppConfig, load_app_config
|
||||
from .storage import HistoryDB
|
||||
from .task_manager import JobManager
|
||||
from .ui import monitoring_page_html
|
||||
from .ui import monitoring_js_path, monitoring_page_html
|
||||
|
||||
|
||||
class CreateJobRequest(BaseModel):
|
||||
@@ -387,6 +387,10 @@ def create_app(config: AppConfig | None = None) -> FastAPI:
|
||||
def ui_root() -> str:
|
||||
return monitoring_page_html(device_hostname=device_hostname)
|
||||
|
||||
@app.get("/ui/monitoring.js")
|
||||
def ui_monitoring_js() -> FileResponse:
|
||||
return FileResponse(str(monitoring_js_path()), media_type="application/javascript")
|
||||
|
||||
@app.websocket("/ws")
|
||||
async def ws_endpoint(websocket: WebSocket, token: str = Query(default="")) -> None:
|
||||
if not token or not secrets.compare_digest(token, app_config.screenjob_token):
|
||||
|
||||
Reference in New Issue
Block a user