This commit is contained in:
Florinda
2024-10-31 09:22:47 +01:00
parent 6f75693b31
commit 443b2302f4
3 changed files with 56 additions and 23 deletions

View File

@@ -7,13 +7,7 @@
<h1>
{{ scenario.name }}
</h1>
<Button
@click="back()"
label="Load"
class="flex items-center text-sm">
<ChevronLeftIcon name="chevron-left" class="w-4 h-5 text-white"/>
<span>Back to Scenarios</span>
</Button>
</div>
<div class="flex mt-6">
<div class="card flex flex-col gap-4 w-full">
@@ -31,7 +25,7 @@
/>
</div>
</div>
<Button label="Send" @click="execScenario" class="mt-9 ml-4"/>
<Button label="Send" @click="execScenario" class="mt-9 ml-4" :disabled="!isInputFilled"/>
</div>
</template>
<template v-else>
@@ -101,7 +95,6 @@
<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';
@@ -110,7 +103,7 @@ 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 { computed, onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
@@ -129,6 +122,14 @@ const exec_scenario = ref({});
const debug_modal = ref(false);
let pollingInterval = null;
const isInputFilled = computed(() => {
const inputName = scenario.value.inputs[0]?.name;
return inputName && formData.value[inputName] && formData.value[inputName].length > 0;
});
onMounted(() => {
loading.value = true
const id = route.params.id;