Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,12 +1338,16 @@ OC.Uploader.prototype = _.extend({
filledBufferSize++;
}
}
var smoothRemainingSeconds = (bufferTotal / filledBufferSize);
var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();

if (!oc_appconfig.files.hide_upload_estimation) {
var smoothRemainingSeconds = (bufferTotal / filledBufferSize);
var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();
self.$uploadprogressbar.find('.label .mobile').text(h);
self.$uploadprogressbar.find('.label .desktop').text(h);
}

self.$uploadprogressbar.attr('data-loaded', data.loaded);
self.$uploadprogressbar.attr('data-total', data.total);
self.$uploadprogressbar.find('.label .mobile').text(h);
self.$uploadprogressbar.find('.label .desktop').text(h);
self.$uploadprogressbar.attr('original-title',
t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
loadedSize: humanFileSize(data.loaded),
Expand Down
4 changes: 3 additions & 1 deletion apps/files/lib/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ public static function extendJsConfig($array) {
$uploadStallTimeout = (int)($config->getAppValue('files', 'upload_stall_timeout', 60)); // in seconds
$uploadStallRetries = (int)($config->getAppValue('files', 'upload_stall_retries', 100));
$enableLockFileAction = (boolean)($config->getAppValue('files', 'enable_lock_file_action', 'no') === 'yes');
$hideUploadEstimation = (boolean)($config->getAppValue('files', 'hide_upload_estimation', 'no') === 'yes');

$array['array']['oc_appconfig']['files'] = [
'max_chunk_size' => $maxChunkSize,
'upload_stall_timeout' => $uploadStallTimeout,
'upload_stall_retries' => $uploadStallRetries,
'enable_lock_file_action' => $enableLockFileAction
'enable_lock_file_action' => $enableLockFileAction,
'hide_upload_estimation' => $hideUploadEstimation
];
}
}
4 changes: 4 additions & 0 deletions apps/files/tests/js/fileUploadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ describe('OC.Upload tests', function() {
var getFolderContentsStub;

beforeEach(function() {
oc_appconfig = oc_appconfig || {};
oc_appconfig.files = oc_appconfig.files || {};
oc_appconfig.files.hide_upload_estimation = false;

testFile = {
name: 'test.txt',
size: 5000, // 5 KB
Expand Down
8 changes: 8 additions & 0 deletions changelog/unreleased/39228
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Add option to hide the upload estimation in WebUI

The upload estimation can now be hidden when setting
`hide_upload_estimation` to "yes" via occ command:
occ config:app:set files hide_upload_estimation --value="yes"

https://github.com/owncloud/core/pull/39228
https://github.com/owncloud/enterprise/issues/4743