diff --git a/web/app/src/components/JobActionsBar.vue b/web/app/src/components/JobActionsBar.vue index fd90fe53..310fd1c6 100644 --- a/web/app/src/components/JobActionsBar.vue +++ b/web/app/src/components/JobActionsBar.vue @@ -33,17 +33,14 @@ export default { }, _handleJobActionPromise(promise, description) { - // const numJobs = this.jobs.numSelected; - const numJobs = 1; return promise .then(() => { - let message; - if (numJobs == 1) { - message = `Job ${description}`; - } else { - message = `${numJobs} jobs ${description}`; - } - this.notifs.add(message); + // There used to be a call to `this.notifs.add(message)` here, but now + // that job status changes are logged in the notifications anyway, + // it's no longer necessary. + // This function is still kept, in case we want to bring back the + // notifications when multiple jobs can be selected. Then a summary + // ("N jobs requeued") could be logged here. }) .catch((error) => { const errorMsg = JSON.stringify(error); // TODO: handle API errors better. diff --git a/web/app/src/stores/notifications.js b/web/app/src/stores/notifications.js index c8f4045c..2974555e 100644 --- a/web/app/src/stores/notifications.js +++ b/web/app/src/stores/notifications.js @@ -40,7 +40,19 @@ export const useNotifs = defineStore('notifications', { }, /** - * @param {API.SioTaskUpdate} taskUpdate Task update received via SocketIO. + * @param {API.SocketIOJobUpdate} jobUpdate Job update received via SocketIO. + */ + addJobUpdate(jobUpdate) { + console.log('Received job update:', jobUpdate); + let msg = `Job ${jobUpdate.name}`; + if (jobUpdate.previous_status && jobUpdate.previous_status != jobUpdate.status) { + msg += ` changed status ${jobUpdate.previous_status} ➜ ${jobUpdate.status}`; + } + this.add(msg) + }, + + /** + * @param {API.SocketIOTaskUpdate} taskUpdate Task update received via SocketIO. */ addTaskUpdate(taskUpdate) { console.log('Received task update:', taskUpdate); diff --git a/web/app/src/views/JobsView.vue b/web/app/src/views/JobsView.vue index 548b562e..b79e5bf5 100644 --- a/web/app/src/views/JobsView.vue +++ b/web/app/src/views/JobsView.vue @@ -104,6 +104,7 @@ export default { // SocketIO data event handlers: onSioJobUpdate(jobUpdate) { + this.notifs.addJobUpdate(jobUpdate); if (this.$refs.jobsTable) { if (jobUpdate.previous_status)