Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-12-28 12:53:14 +0300
committerGitHub <noreply@github.com>2017-12-28 12:53:14 +0300
commit08cbfb6c6b554eed221aafe185c02dc2e7841d95 (patch)
tree50453d85567e332879a31a34412c1749ded4ad32 /apps/files/js/files.js
parent46958e4c3f2b44ee6acfd95a94bee0f3be19f00a (diff)
parentc8db1ed74138e727013fb6712374844829277ae6 (diff)
Merge pull request #7592 from nextcloud/update-quota-on-files-upload
Update quota on files upload
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 479a2817f44..153307fec52 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -29,6 +29,7 @@
state.dir = null;
state.call = null;
Files.updateMaxUploadFilesize(response);
+ Files.updateQuota(response);
});
},
/**
@@ -77,6 +78,32 @@
},
+ updateQuota:function(response) {
+ if (response === undefined) {
+ return;
+ }
+ if (response.data !== undefined
+ && response.data.quota !== undefined
+ && response.data.used !== undefined
+ && response.data.usedSpacePercent !== undefined) {
+ var humanUsed = OC.Util.humanFileSize(response.data.used, true);
+ var humanQuota = OC.Util.humanFileSize(response.data.quota, true);
+ if (response.data.quota > 0) {
+ $('#quota').attr('data-original-title', Math.floor(response.data.used/response.data.quota*1000)/10 + '%');
+ $('#quota progress').val(response.data.usedSpacePercent);
+ $('#quotatext').text(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
+ } else {
+ $('#quotatext').text(t('files', '{used} used', {used: humanUsed}));
+ }
+ if (response.data.usedSpacePercent > 80) {
+ $('#quota progress').addClass('warn');
+ } else {
+ $('#quota progress').removeClass('warn');
+ }
+ }
+
+ },
+
/**
* Fix path name by removing double slash at the beginning, if any
*/