Remove unused Empty, SeatDemo, PersonalDemo, PaymentDemo, ConfirmationDemo, TreeDoc, and FileDoc components
This commit is contained in:
@@ -100,18 +100,18 @@
|
||||
|
||||
<script setup>
|
||||
|
||||
import ChangeImpactOutputViewer from '@/components/ChangeImpactOutputViewer.vue';
|
||||
import { ChevronLeftIcon } from '@heroicons/vue/24/solid';
|
||||
import axios from 'axios';
|
||||
import JsonEditorVue from 'json-editor-vue';
|
||||
import { MdPreview } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import InputText from 'primevue/inputtext';
|
||||
import ProgressSpinner from 'primevue/progressspinner';
|
||||
import Select from 'primevue/select';
|
||||
import Textarea from 'primevue/textarea';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { MdPreview } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import ChangeImpactOutputViewer from '@/components/ChangeImpactOutputViewer.vue';
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ const formData = ref({});
|
||||
const exec_id = ref(null);
|
||||
const exec_scenario = ref({});
|
||||
const debug_modal = ref(false);
|
||||
|
||||
let pollingInterval = null;
|
||||
|
||||
onMounted(() => {
|
||||
loading.value = true
|
||||
@@ -153,6 +153,7 @@ onMounted(() => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const execScenario = () => {
|
||||
loading_data.value = true;
|
||||
data_loaded.value = false;
|
||||
@@ -162,12 +163,12 @@ onMounted(() => {
|
||||
inputs: { ...formData.value }
|
||||
};
|
||||
|
||||
axios.post('/scenarios/execute', data)
|
||||
axios.post('/scenarios/execute-async', data)
|
||||
.then(response => {
|
||||
loading_data.value = false;
|
||||
data_loaded.value = true;
|
||||
scenario_output.value = response.data.stringOutput;
|
||||
exec_id.value = response.data.scenarioExecution_id
|
||||
// Start polling
|
||||
startPolling();
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error executing scenario:', error);
|
||||
@@ -185,6 +186,41 @@ onMounted(() => {
|
||||
debug_modal.value = true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const pollBackendAPI = () => {
|
||||
|
||||
axios.get('/scenarios/getExecutionProgress/'+exec_id.value).then(response => {
|
||||
if (response.data.status == 'OK' || response.data.status == 'ERROR') {
|
||||
console.log("Condition met, stopping polling.");
|
||||
stopPolling();
|
||||
|
||||
loading_data.value = false;
|
||||
data_loaded.value = true;
|
||||
scenario_output.value = response.data.stringOutput;
|
||||
exec_id.value = response.data.scenarioExecution_id
|
||||
|
||||
} else {
|
||||
console.log("Condition not met, polling continues.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Function to start polling
|
||||
function startPolling() {
|
||||
// Set polling interval (every 5 seconds in this case)
|
||||
pollingInterval = setInterval(pollBackendAPI, 2500);
|
||||
console.log("Polling started.");
|
||||
}
|
||||
|
||||
// Function to stop polling
|
||||
function stopPolling() {
|
||||
clearInterval(pollingInterval);
|
||||
console.log("Polling stopped.");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user