Skip to content

Commit 77d2942

Browse files
committed
Merge remote-tracking branch 'openms/main'
2 parents 8a80602 + a0b3f7e commit 77d2942

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

src/workflow/StreamlitUI.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,13 +1188,19 @@ def execution_section(
11881188
f"**Workflow log file: {datetime.fromtimestamp(log_path.stat().st_ctime).strftime('%Y-%m-%d %H:%M')} CET**"
11891189
)
11901190
with open(log_path, "r", encoding="utf-8") as f:
1191-
content = f.read()
1191+
lines = f.readlines()
1192+
content = "".join(lines)
11921193
# Check if workflow finished successfully
11931194
if "WORKFLOW FINISHED" in content:
11941195
st.success("**Workflow completed successfully.**")
11951196
else:
11961197
st.error("**Errors occurred, check log file.**")
1197-
st.code(content, language="neon", line_numbers=False)
1198+
# Apply line limit to static display
1199+
if log_lines_count == "all":
1200+
display_lines = lines
1201+
else:
1202+
display_lines = lines[-st.session_state.log_lines_count:]
1203+
st.code("".join(display_lines), language="neon", line_numbers=False)
11981204

11991205
def _show_queue_status(self, status: dict) -> None:
12001206
"""Display queue job status for online mode"""
@@ -1217,17 +1223,9 @@ def _show_queue_status(self, status: dict) -> None:
12171223
queue_length = status.get("queue_length", "?")
12181224
st.info(f"**Status: {label}** - Your workflow is #{queue_position} in the queue ({queue_length} total jobs)")
12191225

1220-
# Visual queue indicator
1221-
if isinstance(queue_position, int) and isinstance(queue_length, int) and queue_length > 0:
1222-
progress = 1 - (queue_position / queue_length)
1223-
st.progress(progress, text=f"Queue position {queue_position} of {queue_length}")
1224-
12251226
elif job_status == "started":
1226-
progress = status.get("progress", 0)
12271227
current_step = status.get("current_step", "Processing...")
1228-
st.info(f"**Status: {label}**")
1229-
if progress and progress > 0:
1230-
st.progress(progress, text=current_step or "Processing...")
1228+
st.info(f"**Status: {label}** - {current_step}")
12311229

12321230
elif job_status == "finished":
12331231
# Check if the job result indicates success or failure

0 commit comments

Comments
 (0)