Sanjana Vekhande commited on
Commit
3f0cc99
·
1 Parent(s): e9f63db

hide all warning/technical output from user

Browse files
Files changed (2) hide show
  1. backend/main.py +5 -8
  2. frontend/index.html +7 -1
backend/main.py CHANGED
@@ -103,18 +103,15 @@ async def run_bootstrap(job_id, model_paths, mapping_paths, expr_path, species_p
103
  await loop.run_in_executor(None, run_sync)
104
  job["progress"] = 80
105
 
106
- # Relay captured stdout as messages
107
  for line in captured.getvalue().strip().split("\n"):
108
  line = line.strip()
109
- if not line:
110
  continue
111
  if "Write to" in line:
112
- type_ = "ok"
113
- elif line.startswith("Warning"):
114
- type_ = "" # warnings are noisy — show but no colour
115
- else:
116
- type_ = "info"
117
- add_msg(line, type_)
118
 
119
  add_msg("Compressing output files…", "info")
120
  job["progress"] = 90
 
103
  await loop.run_in_executor(None, run_sync)
104
  job["progress"] = 80
105
 
106
+ # Relay only key status lines — skip all Warning lines
107
  for line in captured.getvalue().strip().split("\n"):
108
  line = line.strip()
109
+ if not line or line.startswith("Warning"):
110
  continue
111
  if "Write to" in line:
112
+ add_msg("Writing output files…", "ok")
113
+ elif line.startswith("Read") or line.startswith("Species") or line.startswith("Bootstrap"):
114
+ add_msg(line, "info")
 
 
 
115
 
116
  add_msg("Compressing output files…", "info")
117
  job["progress"] = 90
frontend/index.html CHANGED
@@ -748,7 +748,13 @@ async function startJob() {
748
  if (d.progress !== undefined) {
749
  document.getElementById('progressBar').style.width = d.progress + '%';
750
  document.getElementById('progressPct').textContent = d.progress + '%';
751
- if (d.label) document.getElementById('progressLabel').textContent = d.label;
 
 
 
 
 
 
752
  }
753
 
754
  if (d.status === 'done') {
 
748
  if (d.progress !== undefined) {
749
  document.getElementById('progressBar').style.width = d.progress + '%';
750
  document.getElementById('progressPct').textContent = d.progress + '%';
751
+ // Show only clean status labels, never raw backend output
752
+ const cleanLabels = ['Starting…', 'Files received. Starting bootstrap…', 'Writing output files…', 'Compressing output files…', 'Processing…'];
753
+ if (d.label && cleanLabels.some(l => d.label.startsWith(l.split('…')[0]))) {
754
+ document.getElementById('progressLabel').textContent = d.label;
755
+ } else if (d.progress > 0 && d.progress < 100) {
756
+ document.getElementById('progressLabel').textContent = 'Processing…';
757
+ }
758
  }
759
 
760
  if (d.status === 'done') {