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

@@ -1,7 +1,7 @@
<template>
<div class="flex items-center justify-between p-2">
<h1>
Source Code Explorer : {{application}}
Source Code Explorer : {{userPrefStore.getSelApp.fe_name}}
</h1>
</div>
@@ -17,7 +17,7 @@
<div class="col-span-8">
<div class="card flow-codeviewer">
<h5>File Explorer</h5>
<FileFlowViewer :file="selectedFile" :application="application"/>
<FileFlowViewer :file="selectedFile" :application="userPrefStore.getSelApp.fe_name"/>
</div>
</div>
</div>
@@ -28,21 +28,21 @@
import FileFlowViewer from '@/components/FileFlowViewer.vue';
import { ApplicationCodeService } from '@/service/ApplicationCodeService';
import Tree from 'primevue/tree';
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { UserPrefStore } from '../../stores/UserPrefStore.js';
const nodes = ref(null)
const expandedKeys = ref({});
const selectedFile = ref({})
const router = useRouter();
const userPrefStore = UserPrefStore();
const selectedApp = userPrefStore.getSelApp;
const application=ref(selectedApp.fe_name)
//const selectedApp = userPrefStore.getSelApp;
//const application=ref(selectedApp.fe_name)
onMounted(() => {
console.log("Mounted")
ApplicationCodeService.getApplication(selectedApp.internal_name).then(response => {
ApplicationCodeService.getApplication(userPrefStore.getSelApp.internal_name).then(response => {
var tmp = []
tmp.push(response.data)
nodes.value = tmp
@@ -50,6 +50,22 @@ onMounted(() => {
})
})
/*function reloadPage() {
console.log("reloadPage", router);
//router.replace({ path: router.currentRoute.value.path });
window.location.reload();
}*/
function reloadPage() {
// Controlla se il valore è cambiato
console.log("reloadPage");
router.push({ name: 'app-browser'});
//window.location.reload(); // Ricarica la pagina solo se il valore cambia
}
watch(() => userPrefStore.getSelApp, reloadPage, { immediate: true });
function onNodeSelect(e){
if(e.icon == "pi pi-fw pi-file"){
selectedFile.value = e.key

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;

View File

@@ -22,15 +22,23 @@
:paginatorTemplate="paginatorTemplate"
:totalRecords="scenario_execution_store.scenariosExecution.length"
:first="first"
@page="onPage"
@page="onPage"
:filters="filters"
>
<Column field="id" header="Execution ID" />
<Column field="scenario.name" header="Name" />
<Column field="" header="Execution Date" />
<Column field="id" header="Execution ID" filter filterPlaceholder="Search by ID" />
<Column field="scenario.name" header="Scenario Name" />
<Column field="execSharedMap.user_input.selected_project" header="Project Input" />
<Column field="execSharedMap.user_input.selected_application" header="Application Input" />
<Column field="scenario.id" header="Scenario ID" />
<Column field="" header="Start Date" />
<Column field="" header="End Date" />
<Column field="" header="Model AI" />
<Column field="" header="Version" />
<Column header="Output Type">
<template #body="slotProps">
{{ slotProps.data.scenario.outputType || 'text' }}
</template>
</Column>
<Column field="" header="Rating" />
<Column field="id">
<template #body="slotProps">
<Button label="View" @click="goToScenarioExec(slotProps.data)" class="mt-9 ml-4" />
@@ -89,6 +97,14 @@ function onPage(event) {
first.value = event.first;
}
const filters = ref({
id: { value: null, matchMode: 'contains' },
//scenario: { value: null, matchMode: 'contains' },
//'execSharedMap.user_input.selected_project': { value: null, matchMode: 'contains' },
//'execSharedMap.user_input.selected_application': { value: null, matchMode: 'contains' },
// Aggiungi altri filtri come preferisci
});
</script>