Refactor render_env_page function to improve layout and remove unnecessary styles

This commit is contained in:
2026-05-16 22:45:16 +02:00
parent 27e4c461d6
commit b9164a3ab1
+1 -10
View File
@@ -128,14 +128,6 @@ def render_env_page(data_dir: Path) -> None:
st.subheader(ENV_PAGE)
st.caption(f"File: {env_path}")
st.markdown("""<style>
div[data-testid="stHorizontalBlock"] div[data-testid="stColumn"]:first-child {
flex: 0 0 160px !important; min-width: 160px !important; max-width: 160px !important;
}
div[data-testid="stHorizontalBlock"] div[data-testid="stColumn"]:last-child {
flex: 0 0 320px !important; min-width: 320px !important; max-width: 320px !important;
}
</style>""", unsafe_allow_html=True)
gen = st.session_state.get(gen_key, 0)
@@ -155,7 +147,7 @@ def render_env_page(data_dir: Path) -> None:
if wkey not in st.session_state:
raw = st.session_state[saved_key].get(var, "")
st.session_state[wkey] = raw == "1" if var == "KERBEROS_ENABLE" else raw
col_label, col_input = st.columns([1, 3])
col_label, col_input = st.columns([1, 2], width=480, vertical_alignment="center")
col_label.markdown(label)
if var == "KERBEROS_ENABLE":
col_input.toggle(label, key=wkey, label_visibility="collapsed")
@@ -210,7 +202,6 @@ def render_page(accounts_dir: Path, page_name: str) -> None:
edited = st.data_editor(
df,
width="stretch",
num_rows="dynamic",
column_config=column_config,
hide_index=True,