From a2993aaa0cf7dcccebe0b7c722f03f213d343611 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Tue, 31 Dec 2024 15:22:28 +0100 Subject: [PATCH] small fixes --- src/annescribe/webapp/task_list.py | 33 +++++++++++++++--------------- src/annescribe/webapp_main.py | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/annescribe/webapp/task_list.py b/src/annescribe/webapp/task_list.py index cf02969..7305bfd 100644 --- a/src/annescribe/webapp/task_list.py +++ b/src/annescribe/webapp/task_list.py @@ -101,10 +101,8 @@ def render_status(job_data: dict, app_config: dict): 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'}") - - else: - st.markdown("Pending") + st.markdown("Error") def render_task_list(container, app_config: dict): @@ -121,6 +119,7 @@ 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", @@ -144,21 +143,23 @@ def render_task_list(container, app_config: dict): key=f"delete_{x['name']}") } ] + list_container = st.container(border=True) - if len(existing_jobs) == 0: - st.write("No tasks available.") - else: - # display header - cols = st.columns(len(column_config)) - for i, col in enumerate(column_config): - with cols[i]: - st.write(col["name"]) - for i, job in enumerate(existing_jobs): + with list_container.container(): + if len(existing_jobs) == 0: + st.write("No tasks available.") + else: + # display header cols = st.columns(len(column_config)) - for j, col in enumerate(column_config): - with cols[j]: - col["render_func"](job) - st.divider() + for i, col in enumerate(column_config): + with cols[i]: + st.write(col["name"]) + for i, job in enumerate(existing_jobs): + cols = st.columns(len(column_config)) + for j, col in enumerate(column_config): + with cols[j]: + col["render_func"](job) + st.divider() def update_job_list(): nonlocal existing_jobs diff --git a/src/annescribe/webapp_main.py b/src/annescribe/webapp_main.py index dd2d04c..0807ba7 100644 --- a/src/annescribe/webapp_main.py +++ b/src/annescribe/webapp_main.py @@ -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 - print("rendering login...") + st.markdown("Please login. If no login form is shown, please refresh the page.") render_login()