"""Logs tab: tail any run log.""" from __future__ import annotations import streamlit as st from web.views.common import S def render() -> None: log_files = sorted(S.log_dir.glob("*.log"), reverse=True) if S.log_dir.exists() else [] if not log_files: st.info("No logs yet.") return choice = st.selectbox("Log file", [f.name for f in log_files]) n = st.slider("Lines", 20, 1000, 200, 20) text = (S.log_dir / choice).read_text().splitlines()[-n:] st.code("\n".join(text), language="text")