Closed fohrloop closed 2 years ago
The status.mb_uploaded
can be taken from flow.sizeUploaded()
. The status.mb_total
can be taken from flow.getSize()
.
The flow.timeRemaining()
seems a bit unstable. The number given by the flow component will need some filtering before the value would be displayed to the user.
Here is a screen capture from situation where multiple files were "uploaded" (locally, no throttling). The timeRemaining()
value jumped from 10s to ~20.000s when file was changed. This could be made working some day by keeping track of used time in the JS side and calculating longer time averages. As this is not priority right now, I'm dropping the attribute status.timeremaining
from the list.
In the dash-uploader 0.7.0 update, the new (proposed) callback syntax is
du.UploadStatus attributes
The
du.UploadStatus
object could includestatus.latest_file
(pathlib.Path): The full file path to the file that has been latest uploadedstatus.uploaded_files
(list of pathlib.Path): The list of full file paths to all of the uploaded files. (uploaded in this session)status.is_completed
(bool): True if all the files have been uploadedstatus.n_uploaded
(int): The number of files already uploaded in this sessionstatus.n_total
(int): The number of files to be uploaded.status.uploaded_size_mb
(float): Size of files uploaded in Megabytesstatus.total_size_mb
(float): Total size of files to be uploaded in Megabytesstatus.upload_id
(str or None): The upload id used in the upload process, if any.status.progress
(float): From 0 to 1, indicating the current upload progress of all files. Fromflow.progress()
. Todo: Is this calculated based on amount of files or total file size?status.timeremaining
(float): The remaining time to upload all files, in seconds. Fromflow.timeRemaining()
.~ Dropped from the list (see https://github.com/np-8/dash-uploader/issues/68#issuecomment-1046192895).Goal: implement this
UploadStatus
class. It will serve as guide when implementing theprops
andstate
or theUpload_ReactComponent
of the 0.7.0 release.