Fix job progress display to show actual progress instead of 'Assigned to worker'

parent 1d41907b
...@@ -79,10 +79,21 @@ ...@@ -79,10 +79,21 @@
.then(progressData => { .then(progressData => {
if (progressData && progressData.progress !== undefined) { if (progressData && progressData.progress !== undefined) {
updateJobProgressDisplay(jobId, progressData); updateJobProgressDisplay(jobId, progressData);
} else if (progressData && progressData.status === 'no_progress') {
// No progress available yet, ensure it shows "Processing..."
const progressElement = jobRow.querySelector('.job-progress');
if (progressElement && progressElement.textContent === '') {
progressElement.textContent = 'Processing...';
}
} }
}) })
.catch(error => { .catch(error => {
console.log(`Error getting progress for job ${jobId}:`, error); console.log(`Error getting progress for job ${jobId}:`, error);
// On error, ensure it shows "Processing..."
const progressElement = jobRow.querySelector('.job-progress');
if (progressElement && progressElement.textContent === '') {
progressElement.textContent = 'Processing...';
}
}); });
} }
}); });
...@@ -173,6 +184,14 @@ ...@@ -173,6 +184,14 @@
// Update actions based on status change // Update actions based on status change
updateJobActions(jobUpdate.id, jobUpdate.status); updateJobActions(jobUpdate.id, jobUpdate.status);
// Initialize progress display for newly processing jobs
if (jobUpdate.status === 'processing') {
const progressElement = jobRow.querySelector('.job-progress');
if (progressElement && progressElement.textContent === '') {
progressElement.textContent = 'Processing...';
}
}
} }
// Update tokens if completed // Update tokens if completed
...@@ -183,15 +202,8 @@ ...@@ -183,15 +202,8 @@
} }
} }
// Update progress info for processing jobs (element always exists for consistent layout) // Progress info is updated separately by updateJobProgress() function
const progressElement = jobRow.querySelector('.job-progress'); // Don't override it with job result status
if (progressElement) {
if (jobUpdate.status === 'processing' && jobUpdate.result) {
progressElement.textContent = jobUpdate.result.status || 'Processing...';
} else {
progressElement.textContent = ''; // Clear when not processing
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment