Skip to content

Commit f16ffe3

Browse files
authored
Add progress indicator for single model OD upload (#2154)
1 parent 45236b8 commit f16ffe3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

photon-client/src/components/settings/ObjectDetectionCard.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,23 @@ const handleImport = async () => {
4545
4646
axios
4747
.post("/objectdetection/import", formData, {
48-
headers: { "Content-Type": "multipart/form-data" }
48+
headers: { "Content-Type": "multipart/form-data" },
49+
onUploadProgress: ({ progress }) => {
50+
const uploadPercentage = (progress || 0) * 100.0;
51+
if (uploadPercentage < 99.5) {
52+
useStateStore().showSnackbarMessage({
53+
message: "Object Detection Model Upload in Process, " + uploadPercentage.toFixed(2) + "% complete",
54+
color: "secondary",
55+
timeout: -1
56+
});
57+
} else {
58+
useStateStore().showSnackbarMessage({
59+
message: "Processing uploaded Object Detection Model...",
60+
color: "secondary",
61+
timeout: -1
62+
});
63+
}
64+
}
4965
})
5066
.then((response) => {
5167
useStateStore().showSnackbarMessage({

0 commit comments

Comments
 (0)