diff --git a/src/views/pages/OldScenarioExec.vue b/src/views/pages/OldScenarioExec.vue
index 30bc9ea..13ac85f 100644
--- a/src/views/pages/OldScenarioExec.vue
+++ b/src/views/pages/OldScenarioExec.vue
@@ -63,7 +63,7 @@
-
+
-
-
+
+
+
Error: {{ exec_scenario.latestStepOutput }}
+
+
+
Error: Execution failed.
+
+
+
diff --git a/src/views/pages/ScenarioExec.vue b/src/views/pages/ScenarioExec.vue
index a33c01b..ab3b502 100644
--- a/src/views/pages/ScenarioExec.vue
+++ b/src/views/pages/ScenarioExec.vue
@@ -209,14 +209,21 @@
-
-
-
+
+
+
Error: {{ error_message }}
+
+
+
Error: Execution failed.
+
+
+
-
-
@@ -300,7 +294,7 @@ import Select from 'primevue/select';
import Textarea from 'primevue/textarea';
import { useConfirm } from 'primevue/useconfirm';
import { useToast } from 'primevue/usetoast';
-import { computed, onMounted, ref, watch } from 'vue';
+import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { JellyfishLoader } from 'vue3-spinner';
import { ScenarioService } from '../../service/ScenarioService';
@@ -314,9 +308,11 @@ const scenario = ref({});
const scenario_response = ref(null);
const scenario_output = ref(null);
const scenario_response_message = ref(null);
+const error_message = ref(null);
const loading = ref(false);
const data_loaded = ref(false);
const loading_data = ref(false);
+const errored_execution = ref(false);
const formData = ref({});
const exec_id = ref(null);
const exec_scenario = ref({});
@@ -384,6 +380,11 @@ const isInputFilled = computed(() => {
});
return isFilled;
});
+//When the component is dismissed stop the polling
+onBeforeUnmount(() => {
+ stopPolling();
+ stopTimer();
+});
onMounted(() => {
fetchScenario(route.params.id);
@@ -531,6 +532,12 @@ const pollBackendAPI = () => {
stopPolling();
stopTimer();
+
+ if(response.data.status == 'ERROR') {
+ errored_execution.value = true;
+ error_message.value = response.data.message;
+ }
+
loading_data.value = false;
data_loaded.value = true;
scenario_output.value = response.data.stringOutput;
@@ -545,16 +552,7 @@ const pollBackendAPI = () => {
// Accedi al primo step e controlla se esiste l'attributo `codegenie_output_type`
const firstStep = scenario.value.steps[0];
if (firstStep?.attributes?.['codegenie_output_type']) {
- // Controlla se `codegenie_output_type` รจ uguale a 'FILE'
- // if (firstStep.attributes['codegenie_output_type'] === 'FILE') {
- // console.log('base64 ', scenario_output.value);
-
- // Chiama la funzione `extractFiles` con il valore di `scenario_output.value`
- //extractFiles(scenario_output.value);
- //}
if (firstStep.attributes['codegenie_output_type'] == 'FILE') {
- //console.log('base64 ', scenario_output.value)
- //extractFiles(scenario_output.value, 'output', zipOutput)
fileType.value = 'FILE';
} else if (firstStep.attributes['codegenie_output_type'] == 'MARKDOWN') {
fileType.value = 'MARKDOWN';