Skip to content

Commit

Permalink
Fix task data upload progress bar (#4134)
Browse files Browse the repository at this point in the history
* fix progressbar

* updated changelog, changed progress check
  • Loading branch information
klakhov committed Jan 10, 2022
1 parent 4345048 commit 8e4dd14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
- 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>)
- Fixed task data upload progressbar(<https://github.com/openvinotoolkit/cvat/pull/4134>)

### Security
- Updated ELK to 6.8.22 which uses log4j 2.17.0 (<https://github.com/openvinotoolkit/cvat/pull/4052>)
Expand Down
8 changes: 4 additions & 4 deletions cvat-core/src/server-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@
},
onProgress(bytesUploaded) {
const currentUploadedSize = totalSentSize + bytesUploaded;
const percentage = ((currentUploadedSize / totalSize) * 100).toFixed(2);
onUpdate(`The data are being uploaded to the server ${percentage}%`);
const percentage = currentUploadedSize / totalSize;
onUpdate('The data are being uploaded to the server', percentage);
},
onSuccess() {
totalSentSize += file.size;
Expand Down Expand Up @@ -869,8 +869,8 @@
for (const [idx, element] of fileBulks[currentChunkNumber].files.entries()) {
taskData.append(`client_files[${idx}]`, element);
}
onUpdate(`The data are being uploaded to the server
${((totalSentSize / totalSize) * 100).toFixed(2)}%`);
const percentage = totalSentSize / totalSize;
onUpdate('The data are being uploaded to the server', percentage);
await Axios.post(`${backendAPI}/tasks/${taskId}/data`, taskData, {
...params,
proxy: config.proxy,
Expand Down

0 comments on commit 8e4dd14

Please sign in to comment.