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
|
:param app_config: app configuration
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
# is_toggled = st.session_state.get(f"shown_result") == job_data['name']
|
|
||||||
#
|
if not job_data["completed"]:
|
||||||
# if is_toggled:
|
st.markdown("--")
|
||||||
# return st.button("Hide Results", on_click=partial(hide_results, job_data), key=f"hide_{job_data['name']}")
|
return
|
||||||
# else:
|
|
||||||
# return st.button("Show Results", on_click=partial(show_results, job_data), key=f"show_{job_data['name']}")
|
|
||||||
|
|
||||||
with st.popover("Show Results"):
|
with st.popover("Show Results"):
|
||||||
st.markdown("Results")
|
st.markdown("Results")
|
||||||
st.write(job_data['output'])
|
st.write(job_data['output'])
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
@st.dialog("Are you sure?")
|
@st.dialog("Are you sure?")
|
||||||
@@ -97,7 +96,6 @@ def render_status(job_data: dict, app_config: dict):
|
|||||||
start_time = processing_details["start_time"]
|
start_time = processing_details["start_time"]
|
||||||
time_remaining = processing_details["time_remaining"]
|
time_remaining = processing_details["time_remaining"]
|
||||||
|
|
||||||
cols = st.columns(3)
|
|
||||||
st.markdown(f"{details}")
|
st.markdown(f"{details}")
|
||||||
st.markdown(f"Started: {start_time if start_time is not None else 'N/A'}")
|
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'}")
|
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")
|
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):
|
def render_task_list(container, app_config: dict):
|
||||||
"""
|
"""
|
||||||
Render the task list page
|
Render the task list page
|
||||||
@@ -119,7 +131,6 @@ def render_task_list(container, app_config: dict):
|
|||||||
st.subheader('Task List')
|
st.subheader('Task List')
|
||||||
st.write("Here you can see the status of your tasks, view the results, and delete tasks.")
|
st.write("Here you can see the status of your tasks, view the results, and delete tasks.")
|
||||||
|
|
||||||
|
|
||||||
column_config = [
|
column_config = [
|
||||||
{
|
{
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
@@ -139,8 +150,7 @@ def render_task_list(container, app_config: dict):
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Actions",
|
"name": "Actions",
|
||||||
"render_func": lambda x: st.button("Delete", on_click=partial(delete_task, x, app_config),
|
"render_func": lambda x: get_delete_button(x, app_config)
|
||||||
key=f"delete_{x['name']}")
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
list_container = st.container(border=True)
|
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)
|
render_home(content_wrapper, config, authenticator if authentication_enabled else None)
|
||||||
else:
|
else:
|
||||||
# make sure to remove cookie
|
# 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()
|
render_login()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user