Merge pull request #41264 from nextcloud/bugfix/noid/quota-0

[stable26] Show proper warning on 0 quota
This commit is contained in:
Arthur Schiwon 2023-11-15 21:44:49 +01:00 committed by GitHub
commit a6997c8002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@
state.call.abort();
}
state.dir = currentDir;
state.call = $.getJSON(OC.generateUrl('apps/files/ajax/getstoragestats?dir={dir}', {
state.call = $.getJSON(OC.generateUrl('apps/files/api/v1/stats?dir={dir}', {
dir: currentDir,
}), function(response) {
state.dir = null;
@ -39,7 +39,7 @@
},
_updateStorageQuotas: function() {
var state = Files.updateStorageQuotas;
state.call = $.getJSON(OC.generateUrl('apps/files/ajax/getstoragestats'), function(response) {
state.call = $.getJSON(OC.generateUrl('apps/files/api/v1/stats'), function(response) {
Files.updateQuota(response);
});
},
@ -70,8 +70,13 @@
if (response === undefined) {
return;
}
if (response.data !== undefined && response.data.free !== undefined) {
$('#free_space').val(response.data.free);
OCA.Files.App.fileList._updateDirectoryPermissions();
}
if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) {
$('#free_space').val(response.data.freeSpace);
$('#upload.button').attr('title', response.data.maxHumanFilesize);
$('#usedSpacePercent').val(response.data.usedSpacePercent);
$('#usedSpacePercent').data('mount-type', response.data.mountType);