fixed Project application bug
This commit is contained in:
@@ -104,7 +104,7 @@ import 'md-editor-v3/lib/style.css';
|
|||||||
import InputText from 'primevue/inputtext';
|
import InputText from 'primevue/inputtext';
|
||||||
import Select from 'primevue/select';
|
import Select from 'primevue/select';
|
||||||
import Textarea from 'primevue/textarea';
|
import Textarea from 'primevue/textarea';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { JellyfishLoader } from "vue3-spinner";
|
import { JellyfishLoader } from "vue3-spinner";
|
||||||
|
|
||||||
@@ -139,20 +139,29 @@ const isInputFilled = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loading.value = true
|
fetchScenario(route.params.id);
|
||||||
const id = route.params.id;
|
|
||||||
loadingStore.scenario_loading = true;
|
|
||||||
axios.get('/scenarios/' + id )
|
|
||||||
.then(response => {
|
|
||||||
loading.value = false
|
|
||||||
loadingStore.scenario_loading = false;
|
|
||||||
|
|
||||||
scenario.value = response.data
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Ricarica i dati quando cambia il parametro `id`
|
||||||
|
watch(() => route.params.id, fetchScenario);
|
||||||
|
|
||||||
|
|
||||||
|
//Function to fetch scenarios
|
||||||
|
function fetchScenario(id) {
|
||||||
|
loading.value = true;
|
||||||
|
axios.get(`/scenarios/${id}`)
|
||||||
|
.then(response => {
|
||||||
|
scenario.value = response.data;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error fetching scenario:", error);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const getInputComponent = (type) => {
|
const getInputComponent = (type) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
@@ -223,8 +232,6 @@ axios.get('/scenarios/getExecutionProgress/'+exec_id.value).then(response => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Function to start polling
|
// Function to start polling
|
||||||
function startPolling() {
|
function startPolling() {
|
||||||
// Set polling interval (every 5 seconds in this case)
|
// Set polling interval (every 5 seconds in this case)
|
||||||
|
|||||||
@@ -3,29 +3,30 @@
|
|||||||
<ProgressSpinner style="width: 50px; height: 50px; margin-top: 50px" strokeWidth="3" fill="transparent"/>
|
<ProgressSpinner style="width: 50px; height: 50px; margin-top: 50px" strokeWidth="3" fill="transparent"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
||||||
<div class="flex items-center justify-between p-2">
|
<div class="flex items-center justify-between p-2">
|
||||||
|
<!--
|
||||||
<!-- <Button
|
<Button
|
||||||
@click="back()"
|
@click="back()"
|
||||||
label="Load"
|
label="Load"
|
||||||
class="flex items-center text-sm">
|
class="flex items-center text-sm">
|
||||||
<ChevronLeftIcon name="chevron-left" class="w-4 h-5 text-white"/>
|
<ChevronLeftIcon name="chevron-left" class="w-4 h-5 text-white"/>
|
||||||
<span>Back to Scenarios</span>
|
<span>Back to Scenarios</span>
|
||||||
</Button> -->
|
</Button>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
<h2 class="text-xl font-bold mt-6">Executions List</h2>
|
<h2 class="text-xl font-bold mt-6">Executions List</h2>
|
||||||
<DataTable v-model:filters="filters" :value="scenario_execution_store.scenariosExecution"
|
|
||||||
:loading="loading_data"
|
|
||||||
class="mt-0"
|
|
||||||
:rows="10"
|
|
||||||
paginator
|
|
||||||
:paginatorTemplate="paginatorTemplate"
|
|
||||||
:totalRecords="scenario_execution_store.scenariosExecution.length"
|
|
||||||
:first="first"
|
|
||||||
@page="onPage" :globalFilterFields="['id', 'scenario.name', 'execSharedMap.user_input.selected_project', 'execSharedMap.user_input.selected_application']">
|
|
||||||
|
|
||||||
<template #header>
|
<DataTable v-model:filters="filters" :value="scenario_execution_store.scenariosExecution"
|
||||||
|
:loading="loading_data"
|
||||||
|
class="mt-0"
|
||||||
|
:rows="10"
|
||||||
|
paginator
|
||||||
|
:paginatorTemplate="paginatorTemplate"
|
||||||
|
:totalRecords="scenario_execution_store.scenariosExecution.length"
|
||||||
|
:first="first"
|
||||||
|
@page="onPage" :globalFilterFields="['id', 'scenario.name', 'execSharedMap.user_input.selected_project', 'execSharedMap.user_input.selected_application']">
|
||||||
|
|
||||||
|
<template #header>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<IconField>
|
<IconField>
|
||||||
<InputIcon>
|
<InputIcon>
|
||||||
@@ -35,70 +36,54 @@
|
|||||||
</IconField>
|
</IconField>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Column field="id" header="Execution ID">
|
|
||||||
<!-- <template #filter="{ filterModel, filterCallback }">
|
<Column field="id" header="Execution ID"></Column>
|
||||||
<InputText v-model="filterModel.value" type="text" @input="filterCallback()" placeholder="Search by ID" />
|
|
||||||
</template>-->
|
|
||||||
</Column>
|
|
||||||
<Column field="scenario.name" header="Scenario Name">
|
<Column field="scenario.name" header="Scenario Name">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
{{ slotProps.data.scenario.name }}
|
{{ slotProps.data.scenario.name }}
|
||||||
<i
|
<i
|
||||||
class="pi pi-info-circle text-blue-500 cursor-pointer"
|
class="pi pi-info-circle text-blue-500 cursor-pointer"
|
||||||
v-tooltip="slotProps.data.scenario.description"
|
v-tooltip="slotProps.data.scenario.description"
|
||||||
></i>
|
></i>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</Column>
|
|
||||||
<Column field="execSharedMap.user_input.selected_project" header="Project Input">
|
|
||||||
|
|
||||||
</Column>
|
|
||||||
<Column field="execSharedMap.user_input.selected_application" header="Application Input">
|
|
||||||
|
|
||||||
</Column>
|
|
||||||
<Column field="startDate" header="Start Date">
|
|
||||||
|
|
||||||
</Column>
|
|
||||||
<Column field="endDate" header="End Date">
|
|
||||||
|
|
||||||
</Column>
|
|
||||||
<Column field="scenario.aiModel.apiProvider" header="Model AI">
|
|
||||||
|
|
||||||
</Column>
|
|
||||||
|
|
||||||
<Column field="scenario.aiModel.model" header="Version">
|
|
||||||
|
|
||||||
</Column>
|
</Column>
|
||||||
|
<Column field="execSharedMap.user_input.selected_project" header="Project Input"></Column>
|
||||||
|
<Column field="execSharedMap.user_input.selected_application" header="Application Input"></Column>
|
||||||
|
<Column field="startDate" header="Start Date"></Column>
|
||||||
|
<Column field="endDate" header="End Date"></Column>
|
||||||
|
<Column field="scenario.aiModel.apiProvider" header="Model AI"></Column>
|
||||||
|
<Column field="scenario.aiModel.model" header="Version"></Column>
|
||||||
<Column header="Output Type">
|
<Column header="Output Type">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
{{ slotProps.data.scenario.outputType || 'text' }}
|
{{ slotProps.data.scenario.outputType || 'text' }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="rating" header="Rating">
|
<Column field="rating" header="Rating">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<Rating :value="slotProps.data.rating" :stars="5" readonly cancel="false" />
|
<Rating :value="slotProps.data.rating" :stars="5" readonly cancel="false" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="id">
|
<Column field="id">
|
||||||
|
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<div class="flex justify-center items-center h-full">
|
<div class="flex justify-center items-center h-full">
|
||||||
<Button label="View" @click="goToScenarioExec(slotProps.data)" class="mt-0 ml-0" />
|
<Button label="View" @click="goToScenarioExec(slotProps.data)" class="mt-0 ml-0" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</DataTable>
|
|
||||||
|
|
||||||
|
<template #empty>
|
||||||
|
<tr>
|
||||||
|
<td :colspan="9" class="text-center">No executions found</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="loading_data" class="flex justify-center">
|
<div v-if="loading_data" class="flex justify-center">
|
||||||
<ProgressSpinner style="width: 30px; height: 30px; margin: 30px" strokeWidth="6" fill="transparent"/>
|
<ProgressSpinner style="width: 30px; height: 30px; margin: 30px" strokeWidth="6" fill="transparent"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
Reference in New Issue
Block a user