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

parent 1d41907b
......@@ -79,10 +79,21 @@
.then(progressData => {
if (progressData && progressData.progress !== undefined) {
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 => {
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 @@
// Update actions based on status change
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
......@@ -183,15 +202,8 @@
}
}
// Update progress info for processing jobs (element always exists for consistent layout)
const progressElement = jobRow.querySelector('.job-progress');
if (progressElement) {
if (jobUpdate.status === 'processing' && jobUpdate.result) {
progressElement.textContent = jobUpdate.result.status || 'Processing...';
} else {
progressElement.textContent = ''; // Clear when not processing
}
}
// Progress info is updated separately by updateJobProgress() function
// Don't override it with job result status
}
}
......
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