mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Add progress indicator for single model OD upload (#2154)
This commit is contained in:
@@ -45,7 +45,23 @@ const handleImport = async () => {
|
|||||||
|
|
||||||
axios
|
axios
|
||||||
.post("/objectdetection/import", formData, {
|
.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) => {
|
.then((response) => {
|
||||||
useStateStore().showSnackbarMessage({
|
useStateStore().showSnackbarMessage({
|
||||||
|
|||||||
Reference in New Issue
Block a user