in src/hpcadvisor/main_gui.py [0:0]
def main_gui():
current_action = None
userinput = None
if "--userinput" in sys.argv:
userinput = sys.argv[sys.argv.index("--userinput") + 1]
if "currentaction" not in st.session_state:
st.session_state.currentaction = None
with st.sidebar:
st.title("HPCAdvisor")
st.divider()
button_newdeploy = st.button("Create Deployment", key="button_newdeploy")
st.text("")
button_viewdeploy = st.button("View Deployment", key="button_viewdeploy")
st.text("")
button_newcollect = st.button("Run Scenarios", key="button_newcollect")
st.text("")
button_newplot = st.button("View Plots", key="button_newplot")
st.text("")
button_newadvice = st.button("Get Advice", key="button_newadvice")
st.divider()
if (
not button_newdeploy
and not button_viewdeploy
and not button_newcollect
and not button_newplot
and not button_newadvice
and st.session_state.currentaction == None
):
st.markdown("### HPC Resource Selection Advisor")
st.text("")
st.text("")
st.write(" **What you can do**")
st.text("🔸 Generate new data for better decision making")
st.text("🔸 Explore existing data to get more insights yourself")
st.text("🔸 Have advise from existing application")
if button_newdeploy:
st.session_state.currentaction = "create_deploy"
create_deployment(userinput)
elif button_viewdeploy:
st.session_state.currentaction = "view_deploy"
view_deployments()
elif button_newcollect:
st.session_state.currentaction = "create_collect"
start_datacollection(userinput)
elif button_newplot:
st.session_state.currentaction = "create_plot"
view_plot()
elif button_newadvice:
st.session_state.currentaction = "create_advice"
view_advice()
elif (
"currentaction" in st.session_state
and st.session_state.currentaction == "create_deploy"
):
create_deployment(userinput)
elif (
"currentaction" in st.session_state
and st.session_state.currentaction == "view_deploy"
):
view_deployments()
elif (
"currentaction" in st.session_state
and st.session_state.currentaction == "create_collect"
):
start_datacollection(userinput)
elif (
"currentaction" in st.session_state
and st.session_state.currentaction == "create_plot"
):
view_plot()
elif (
"currentaction" in st.session_state
and st.session_state.currentaction == "create_advice"
):
view_advice()
# remove streamlit bottom info
hide_streamlit_style = """
<style>
# MainMenu {visibility: hidden;}
footer {visibility: hidden;}
</style>
"""
st.markdown(hide_streamlit_style, unsafe_allow_html=True)