Update ingestion status handling and improve document update logic
This commit is contained in:
@@ -167,6 +167,7 @@ const statuses = ref(['NEW', 'LOADED', 'INGESTED', 'FAILED', 'ERROR']); // Add y
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
userPrefStore.fetchUserData().then(() => {
|
userPrefStore.fetchUserData().then(() => {
|
||||||
updateDocuments();
|
updateDocuments();
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
updateDocuments();
|
updateDocuments();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
@@ -318,18 +319,20 @@ const confirmDeleteFromVectorStore = (id) => {
|
|||||||
//ingestion
|
//ingestion
|
||||||
const startIndividualngestion = (id) => {
|
const startIndividualngestion = (id) => {
|
||||||
toast.add({ severity: 'info', summary: 'Info', detail: 'Starting Ingestion', life: 3000 });
|
toast.add({ severity: 'info', summary: 'Info', detail: 'Starting Ingestion', life: 3000 });
|
||||||
|
fe_status = "IN PROGRESS"
|
||||||
axios.get(`/test/ingest_document/${id}`)
|
axios.get(`/test/ingest_document/${id}`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data.status == "OK") {
|
if (response.data.status == "OK") {
|
||||||
toast.add({ severity: 'success', summary: 'Success', detail: 'Document ingestion started...', life: 3000 });
|
toast.add({ severity: 'success', summary: 'Success', detail: 'Document ingestion started...', life: 3000 });
|
||||||
|
fe_status = "IN PROGRESS"
|
||||||
}
|
}
|
||||||
if (response.data.status == "ERROR") {
|
if (response.data.status == "ERROR") {
|
||||||
toast.add({ severity: 'error', summary: 'Success', detail: 'Error ingesting document:' + response.data.message, life: 3000 });
|
toast.add({ severity: 'error', summary: 'Success', detail: 'Error ingesting document:' + response.data.message, life: 3000 });
|
||||||
|
fe_status = "ERROR"
|
||||||
}
|
}
|
||||||
ksdocuments.value.forEach(element => {
|
ksdocuments.value.forEach(element => {
|
||||||
if (element.id == id) {
|
if (element.id == id) {
|
||||||
element.ingestionStatus = response.data.status
|
element.ingestionStatus = fe_status
|
||||||
console.log("Updated element", element)
|
console.log("Updated element", element)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user