feat: show version tag in sidebar footer
This commit is contained in:
parent
4a8910540b
commit
a8bee0dc0c
1 changed files with 14 additions and 0 deletions
14
app/app.py
14
app/app.py
|
|
@ -8,6 +8,7 @@ Run: streamlit run app/app.py
|
||||||
bash scripts/manage-ui.sh start
|
bash scripts/manage-ui.sh start
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
@ -138,7 +139,20 @@ def _task_indicator():
|
||||||
detail = f" · {stage}" if stage else (f" — {t.get('company')}" if t.get("company") else "")
|
detail = f" · {stage}" if stage else (f" — {t.get('company')}" if t.get("company") else "")
|
||||||
st.caption(f"{icon} {label}{detail}")
|
st.caption(f"{icon} {label}{detail}")
|
||||||
|
|
||||||
|
@st.cache_resource
|
||||||
|
def _get_version() -> str:
|
||||||
|
try:
|
||||||
|
return subprocess.check_output(
|
||||||
|
["git", "describe", "--tags", "--always"],
|
||||||
|
cwd=Path(__file__).parent.parent,
|
||||||
|
text=True,
|
||||||
|
).strip()
|
||||||
|
except Exception:
|
||||||
|
return "dev"
|
||||||
|
|
||||||
with st.sidebar:
|
with st.sidebar:
|
||||||
_task_indicator()
|
_task_indicator()
|
||||||
|
st.divider()
|
||||||
|
st.caption(f"Peregrine {_get_version()}")
|
||||||
|
|
||||||
pg.run()
|
pg.run()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue