Fix task data upload progress bar (#4134)

* fix progressbar

* updated changelog, changed progress check
main
Kirill Lakhov 4 years ago committed by GitHub
parent 4345048542
commit 8e4dd14de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added information to export CVAT_HOST when performing local installation for accessing over network (<https://github.com/openvinotoolkit/cvat/pull/4014>) - Added information to export CVAT_HOST when performing local installation for accessing over network (<https://github.com/openvinotoolkit/cvat/pull/4014>)
- Fixed possible color collisions in the generated colormap (<https://github.com/openvinotoolkit/cvat/pull/4007>) - Fixed possible color collisions in the generated colormap (<https://github.com/openvinotoolkit/cvat/pull/4007>)
- Original pdf file is deleted when using share(<https://github.com/openvinotoolkit/cvat/pull/3967>) - Original pdf file is deleted when using share(<https://github.com/openvinotoolkit/cvat/pull/3967>)
- Fixed task data upload progressbar(<https://github.com/openvinotoolkit/cvat/pull/4134>)
### Security ### Security
- Updated ELK to 6.8.22 which uses log4j 2.17.0 (<https://github.com/openvinotoolkit/cvat/pull/4052>) - Updated ELK to 6.8.22 which uses log4j 2.17.0 (<https://github.com/openvinotoolkit/cvat/pull/4052>)

@ -840,8 +840,8 @@
}, },
onProgress(bytesUploaded) { onProgress(bytesUploaded) {
const currentUploadedSize = totalSentSize + bytesUploaded; const currentUploadedSize = totalSentSize + bytesUploaded;
const percentage = ((currentUploadedSize / totalSize) * 100).toFixed(2); const percentage = currentUploadedSize / totalSize;
onUpdate(`The data are being uploaded to the server ${percentage}%`); onUpdate('The data are being uploaded to the server', percentage);
}, },
onSuccess() { onSuccess() {
totalSentSize += file.size; totalSentSize += file.size;
@ -869,8 +869,8 @@
for (const [idx, element] of fileBulks[currentChunkNumber].files.entries()) { for (const [idx, element] of fileBulks[currentChunkNumber].files.entries()) {
taskData.append(`client_files[${idx}]`, element); taskData.append(`client_files[${idx}]`, element);
} }
onUpdate(`The data are being uploaded to the server const percentage = totalSentSize / totalSize;
${((totalSentSize / totalSize) * 100).toFixed(2)}%`); onUpdate('The data are being uploaded to the server', percentage);
await Axios.post(`${backendAPI}/tasks/${taskId}/data`, taskData, { await Axios.post(`${backendAPI}/tasks/${taskId}/data`, taskData, {
...params, ...params,
proxy: config.proxy, proxy: config.proxy,

Loading…
Cancel
Save