refactor
This commit is contained in:
11
stand.py
11
stand.py
@ -4,7 +4,7 @@ from st_aggrid import AgGrid, GridOptionsBuilder
|
||||
import hacks
|
||||
|
||||
from restapi import restapi
|
||||
from utils.st_utils import get_session_id, rerun
|
||||
from utils.st_utils import get_session_id, rerun, hide_UI_elements
|
||||
from utils.df_utils import to_excel_binary
|
||||
|
||||
|
||||
@ -14,14 +14,7 @@ st.set_page_config(
|
||||
layout="wide"
|
||||
)
|
||||
|
||||
hide_st_style = """
|
||||
<style>
|
||||
#MainMenu {visibility: hidden;}
|
||||
footer {visibility: hidden;}
|
||||
header {visibility: hidden;}
|
||||
</style>
|
||||
"""
|
||||
st.markdown(hide_st_style, unsafe_allow_html=True)
|
||||
hide_UI_elements()
|
||||
|
||||
|
||||
|
||||
|
@ -19,3 +19,25 @@ def get_session_id():
|
||||
|
||||
|
||||
|
||||
def hide_UI_elements(menu=True, header=True, footer=True):
|
||||
HIDDEN = " {visibility: hidden;}"
|
||||
res = []
|
||||
|
||||
if menu:
|
||||
res.append("#MainMenu" + HIDDEN)
|
||||
|
||||
if header:
|
||||
res.append("header" + HIDDEN)
|
||||
|
||||
if footer:
|
||||
res.append("footer" + HIDDEN)
|
||||
|
||||
if not res:
|
||||
return
|
||||
|
||||
res = ["<style>"] + res + ["</style>"]
|
||||
res = "\n".join(res)
|
||||
return st.markdown(res, unsafe_allow_html=True)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user