further fixes
This commit is contained in:
@@ -40,16 +40,15 @@ def results_button(job_data: dict, app_config: dict):
|
||||
:param app_config: app configuration
|
||||
:return: None
|
||||
"""
|
||||
# is_toggled = st.session_state.get(f"shown_result") == job_data['name']
|
||||
#
|
||||
# if is_toggled:
|
||||
# return st.button("Hide Results", on_click=partial(hide_results, job_data), key=f"hide_{job_data['name']}")
|
||||
# else:
|
||||
# return st.button("Show Results", on_click=partial(show_results, job_data), key=f"show_{job_data['name']}")
|
||||
|
||||
if not job_data["completed"]:
|
||||
st.markdown("--")
|
||||
return
|
||||
|
||||
with st.popover("Show Results"):
|
||||
st.markdown("Results")
|
||||
st.write(job_data['output'])
|
||||
return
|
||||
|
||||
|
||||
@st.dialog("Are you sure?")
|
||||
@@ -97,7 +96,6 @@ def render_status(job_data: dict, app_config: dict):
|
||||
start_time = processing_details["start_time"]
|
||||
time_remaining = processing_details["time_remaining"]
|
||||
|
||||
cols = st.columns(3)
|
||||
st.markdown(f"{details}")
|
||||
st.markdown(f"Started: {start_time if start_time is not None else 'N/A'}")
|
||||
st.markdown(f"Time remaining: {time_remaining if time_remaining is not None else 'N/A'}")
|
||||
@@ -105,6 +103,20 @@ def render_status(job_data: dict, app_config: dict):
|
||||
st.markdown("Error")
|
||||
|
||||
|
||||
def get_delete_button(job_data: dict, app_config: dict):
|
||||
"""
|
||||
Get the delete button for a job
|
||||
:param job_data: job data
|
||||
:param app_config: app configuration
|
||||
:return: None
|
||||
"""
|
||||
if job_data["processing"]:
|
||||
st.markdown("--")
|
||||
return
|
||||
|
||||
st.button("Delete", on_click=partial(delete_task, job_data, app_config), key=f"delete_{job_data['name']}")
|
||||
|
||||
|
||||
def render_task_list(container, app_config: dict):
|
||||
"""
|
||||
Render the task list page
|
||||
@@ -119,7 +131,6 @@ def render_task_list(container, app_config: dict):
|
||||
st.subheader('Task List')
|
||||
st.write("Here you can see the status of your tasks, view the results, and delete tasks.")
|
||||
|
||||
|
||||
column_config = [
|
||||
{
|
||||
"name": "Name",
|
||||
@@ -139,8 +150,7 @@ def render_task_list(container, app_config: dict):
|
||||
},
|
||||
{
|
||||
"name": "Actions",
|
||||
"render_func": lambda x: st.button("Delete", on_click=partial(delete_task, x, app_config),
|
||||
key=f"delete_{x['name']}")
|
||||
"render_func": lambda x: get_delete_button(x, app_config)
|
||||
}
|
||||
]
|
||||
list_container = st.container(border=True)
|
||||
|
||||
@@ -71,7 +71,7 @@ if authentication_status is True:
|
||||
render_home(content_wrapper, config, authenticator if authentication_enabled else None)
|
||||
else:
|
||||
# make sure to remove cookie
|
||||
st.markdown("Please login. If no login form is shown, please refresh the page.")
|
||||
st.markdown("Please login. If no login form is shown, please refresh the page and or press R.")
|
||||
render_login()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user