Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display Upload Progress as Percentage and File Size / Total File Size (Take Two) #3111

Merged

Conversation

alexjyong
Copy link
Contributor

@alexjyong alexjyong commented Apr 11, 2024

Description
preview of upload info panel

(Re-do of PR 3079. Between a few glitches that I found combined with the migration to Vue 3 and all the conflicts it made, I figured it would be easier to just spin up a new PR.)

Uploads will now show progress as percentage and file size /total file size of all files being uploaded.

I noticed this was missing when I was uploading files to my server. Figured it would be useful for determining how much is left beyond just an ETA.

Didn't see any issues related to this however.

  • DO make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • DO make sure you are making a pull request against the master branch (left side). Also you should start your branch off our master.
  • DO make sure that File Browser can be successfully built. See builds and development.
  • AVOID breaking the continuous integration build.

@alexjyong alexjyong marked this pull request as ready for review April 11, 2024 21:52
@alexjyong alexjyong requested a review from o1egl as a code owner April 11, 2024 21:52
@alexjyong alexjyong changed the title Display Upload Progress as Percentage and File Size / Total File Size (Take Two) feat: Display Upload Progress as Percentage and File Size / Total File Size (Take Two) Apr 12, 2024
@maeryo
Copy link
Contributor

maeryo commented Apr 18, 2024

cool!
does this feature work properly when uploading multiple files or directories?

@alexjyong
Copy link
Contributor Author

@maeryo Yep!
Multiple files

image image

Multiple directories (i do find it odd that it doesn't show the directory name being uploaded as well)

image

frontend/src/stores/upload.ts Show resolved Hide resolved
Comment on lines 81 to 83
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(totalSize) / Math.log(1024));
return parseFloat((totalSize / Math.pow(1024, i)).toFixed(2)) + ' ' + sizes[i];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code segment is duplicated and can be extracted into a common function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at that. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went and implemented this! d29dee3

@kloon15
Copy link
Contributor

kloon15 commented Apr 25, 2024

Is it just me, or if ur uploading more than one file simultaneously, the download speed is wrong? 1 file displays 9mb/s while 5 files shows 1.5mb/s or something like that.
Looks like its divided by the number of current uploads.

@alexjyong
Copy link
Contributor Author

@kloon15 I'll try to reproduce that and if I can, I'll patch it up. Good catch!

@kloon15
Copy link
Contributor

kloon15 commented Apr 25, 2024

And if u could format ur code with npm run format that would be great.😃

@alexjyong
Copy link
Contributor Author

@kloon15 Ahhhhhhhhh, I committed a few seconds too late, I just ran the prettier job. :P
I'm having trouble reproducing the bug you saw. Maybe I'm doing something wrong?

@kloon15
Copy link
Contributor

kloon15 commented Apr 25, 2024

@kloon15 Ahhhhhhhhh, I committed a few seconds too late, I just ran the prettier job. :P I'm having trouble reproducing the bug you saw. Maybe I'm doing something wrong?

No worries, ill double check it tomorrow, maybe it was a one time thing, could have been a network issue or smth.

@kloon15
Copy link
Contributor

kloon15 commented Apr 26, 2024

@kloon15 Ahhhhhhhhh, I committed a few seconds too late, I just ran the prettier job. :P I'm having trouble reproducing the bug you saw. Maybe I'm doing something wrong?

I just tested it again, as soon as i add a second file, the indicated speed drops to about half of what it was before:
image
image

@alexjyong
Copy link
Contributor Author

@kloon15 Thanks! Although it appears this existed before my branch though, since this seems to exist in master without my changes.

Screenshot 2024-04-26 at 2 00 47 PM Screenshot 2024-04-26 at 2 00 58 PM

In master the speed did eventually go up, although a bit slower than before (which is expected, since I was uploading more files now.)

And I do see the issue in my branch as well. I think this already existed, although I wonder if it's a bug or the upload libraries getting things together? Because it eventually levels out to near what it was.

Screenshot 2024-04-26 at 2 14 01 PM Screenshot 2024-04-26 at 2 14 16 PM

@kloon15 did you see the same thing with the speed leveling out as well?

@kloon15
Copy link
Contributor

kloon15 commented Apr 27, 2024

@kloon15 Thanks! Although it appears this existed before my branch though, since this seems to exist in master without my changes.
Screenshot 2024-04-26 at 2 00 47 PM Screenshot 2024-04-26 at 2 00 58 PM

In master the speed did eventually go up, although a bit slower than before (which is expected, since I was uploading more files now.)

And I do see the issue in my branch as well. I think this already existed, although I wonder if it's a bug or the upload libraries getting things together? Because it eventually levels out to near what it was.
Screenshot 2024-04-26 at 2 14 01 PM Screenshot 2024-04-26 at 2 14 16 PM

@kloon15 did you see the same thing with the speed leveling out as well?

No it has nothing to do w ur branch or modifications, just brought it up since ur adding/reworking to it and that maybe smth is wrong w it.
Yea the speed started out low and then went up, thats when i took both screenshots, it never leveled out to what its supposed to be. Im gonna also mention that the estimated time is also wrong for me.
Heres a comparison with uploading 5 files with filebrowser and winscp, just compare and its actually the exact same speed for a single file and the time is added up:
image
image

@o1egl
Copy link
Member

o1egl commented Apr 28, 2024

I have observed that when I choose to upload a file that already exists, the "replace" modal window appears briefly and then disappears immediately. However, this behavior is not replicated when I use the drag-and-drop feature. I'm going to merge this PR since this issue is not related to it. Nevertheless, it would be great if one of you (@kloon15, @alexjyong) could take a closer look into this matter.

@o1egl o1egl merged commit 236ca63 into filebrowser:master Apr 28, 2024
8 checks passed
@alexjyong
Copy link
Contributor Author

@o1egl I'll check it out if I get some time 🙂 . So it's not forgotten, I've made an issue here tracking it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants