add rev status

This commit is contained in:
DIR\maria.del.valle
2024-10-31 10:31:52 +01:00
parent 5ea634d511
commit 6b2396b2ea

View File

@@ -165,6 +165,16 @@
</template>
</Column>
<Column field="progressRE" header="RE Progress" :showFilterMatchModes="false" style="min-width: 12rem">
<template #body="slotProps">
<ProgressBar :value="slotProps.data.revInfo.totalFiles === 0 || slotProps.data.revInfo.processedFiles === 0
? 0
: ((slotProps.data.revInfo.processedFiles / slotProps.data.revInfo.totalFiles) *
100)" :showValue="true" style="height: 20px">
</ProgressBar>
</template>
</Column>
<!--Column header="Actions" headerStyle="width: 5rem; text-align: center" bodyStyle="text-align: center; overflow: visible"-->
<Column :exportable="false" style="min-width: 12rem">
<template #body="slotProps">
@@ -310,6 +320,32 @@ const updateParsingProgress = async (data) => {
return updatedData;
};
//updateRevProgress
const updateRevProgress = async (data) => {
const updatedData = await Promise.all((data || []).map(async (d) => {
const firstStatus = d.revEngineeringStatuses[0].status;
console.log("rev firstStatus", firstStatus);
if (d.revEngineeringStatuses[0].status === "IN PROGRESS") {
try {
const revResponse = await axios.get(`/get-re-status?id=${d.revEngineeringStatuses[0].revProcessId}`);
d.revInfo = revResponse.data;
} catch (error) {
console.error("Error fetching rev status:", error);
d.revInfo = { totalFiles: 0, processedFiles: 0 };
}
} else if (d.revEngineeringStatuses[0].status === "DONE") {
d.revInfo = { totalFiles: 1, processedFiles: 1 };
} else {
d.revInfo = { totalFiles: 0, processedFiles: 0 };
}
return d;
}));
return updatedData;
};
//polling
// Function to start polling
let pollingInterval = null;
@@ -371,6 +407,7 @@ const fetchCodeRepoInfo = async () => {
const filterDate = getCustomDatewithAllResponse(response.data);
const filterParseEnabled = getCustomJsonWithJavaParseEnabled(filterDate);
codeRepoInfo.value = await updateParsingProgress(filterParseEnabled);
codeRepoInfo.value = await updateRevProgress(filterParseEnabled);
loading.value = false;
} catch (error) {
console.error('Failed to fetch code repo info:', error);