diff --git a/deploy/lyra-web.service b/deploy/lyra-web.service new file mode 100644 index 0000000..9df6cf5 --- /dev/null +++ b/deploy/lyra-web.service @@ -0,0 +1,13 @@ +[Unit] +Description=Lyra web chat server (FastAPI + vendored UI) + +[Service] +Type=simple +WorkingDirectory=/home/serversdown/project-lyra +UnsetEnvironment=VIRTUAL_ENV +ExecStart=/home/serversdown/.local/bin/uv run lyra-web +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target diff --git a/lyra/web/server.py b/lyra/web/server.py index b684401..6a428cc 100644 --- a/lyra/web/server.py +++ b/lyra/web/server.py @@ -15,7 +15,7 @@ import time from pathlib import Path from fastapi import FastAPI, Request -from fastapi.responses import StreamingResponse +from fastapi.responses import FileResponse, StreamingResponse from fastapi.staticfiles import StaticFiles from lyra import chat, logbus, memory, summary @@ -110,6 +110,11 @@ def create_app() -> FastAPI: ], } + @app.get("/logs") + async def logs_page() -> FileResponse: + """Full-page, mobile-friendly live log viewer (separate from the chat UI).""" + return FileResponse(str(_STATIC / "logs.html")) + @app.get("/stream/logs") async def stream_logs(request: Request) -> StreamingResponse: """Live activity feed: replay the recent buffer, then stream new events.""" diff --git a/lyra/web/static/index.html b/lyra/web/static/index.html index 411c737..da75ca9 100644 --- a/lyra/web/static/index.html +++ b/lyra/web/static/index.html @@ -69,6 +69,7 @@ + ⛶ Full Log diff --git a/lyra/web/static/logs.html b/lyra/web/static/logs.html new file mode 100644 index 0000000..2ac2623 --- /dev/null +++ b/lyra/web/static/logs.html @@ -0,0 +1,239 @@ + + + + + + + Lyra — Live Log + + + +
+
+ +

Lyra · Live Log

+ ← Chat + 0 +
+
+
+ info + debug + error + system +
+ + + + +
+
+ +
+
📡 Waiting for activity…
+
+ + + +