refactor
This commit is contained in:
11
stand.py
11
stand.py
@ -4,7 +4,7 @@ from st_aggrid import AgGrid, GridOptionsBuilder
|
|||||||
import hacks
|
import hacks
|
||||||
|
|
||||||
from restapi import restapi
|
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
|
from utils.df_utils import to_excel_binary
|
||||||
|
|
||||||
|
|
||||||
@ -14,14 +14,7 @@ st.set_page_config(
|
|||||||
layout="wide"
|
layout="wide"
|
||||||
)
|
)
|
||||||
|
|
||||||
hide_st_style = """
|
hide_UI_elements()
|
||||||
<style>
|
|
||||||
#MainMenu {visibility: hidden;}
|
|
||||||
footer {visibility: hidden;}
|
|
||||||
header {visibility: hidden;}
|
|
||||||
</style>
|
|
||||||
"""
|
|
||||||
st.markdown(hide_st_style, unsafe_allow_html=True)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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