Skip to content

Enhancement: Show "time left" during upload in Web UI. #8105

Closed

Description

@enoch85

Would be nice to have some information about how long time there is left during upload in the Web UI.

This is good for example when you´re on a slow internet connection and is uploading many files at the same time. Or for big files uploads.

Anyway, would be nice to have.

Activity

  1. PVince81 commented on Apr 8, 2014

    @PVince81
    Contributor

    Similar to #7173

    One trouble is that it's not possible to know how many bytes were uploaded while a file is uploading.
    But it is possible to detect how much time was required for a single file from a batch to be uploaded
    Since the file size is known, it could be used to calculate the estimated time.

    This means it can only work for a batch of files (more than one file).

  2. stefan-niedermann commented on Apr 15, 2014

    @stefan-niedermann

    how is the progress bar calculated? There could be a simple timer that starts when the progress bar starts, and then you can calculate the time which should be left. (e.g. 10% in the progressbar - 1 minute, so rest time is round about 9 minutes).

  3. enoch85 commented on Apr 17, 2014

    @enoch85
    Author

    I´d think that the most simple way is to just show how many MB that´s left of the upload.

    For example: 1542.4 MB of 20487.5 MB (left)

  4. PVince81 commented on Apr 30, 2014

    @PVince81
    Contributor

    There seem to be progress events triggered already and they contain the uploaded size and total size. That place could be the starting point for making such measurements, see: https://github.com/owncloud/core/blob/master/apps/files/js/file-upload.js#L451

  5. enoch85 commented on May 1, 2014

    @enoch85
    Author

    I´m not a programmer but what I mean is something like this: owncloud/client#1717

    Do you think that would be hard to implement in the core as well? @PVince81

  6. enoch85 commented on Jul 14, 2014

    @enoch85
    Author

    Any new info here?

  7. luckydonald commented on Aug 7, 2014

    @luckydonald
    Contributor

    I realized the upload progress bar has nice detailed percent values, (99.04551991172397%) which could be used for calculations of remaining time?

    <div id="uploadprogresswrapper">
        <div aria-valuenow="18.84359733100012" aria-valuemax="100" aria-valuemin="0" role="progressbar" class="ui-progressbar ui-widget ui-widget-content ui-corner-all" id="uploadprogressbar"><div style="display: block; width: 21%;" class="ui-progressbar-value ui-widget-header ui-corner-left"></div></div>
        <input original-title="" class="stop icon-close" style="" value="" type="button">
    </div>

    Also for large files it would be great to display some numbers/stats at all, because it is difficult to watch a bar moving 1px while waiting.
    Having a frequent changing number shows progress, while it change doesn't change the bar with.
    For me it is very helpful to see, there is really something happening, changing.

    Example from Mega, they have a batch of stats about the upload:
    2014-08-07 15_55_18-mega 66
    Side-note: Also they show the progress on the title bar
    2014-08-07 15_53_31-documents - dateien - owncloud

    Like Windows 8 did it:
    Besides improving speed, also make the waiting nicer, brag with progress!

  8. PVince81 commented on Aug 8, 2014

    @PVince81
    Contributor

    I don't think this really has high priority right now, but it would be nice if someone would like to look into it and contribute a PR. Even if incomplete, we might be able to provide some guidance.
    It seems @luckydonald is on the right track 😄

  9. enoch85 commented on Aug 9, 2014

    @enoch85
    Author

    @luckydonald Nice! Do you have the skills to make this happen?

  10. luckydonald commented on Aug 9, 2014

    @luckydonald
    Contributor

    Meh, I am not familiar with github and all this push pull things.
    But basicly there should be be a function which sets the %.
    My guess is
    apps/files/js/file-upload.js:466 (or :675 but probably the one)

    var progress = (data.loaded / data.total) * 100;

    There we need some calculation magic.

    But first we need to add a Label div in the HTML apps/files/templates/list.php:40

    <div id="uploadprogressbar"><div class="uploadprogressbar-label">Uploading...</div></div>

    edit2

    <div id="uploadprogressbar"><div id="uploadprogressbar-label">Uploading...</div></div>

    /edit2
    Add some CSS for positioning.

     .progress-label {
        position: absolute;
        left: 50%;
        top: 4px;
        font-weight: bold;
        text-shadow: 1px 1px 0 #fff;
    }

    edit2
    Css file at file/css/upload.css, insert e.g. after line 62.

     #uploadprogressbar-label {
        position: absolute;
        left: 50%;
        top: 4px;
        font-weight: bold;
        text-shadow: 1px 1px 0 #fff;
    }

    /edit2
    Finally set the Progress text, too, while updating the bar: file-upload.js:466 again

    fileupload.on('fileuploadprogressall', function(e, data) {
        OC.Upload.log('progress handle fileuploadprogressall', e, data);
        var progress = (data.loaded / data.total) * 100;
        $('#uploadprogressbar').progressbar('value', progress);
        var labelText = data.loaded  + "/" + data.total + "MB - " + progress + "%"; //here it happens.
        $('#uploadprogressbar-label').text(labelText);
    });

    Regarding the upload speed:
    Maybe the dataobject has such information already.
    Else you could set a timer here and do the math yourself.

    Note: this is non-tested code! (but it could work)
    I only tested the html and the css:
    2014-08-09 16_10_38-documents - dateien - owncloud

    Mainlybecause that ajax part is not easily editable with Firebug, don't want to download all the code and have no time to set up a test server. Also I have no experience with pull requests.
    Aaand I should be learning for some exams, lol.
    Final note: some code here is from this reference: http://jqueryui.com/progressbar/#label
    Edit:
    Or maybe with a custom change function?

    // http://jqueryui.com/progressbar/#label again.
    $('#uploadprogressbar').progressbar({
        value: false,
        change: function() {
            progressLabel.text( progressbar.progressbar( "value" ) + "%" );
        },
        complete: function() {
            progressLabel.text( "Complete!" );
        }
    });
  11. enoch85 commented on Aug 9, 2014

    @enoch85
    Author

    @luckydonald Woha! 👍 You are on to someting here.

    @PVince81 Care to make a pull of this? Pls :)

  12. luckydonald commented on Aug 9, 2014

    @luckydonald
    Contributor

    Ok found it, in the wiki of the used blueimp/jQuery-File-Upload plugin:

    From the data object we can get

    • Upload speed (formatted as GBps/MBps/KBps/Bps).
    • Remaining upload time (formatted as hh:mm:ss).
    • Uploaded and total bytes (formatted as bit/s, kbit/s, Mbit/s, Gbit/s).
    • Percentage of uploaded bytes.

    But there is only data.bitrate as example, so I'm not sure how the other objects are named.

     var labelText = data.loaded  + "/" + data.total + "MB - " + progress + "% @ " + data.bitrate ; //here it happens.

    Also, if it delivers "Percentage of uploaded bytes", do we need to do that calculations in file-upload.js:466 by ourself?
    Edit: it seems to come as string, probably like 12%, so never mind.

  13. enoch85 commented on Aug 9, 2014

    @enoch85
    Author

    @PVince81 Which files does this concern, and have to be changed?

  14. enoch85 commented on Aug 9, 2014

    @enoch85
    Author

    @luckydonald Or do know which files that have to be changed in the core to fix this? You showed an example before, what changes did you do and to what files?

    A pull request is simply making that changes in the core and then make a pull request of it. Maybe @karlitschek can explain? It would be a good start, and other programmers can discuss and improve the code.

  15. 5 remaining items

  16. luckydonald commented on Aug 10, 2014

    @luckydonald
    Contributor

    &%¶@¢!
    XXAMP seems to have problems with the folder stucture, having an own lib folder or something like that.
    Okey because I wanted progress, just used one of my domains instead.
    I am fiddleing around with formating, but it basicly works.
    You can have a look by yourself.
    user: test
    pw: bla
    http://flutterb.at/owncloud-testserver
    (such secure)
    Just delete your uploaded test files afterwards.
    Your files looks good, I am still working on some improvements.

  17. enoch85 commented on Aug 10, 2014

    @enoch85
    Author

    Nice!! A little too much information though.

    I think it should be like 12 of 93 MB. 10 Mbit/s

  18. enoch85 commented on Aug 10, 2014

    @enoch85
    Author

    Btw, @luckydonald could you please make the changes in the code here: https://github.com/luckydonald/core and then create a new pull request? I made one already but it´s easier if you make the changes and push make a PR. Or, you can just make the changes in your core, and I can make a new PR. :)

  19. luckydonald commented on Aug 10, 2014

    @luckydonald
    Contributor

    Finally got it working. Is a bit hax because of the used .progessbar() part.
    Looking now through the files to collect the changes I made.
    Also @enoch85 I cant open (edit) the "write here.odt", getting javascript errors.
    So please don't remove it, so I can file a bug, if reproducable.
    bildschirmfoto 2014-08-10 um 21 59 43

  20. enoch85 commented on Aug 10, 2014

    @enoch85
    Author

    Yes, it looks very good!

    Please add the changes here: #10324

  21. luckydonald commented on Aug 10, 2014

    @luckydonald
    Contributor

    Eventually I got my git working.
    #10326

  22. enoch85 commented on Sep 6, 2014

    @enoch85
    Author

    Any progress here @luckydonald ?

  23. modified the milestone: backlog on Mar 21, 2015
  24. enoch85 commented on May 11, 2016

    @enoch85
    Author

    @luckydonald Do you think you could take a look at this again please?

  25. modified the milestones: , backlog on May 12, 2016
  26. lock commented on Aug 4, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  27. locked as resolved and limited conversation to collaborators on Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions