feat: dedicated /log page with journal-backed history and nav item

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 15:20:17 -04:00
co-authored by Claude Fable 5
parent 7591268a89
commit 36adad5b3b
3 changed files with 247 additions and 0 deletions
+22
View File
@@ -793,6 +793,27 @@ async def start(
)
return web.Response(text=body, content_type="text/html")
async def log_page(request):
"""Render the event log page."""
current_user, _ = _require_auth_redirect(request)
pkg_dir = os.path.dirname(__file__)
templates_dir = config.get("templates_dir", os.path.join(pkg_dir, "templates"))
env = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir), autoescape=True)
host = request.host # includes port if non-standard
forwarded_proto = request.headers.get("X-Forwarded-Proto", "")
is_secure = request.secure or forwarded_proto.lower() == "https"
scheme = "wss" if is_secure else "ws"
heartbeat_ws_url = f"{scheme}://{host}/ws"
tmpl = env.get_template("log.html")
body = tmpl.render(
title="Log - Heartbeat",
header="Log",
heartbeat_ws_url=heartbeat_ws_url,
current_user=current_user.to_dict() if current_user else None,
active_page="log",
)
return web.Response(text=body, content_type="text/html")
# -------------------------------------------------------------------------
# Auth endpoints
# -------------------------------------------------------------------------
@@ -1836,6 +1857,7 @@ async def start(
web.get("/live", live),
web.get("/plugins", plugins_page),
web.get("/alerts", alerts_page),
web.get("/log", log_page),
web.get("/about", about_page),
web.get("/profile", profile_page),
web.get("/settings", settings_page),