Add progress indicator for single model OD upload (#2154)

This commit is contained in:
Sam Freund
2025-10-30 01:11:25 -05:00
committed by GitHub
parent 45236b872a
commit f16ffe3cd2

View File

@@ -45,7 +45,23 @@ const handleImport = async () => {
axios
.post("/objectdetection/import", formData, {
headers: { "Content-Type": "multipart/form-data" }
headers: { "Content-Type": "multipart/form-data" },
onUploadProgress: ({ progress }) => {
const uploadPercentage = (progress || 0) * 100.0;
if (uploadPercentage < 99.5) {
useStateStore().showSnackbarMessage({
message: "Object Detection Model Upload in Process, " + uploadPercentage.toFixed(2) + "% complete",
color: "secondary",
timeout: -1
});
} else {
useStateStore().showSnackbarMessage({
message: "Processing uploaded Object Detection Model...",
color: "secondary",
timeout: -1
});
}
}
})
.then((response) => {
useStateStore().showSnackbarMessage({