From 2bc585fe33ae17ea58455e921725b9f55c459441 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 4 Jan 2024 02:09:30 +0000 Subject: [PATCH] Make failed modal actions stay on screen There's not currently any way to view the log of a failed action - an easy win is to keep the log on screen until it's closed by the user. --- .../genericComponents/taskSubmitter.vue | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/genericComponents/taskSubmitter.vue b/webapp/src/components/genericComponents/taskSubmitter.vue index 041e638c..d0efbdc4 100644 --- a/webapp/src/components/genericComponents/taskSubmitter.vue +++ b/webapp/src/components/genericComponents/taskSubmitter.vue @@ -41,6 +41,9 @@
{{ item.message }}
+
+ The task failed due to an error - use the button below to close this dialog. +
@@ -62,6 +65,14 @@ > Cancel +
@@ -134,7 +145,8 @@ export default { progress: null, taskStarted: false, taskRunning: false, - log: [] + log: [], + taskStatus: "" }; }, @@ -242,7 +254,10 @@ export default { if (this.selfUpdate) { this.getFormData(); } - UIkit.modal(this.$refs.statusModal).hide(); + if (this.taskStatus != "error") { + // Leave the modal up if there was an error. + UIkit.modal(this.$refs.statusModal).hide(); + } } }, @@ -267,6 +282,7 @@ export default { .get(this.taskUrl, { baseURL: this.$store.getters.baseUri }) .then(response => { var result = response.data.status; + this.taskStatus = result; // If the task ends with success if (result == "completed") { resolve(response.data); @@ -274,13 +290,13 @@ export default { // If task ends with an error else if (result == "error") { // Pass the error string back with reject - + if (!this.progress) this.progress = 1; reject(new Error(response.data.output)); } // If task ends with termination else if (result == "cancelled") { // Pass a generic termination error back with reject - + if (!this.progress) this.progress = 100; reject(new Error("Task cancelled")); } else { // Since the task is still running, we can update the progress bar @@ -301,6 +317,10 @@ export default { }); }, + hideModal() { + UIkit.modal(this.$refs.statusModal).hide() + }, + terminateTask: function() { axios.delete(this.taskUrl); }