before refactor
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<Tabs value="class-code" @update:value="tabUpdate">
|
||||
|
||||
<TabList>
|
||||
|
||||
<TabList>
|
||||
<Tab value="class-code">Class Code</Tab>
|
||||
<Tab value="class-description">Class RE</Tab>
|
||||
<Tab v-if="methods != null" value="method-list">Method List</Tab>
|
||||
</TabList>
|
||||
<TabPanels>
|
||||
|
||||
|
||||
|
||||
<TabPanel value="class-code">
|
||||
<p v-if="classLoaded" class="m-0">
|
||||
|
||||
|
||||
|
||||
<TabPanel value="class-code">
|
||||
<p v-if="classLoaded" class="m-0">
|
||||
|
||||
<HighCode
|
||||
class="code"
|
||||
@@ -25,16 +25,16 @@
|
||||
</p>
|
||||
<Skeleton v-else width="100%" height="10rem"></Skeleton>
|
||||
|
||||
|
||||
|
||||
</TabPanel>
|
||||
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel value="class-description">
|
||||
<div class="flex justify-end">
|
||||
<Button label="Execute RE Class"
|
||||
@click="openToastRE"
|
||||
<Button label="Execute RE Class"
|
||||
@click="openToastRE"
|
||||
v-tooltip.left="'Execute reverse engeenering for the class selected'"
|
||||
:disabled="loadingStore.re_loading">
|
||||
|
||||
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
</div>
|
||||
<div v-if="!loadingStore.re_loading">
|
||||
|
||||
|
||||
|
||||
<p class="m-0" v-if="classLoaded">
|
||||
<MdPreview v-if="classDetails.reDescription != null" class="editor" v-model="classDetails.reDescription" language="en-US" />
|
||||
<MarkdownViewer v-if="classDetails.reDescription != null" class="editor" v-model="classDetails.reDescription" />
|
||||
<p v-else> No Description available for this class</p>
|
||||
</p>
|
||||
<Skeleton v-else width="100%" height="10rem"></Skeleton>
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-9">
|
||||
<div v-if="!loadingMethod && selectedMethodDetails != null && selectedMethodDetails.reDescription == null" class="card flow-codeviewer">
|
||||
<div v-if="!loadingMethod && selectedMethodDetails != null && selectedMethodDetails.reDescription == null" class="card flow-codeviewer">
|
||||
<h5>Method Code ( No reverse engineering available )</h5>
|
||||
<HighCode
|
||||
class="code"
|
||||
@@ -76,9 +76,9 @@
|
||||
></HighCode>
|
||||
|
||||
</div>
|
||||
<div v-if="!loadingMethod && selectedMethodDetails != null && selectedMethodDetails.reDescription != null" class="card flow-codeviewer">
|
||||
<div v-if="!loadingMethod && selectedMethodDetails != null && selectedMethodDetails.reDescription != null" class="card flow-codeviewer">
|
||||
<h5>Method Explaination</h5>
|
||||
<MdPreview class="editor" v-model="selectedMethodDetails.reDescription" language="en-US" />
|
||||
<MarkdownViewer class="editor" v-model="selectedMethodDetails.reDescription" />
|
||||
|
||||
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Skeleton v-else width="100%" height="10rem"></Skeleton>
|
||||
|
||||
</TabPanel>
|
||||
@@ -96,19 +96,19 @@
|
||||
<!-- Dialog per selezionare lo scenario -->
|
||||
<Dialog v-model:visible="showScenarioDialog" header="Select a Scenario" :closable="false" :modal="true" style="width: 400px;">
|
||||
<div>
|
||||
<Dropdown
|
||||
v-model="selectedScenario"
|
||||
:options="scenario_store.scenariosForRE"
|
||||
optionLabel="name"
|
||||
placeholder="Select a Scenario"
|
||||
class="w-full"
|
||||
<Dropdown
|
||||
v-model="selectedScenario"
|
||||
:options="scenario_store.scenariosForRE"
|
||||
optionLabel="name"
|
||||
placeholder="Select a Scenario"
|
||||
class="w-full"
|
||||
/> </div>
|
||||
<div class="flex justify-end mt-3">
|
||||
<Button label="Cancel" severity="secondary" @click="showScenarioDialog = false" class="mr-2" />
|
||||
<Button label="Execute" severity="primary" :disabled="!selectedScenario" @click="executeScenario" />
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -118,8 +118,6 @@ import { LoadingStore } from '@/stores/LoadingStore';
|
||||
import { ScenarioStore } from '@/stores/ScenarioStore';
|
||||
import { UserPrefStore } from '@/stores/UserPrefStore.js';
|
||||
import axios from 'axios';
|
||||
import { MdPreview } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import Tab from 'primevue/tab';
|
||||
import TabList from 'primevue/tablist';
|
||||
import TabPanel from 'primevue/tabpanel';
|
||||
@@ -131,6 +129,7 @@ import { defineProps, onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import { HighCode } from 'vue-highlight-code';
|
||||
import 'vue-highlight-code/dist/style.css';
|
||||
import { JellyfishLoader } from "vue3-spinner";
|
||||
import MarkdownViewer from './MarkdownViewer.vue';
|
||||
import { useLayout } from './useLayout';
|
||||
|
||||
|
||||
@@ -180,7 +179,7 @@ onMounted(() => {
|
||||
loadClassDetails();
|
||||
console.log("class details: ", classDetails.value);
|
||||
console.log("class name: ", className.value);
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -214,14 +213,14 @@ const executeScenario = () => {
|
||||
function checkExtension() {
|
||||
// Ottieni la parte dopo il punto
|
||||
const extension = userPrefStore.getSelFile.split('.').pop();
|
||||
|
||||
|
||||
// Controlla se è "java"
|
||||
if (extension === 'java' || extension === 'jsp') {
|
||||
commonRevRequest.applicationType = extension;
|
||||
} else {
|
||||
commonRevRequest.applicationType = 'GENERIC';
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Logica per eseguire l'RE
|
||||
@@ -260,7 +259,7 @@ const doREClass = () => {
|
||||
|
||||
const doREClass = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
commonRevRequest.fullClassQualifiedName = className.value;
|
||||
commonRevRequest.applicationName = userPrefStore.getSelApp.internal_name;
|
||||
@@ -278,8 +277,8 @@ const doREClass = () => {
|
||||
life: 3000 // Durata della notifica in millisecondi
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
}*/
|
||||
// Function to start polling
|
||||
@@ -289,7 +288,7 @@ const doREClass = () => {
|
||||
loadingStore.re_loading = true;
|
||||
pollingInterval = setInterval(() => pollREBackendAPI(processId), 5000);
|
||||
console.log("Polling started.");
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Function to stop polling
|
||||
@@ -324,7 +323,7 @@ axios.get('/java-re-module/getProgressRevSingleClass/'+processId).then(response
|
||||
}
|
||||
|
||||
//stopPolling();
|
||||
|
||||
|
||||
/*if (response.data.status == 'OK' || response.data.status == 'ERROR') {
|
||||
console.log("Condition met, stopping polling.");
|
||||
stopPolling();
|
||||
@@ -370,7 +369,7 @@ function loadClassDetails() {
|
||||
if (classDetails.value.methods != null) {
|
||||
methods.value = createMethodList();
|
||||
}
|
||||
|
||||
|
||||
classLoaded.value = true;
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user