Skip to content

Commit

Permalink
Merge pull request OpenMS#43 from t0mdavid-m/refresh_bug
Browse files Browse the repository at this point in the history
fix bug preventing log refresh
  • Loading branch information
axelwalter authored May 6, 2024
2 parents 98068aa + f8f7947 commit ebe440b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/workflow/StreamlitUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def select_input_file(
st.warning(f"No **{name}** files!")
return
options = [str(f) for f in path.iterdir()]
if key in self.params.keys():
if (key in self.params.keys()) and isinstance(self.params[key], list):
self.params[key] = [f for f in self.params[key] if f in options]

widget_type = "multiselect" if multiple else "selectbox"
Expand Down Expand Up @@ -660,7 +660,7 @@ def zip_and_download_files(self, directory: str):
def file_upload_section(self, custom_upload_function) -> None:
custom_upload_function()
if st.button("⬇️ Download all uploaded files", use_container_width=True):
self.ui.zip_and_download_files(Path(self.workflow_dir, "input-files"))
self.zip_and_download_files(Path(self.workflow_dir, "input-files"))

def parameter_section(self, custom_paramter_function) -> None:
st.toggle("Show advanced parameters", value=False, key="advanced")
Expand Down Expand Up @@ -719,13 +719,9 @@ def execution_section(self, start_workflow_function) -> None:
if c2.button("Stop Workflow", type="primary", use_container_width=True):
self.executor.stop()
st.rerun()
else:
c2.button(
"Start Workflow",
type="primary",
use_container_width=True,
on_click=start_workflow_function,
)
elif st.button("Start Workflow", type="primary", use_container_width=True):
start_workflow_function()
st.rerun()
log_path = Path(self.workflow_dir, "logs", log_level.replace(" ", "-") + ".log")
if log_path.exists():
if self.executor.pid_dir.exists():
Expand Down

0 comments on commit ebe440b

Please sign in to comment.