mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2024-12-14 14:05:36 +03:00
Added option for admins to hide the server and browser settings form the Settings page. (#1618)
This commit is contained in:
commit
1edaccfeb5
@ -65,6 +65,10 @@ general:
|
||||
update_preview: True
|
||||
update_preview_frequency: 10
|
||||
|
||||
admin:
|
||||
hide_server_setting: False
|
||||
hide_browser_setting: False
|
||||
|
||||
debug:
|
||||
enable_hydralit: False
|
||||
|
||||
|
@ -213,6 +213,8 @@ def layout():
|
||||
help="Defaut theme to use as base for streamlit. Default: dark")
|
||||
st.session_state["streamlit_config"]["theme"]["base"] = st.session_state["defaults"].general.default_theme
|
||||
|
||||
|
||||
if not st.session_state['defaults'].admin.hide_server_setting:
|
||||
with st.expander("Server", True):
|
||||
|
||||
st.session_state["streamlit_config"]['server']['headless'] = st.checkbox("Run Headless", help="If false, will attempt to open a browser window on start. \
|
||||
@ -246,6 +248,7 @@ def layout():
|
||||
st.session_state["streamlit_config"]['server']['enableWebsocketCompression'] = st.checkbox("Enable Websocket Compression",
|
||||
value=st.session_state["streamlit_config"]['server']['enableWebsocketCompression'],
|
||||
help=" Enables support for websocket compression. Default: false")
|
||||
if not st.session_state['defaults'].admin.hide_browser_setting:
|
||||
with st.expander("Browser", expanded=True):
|
||||
st.session_state["streamlit_config"]['browser']['serverAddress'] = st.text_input("Server Address",
|
||||
value=st.session_state["streamlit_config"]['browser']['serverAddress'],
|
||||
@ -264,9 +267,6 @@ def layout():
|
||||
- Show the URL on the terminal - Open the browser \
|
||||
Default: whatever value is set in server.port.")
|
||||
|
||||
|
||||
|
||||
|
||||
with col5:
|
||||
st.title("Huggingface")
|
||||
st.session_state["defaults"].general.huggingface_token = st.text_input("Huggingface Token", value=st.session_state['defaults'].general.huggingface_token, type="password",
|
||||
|
Loading…
Reference in New Issue
Block a user