Browse Source
Update quotas on each upload
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/7681/head
John Molakvoæ (skjnldsv)
8 years ago
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
2 changed files with
23 additions and
0 deletions
-
apps/files/js/filelist.js
-
apps/files/js/files.js
|
|
|
@ -1802,6 +1802,10 @@ |
|
|
|
OCA.Files.Files.updateStorageStatistics(this.getCurrentDirectory(), force); |
|
|
|
}, |
|
|
|
|
|
|
|
updateStorageQuotas: function() { |
|
|
|
OCA.Files.Files.updateStorageQuotas(this.getCurrentDirectory()); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* @deprecated do not use nor override |
|
|
|
*/ |
|
|
|
@ -3075,6 +3079,8 @@ |
|
|
|
self.showFileBusyState(uploadText.closest('tr'), false); |
|
|
|
uploadText.fadeOut(); |
|
|
|
uploadText.attr('currentUploads', 0); |
|
|
|
|
|
|
|
self.updateStorageQuotas(true); |
|
|
|
}); |
|
|
|
uploader.on('createdfolder', function(fullPath) { |
|
|
|
self.addAndFetchFileInfo(OC.basename(fullPath), OC.dirname(fullPath)); |
|
|
|
|
|
|
|
@ -32,6 +32,23 @@ |
|
|
|
Files.updateQuota(response); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// update quota
|
|
|
|
updateStorageQuotas: function(currentDir) { |
|
|
|
var state = Files.updateStorageStatistics; |
|
|
|
if (state.dir){ |
|
|
|
if (state.dir === currentDir) { |
|
|
|
return; |
|
|
|
} |
|
|
|
// cancel previous call, as it was for another dir
|
|
|
|
state.call.abort(); |
|
|
|
} |
|
|
|
state.dir = currentDir; |
|
|
|
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { |
|
|
|
state.dir = null; |
|
|
|
state.call = null; |
|
|
|
Files.updateQuota(response); |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* Update storage statistics such as free space, max upload, |
|
|
|
* etc based on the given directory. |
|
|
|
|