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:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-08-10 12:22:50 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-08-17 15:21:14 +0300
commit173e9bf6c11397f1c92cd211867e834635e8a8ef (patch)
tree058ff80da0e5fd5ab1bf41d7342e3bda3d10bab8 /apps/files/js/files.js
parent4edd2163b227bd1bc78117df0232b2bf32125375 (diff)
Use total available space rather than quota when updating the display
The initial quota display uses the total available space rather than the quota. Moreover, the relative usage is based on the total space rather than the quota. Due to this now the total available space is also used when updating the quota display. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 0fb0165e89f..1aff9f5332d 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -98,14 +98,15 @@
}
if (response.data !== undefined
&& response.data.quota !== undefined
+ && response.data.total !== 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);
+ var humanTotal = OC.Util.humanFileSize(response.data.total, 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').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
+ $('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanTotal}));
} else {
$('#quotatext').html(t('files', '{used} used', {used: humanUsed}));
}