kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed delta calculations in progress upload
rodzic
6d7a9dbf77
commit
d0b64db08d
|
@ -141,11 +141,13 @@ class ProjectListItem extends React.Component {
|
||||||
.on("uploadprogress", (file, progress, bytesSent) => {
|
.on("uploadprogress", (file, progress, bytesSent) => {
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
|
|
||||||
if (now - this.state.upload.lastUpdated > 500){
|
if (bytesSent > file.size) bytesSent = file.size;
|
||||||
file.deltaBytesSent = bytesSent - file.deltaBytesSent;
|
|
||||||
file.trackedBytesSent += file.deltaBytesSent;
|
|
||||||
|
|
||||||
const totalBytesSent = this.state.upload.totalBytesSent + file.deltaBytesSent;
|
if (progress === 100 || now - this.state.upload.lastUpdated > 500){
|
||||||
|
const deltaBytesSent = bytesSent - file.deltaBytesSent;
|
||||||
|
file.trackedBytesSent += deltaBytesSent;
|
||||||
|
|
||||||
|
const totalBytesSent = this.state.upload.totalBytesSent + deltaBytesSent;
|
||||||
const progress = totalBytesSent / this.state.upload.totalBytes * 100;
|
const progress = totalBytesSent / this.state.upload.totalBytes * 100;
|
||||||
|
|
||||||
this.setUploadState({
|
this.setUploadState({
|
||||||
|
@ -153,6 +155,8 @@ class ProjectListItem extends React.Component {
|
||||||
totalBytesSent,
|
totalBytesSent,
|
||||||
lastUpdated: now
|
lastUpdated: now
|
||||||
});
|
});
|
||||||
|
|
||||||
|
file.deltaBytesSent = bytesSent;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on("complete", (file) => {
|
.on("complete", (file) => {
|
||||||
|
|
Ładowanie…
Reference in New Issue