Merged PR 39: refinements
This commit is contained in:
@@ -16,7 +16,7 @@ const model = ref([
|
|||||||
label: 'Vector Database',
|
label: 'Vector Database',
|
||||||
items: [//{ label: 'Dashboard', icon: 'pi pi-fw pi-home', to: '/' },
|
items: [//{ label: 'Dashboard', icon: 'pi pi-fw pi-home', to: '/' },
|
||||||
{ label: 'Similarity Search', icon: 'pi pi-fw pi-search', to: '/ks_similarity_search' },
|
{ label: 'Similarity Search', icon: 'pi pi-fw pi-search', to: '/ks_similarity_search' },
|
||||||
{ label: 'Vector Database Search', icon: 'pi pi-fw pi-search', to: '/ks_vector_data' }
|
//{ label: 'Vector Database Search', icon: 'pi pi-fw pi-search', to: '/ks_vector_data' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
12
src/service/KsCodeRepoService.js
Normal file
12
src/service/KsCodeRepoService.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
export const KsCodeRepoService = {
|
||||||
|
getKsCodeRepo() {
|
||||||
|
return axios.get('/fe-api/ks_git_repos')
|
||||||
|
},
|
||||||
|
|
||||||
|
pauseRERepo(processId){
|
||||||
|
return axios.get('/java-re-module/pauseRERepo/'+processId)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
38
src/stores/KsCodeRepoStore.js
Normal file
38
src/stores/KsCodeRepoStore.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { defineStore } from 'pinia';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { KsCodeRepoService } from '../service/KsCodeRepoService';
|
||||||
|
import { LoadingStore } from './LoadingStore';
|
||||||
|
|
||||||
|
|
||||||
|
export const KsCodeRepoStore = defineStore('ks_code_repo_store', () => {
|
||||||
|
|
||||||
|
const lstKsCodeRepo = ref([])
|
||||||
|
const selectedKsCodeRepo = ref(null)
|
||||||
|
const loadingStore = LoadingStore()
|
||||||
|
|
||||||
|
|
||||||
|
async function fetchKsCodeRepoStore() {
|
||||||
|
console.log("i'm in");
|
||||||
|
loadingStore.scenario_loading = true;
|
||||||
|
return KsCodeRepoService.getKsCodeRepo().then(resp => {
|
||||||
|
lstKsCodeRepo.value = resp.data;
|
||||||
|
console.log("lstKsCodeRepo", lstKsCodeRepo.value);
|
||||||
|
loadingStore.scenario_loading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
const KsCodeRepo = computed(() => {
|
||||||
|
return lstKsCodeRepo.value
|
||||||
|
})
|
||||||
|
|
||||||
|
const getSelectedKsCodeRepo = computed(() => {
|
||||||
|
return selectedKsCodeRepo.value
|
||||||
|
})
|
||||||
|
|
||||||
|
async function setSelectedKsCodeRepo(ksDoc){
|
||||||
|
selectedKsCodeRepo.value = ksDoc
|
||||||
|
console.log("selectedKsCodeRepo", selectedKsCodeRepo.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { fetchKsCodeRepoStore, selectedKsCodeRepo, KsCodeRepo, getSelectedKsCodeRepo, setSelectedKsCodeRepo}
|
||||||
|
})
|
||||||
@@ -222,7 +222,7 @@ import { FilterMatchMode, FilterOperator } from '@primevue/core/api';
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useToast } from 'primevue/usetoast';
|
import { useToast } from 'primevue/usetoast';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { useConfirm } from "primevue/useconfirm";
|
import { useConfirm } from "primevue/useconfirm";
|
||||||
@@ -231,6 +231,9 @@ import ProgressBar from 'primevue/progressbar';
|
|||||||
|
|
||||||
|
|
||||||
import VueJsonView from '@matpool/vue-json-view';
|
import VueJsonView from '@matpool/vue-json-view';
|
||||||
|
import ProgressBar from 'primevue/progressbar';
|
||||||
|
import { KsCodeRepoStore } from '../../../../stores/KsCodeRepoStore';
|
||||||
|
import { UserPrefStore } from '../../../../stores/UserPrefStore';
|
||||||
|
|
||||||
//dialog
|
//dialog
|
||||||
import cloneForm from './KsGitCodeParserDialog.vue';
|
import cloneForm from './KsGitCodeParserDialog.vue';
|
||||||
@@ -259,12 +262,12 @@ const loading = ref(true);
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const confirm = useConfirm();
|
const confirm = useConfirm();
|
||||||
const expandedRows = ref({});
|
const expandedRows = ref({});
|
||||||
|
const ks_code_repo_store = KsCodeRepoStore();
|
||||||
const ingestionResult = ref('');
|
const ingestionResult = ref('');
|
||||||
const popupTitle = ref('');
|
const popupTitle = ref('');
|
||||||
const popupMessage = ref('');
|
const popupMessage = ref('');
|
||||||
const statuses = ref(['ERROR', 'IN-PROGRESS', 'INGESTED', 'NEW', 'COMPLETED']);
|
const statuses = ref(['ERROR', 'IN-PROGRESS', 'INGESTED', 'NEW', 'COMPLETED']);
|
||||||
|
const userPrefStore = UserPrefStore();
|
||||||
const collapsed = ref(1)
|
const collapsed = ref(1)
|
||||||
const theme = ref('bright:inverted')
|
const theme = ref('bright:inverted')
|
||||||
const sortKeys = ref(true)
|
const sortKeys = ref(true)
|
||||||
@@ -402,10 +405,16 @@ function calculateCustomerTotal(name) {
|
|||||||
|
|
||||||
const fetchCodeRepoInfo = async () => {
|
const fetchCodeRepoInfo = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get('/fe-api/ks_git_repos');
|
await ks_code_repo_store.fetchKsCodeRepoStore()
|
||||||
|
console.log("here");
|
||||||
|
//const response = await axios.get('/fe-api/ks_git_repos');
|
||||||
//console.log(response.data);
|
//console.log(response.data);
|
||||||
const filterDate = getCustomDatewithAllResponse(response.data);
|
//const filterDate = getCustomDatewithAllResponse(response.data);
|
||||||
|
console.log("ks_code_repo_store", ks_code_repo_store.KsCodeRepo);
|
||||||
|
const filterDate = getCustomDatewithAllResponse(ks_code_repo_store.KsCodeRepo);
|
||||||
|
console.log("filterDate", filterDate);
|
||||||
const filterParseEnabled = getCustomJsonWithJavaParseEnabled(filterDate);
|
const filterParseEnabled = getCustomJsonWithJavaParseEnabled(filterDate);
|
||||||
|
console.log("filterParseEnabled", filterParseEnabled);
|
||||||
codeRepoInfo.value = await updateParsingProgress(filterParseEnabled);
|
codeRepoInfo.value = await updateParsingProgress(filterParseEnabled);
|
||||||
codeRepoInfo.value = await updateRevProgress(filterParseEnabled);
|
codeRepoInfo.value = await updateRevProgress(filterParseEnabled);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -414,6 +423,12 @@ const fetchCodeRepoInfo = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function updateKsRepo() {
|
||||||
|
stopPolling();
|
||||||
|
fetchCodeRepoInfo();
|
||||||
|
startPolling();
|
||||||
|
};
|
||||||
|
|
||||||
const getCustomDatewithAllResponse = (data) => {
|
const getCustomDatewithAllResponse = (data) => {
|
||||||
return [...(data || [])].map((d) => {
|
return [...(data || [])].map((d) => {
|
||||||
d.ingestionDateFormat = new Date(d.ingestionDateFormat);
|
d.ingestionDateFormat = new Date(d.ingestionDateFormat);
|
||||||
@@ -639,6 +654,8 @@ const collapseAll = () => {
|
|||||||
function isButtonDisabled(data) {
|
function isButtonDisabled(data) {
|
||||||
return data.cloneStatus !== 'COMPLETED';
|
return data.cloneStatus !== 'COMPLETED';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => userPrefStore.getSelApp, updateKsRepo, { immediate: true });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -8,8 +8,11 @@
|
|||||||
<div class="select-container">
|
<div class="select-container">
|
||||||
<!--SelectButton id="type" v-model="dropdownItem" :options="dropdownItems" optionLabel="name"
|
<!--SelectButton id="type" v-model="dropdownItem" :options="dropdownItems" optionLabel="name"
|
||||||
class="select-button" /-->
|
class="select-button" /-->
|
||||||
<InputText v-model="filterQuery" type="text" placeholder="Add filterQuery" />
|
<InputText v-model="filterQuery" type="text" placeholder="Add filterQuery" disabled :title="filterQuery" />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Aggiunta della picklist -->
|
||||||
|
<Dropdown v-model="selectedDoctype" :options="doctypeOptions" optionLabel="label" placeholder="Select Doctype"
|
||||||
|
:disabled="isPicklistDisabled" class="doctype-dropdown" @change="updateQuery()" />
|
||||||
</div>
|
</div>
|
||||||
<Button label="Query" icon="pi pi-send" @click="sendQuery" class="send-button" />
|
<Button label="Query" icon="pi pi-send" @click="sendQuery" class="send-button" />
|
||||||
</div>
|
</div>
|
||||||
@@ -34,7 +37,7 @@ import Button from 'primevue/button';
|
|||||||
import Card from 'primevue/card';
|
import Card from 'primevue/card';
|
||||||
import ScrollPanel from 'primevue/scrollpanel';
|
import ScrollPanel from 'primevue/scrollpanel';
|
||||||
import { useToast } from 'primevue/usetoast';
|
import { useToast } from 'primevue/usetoast';
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
import { onBeforeRouteLeave } from 'vue-router';
|
import { onBeforeRouteLeave } from 'vue-router';
|
||||||
import { KsDocumentStore } from '../../../stores/KsDocumentStore';
|
import { KsDocumentStore } from '../../../stores/KsDocumentStore';
|
||||||
import { UserPrefStore } from '../../../stores/UserPrefStore';
|
import { UserPrefStore } from '../../../stores/UserPrefStore';
|
||||||
@@ -55,6 +58,16 @@ const dropdownItems = [
|
|||||||
{ name: 'Deploy Documentation', code: 'deploy-documentation' },
|
{ name: 'Deploy Documentation', code: 'deploy-documentation' },
|
||||||
{ name: 'Source code', code: 'sourcecode' }
|
{ name: 'Source code', code: 'sourcecode' }
|
||||||
];
|
];
|
||||||
|
const isPicklistDisabled = computed(() => ksDocumentStore.getSelectedKsDocument !== null);
|
||||||
|
|
||||||
|
|
||||||
|
// Aggiungi i valori della picklist
|
||||||
|
const selectedDoctype = ref(null);
|
||||||
|
const doctypeOptions = ref([
|
||||||
|
{ label: 'All', value: 'all' },
|
||||||
|
{ label: 'Functional', value: 'functional' },
|
||||||
|
{ label: 'Code Instruction', value: 'code_instruction' }
|
||||||
|
]);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('SimilaritySearch page mounted');
|
console.log('SimilaritySearch page mounted');
|
||||||
@@ -68,6 +81,8 @@ onMounted(() => {
|
|||||||
+ "'";
|
+ "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
filterQuery.value = "'KsApplicationName' == '" + doc.ingestionInfo.metadata.KsApplicationName
|
filterQuery.value = "'KsApplicationName' == '" + doc.ingestionInfo.metadata.KsApplicationName
|
||||||
+ "' AND " + "'KsProjectName' == '" + doc.ingestionInfo.metadata.KsProjectName
|
+ "' AND " + "'KsProjectName' == '" + doc.ingestionInfo.metadata.KsProjectName
|
||||||
@@ -77,6 +92,24 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updateQuery() {
|
||||||
|
|
||||||
|
if (userPrefStore.getSelApp == null) {
|
||||||
|
filterQuery.value = "'KsProjectName' == '" + userPrefStore.selectedProject.internal_name
|
||||||
|
+ "'";
|
||||||
|
} else {
|
||||||
|
filterQuery.value = "'KsApplicationName' == '" + userPrefStore.getSelApp.internal_name
|
||||||
|
+ "' AND " + "'KsProjectName' == '" + userPrefStore.selectedProject.internal_name
|
||||||
|
+ "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDoctype.value && selectedDoctype.value.value !== "all") {
|
||||||
|
filterQuery.value = filterQuery.value + " AND 'KsDoctype' == '" + selectedDoctype.value.value + "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Filter query:', filterQuery.value);
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeRouteLeave(() => {
|
onBeforeRouteLeave(() => {
|
||||||
ksDocumentStore.setSelectedKsDocument(null);
|
ksDocumentStore.setSelectedKsDocument(null);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user