diff options
author | Robin Appelman <robin@icewind.nl> | 2020-08-25 16:05:16 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-08-26 19:17:43 +0000 |
commit | 4025b95e0316595d5e3bc04a9b32caf2aeda4a37 (patch) | |
tree | 0a8a45411a6aa9a11fab6dc867e8a0d3f6d137c2 /apps | |
parent | c9a1379bdf99013c7f0bf9510f0e9f7955100ff7 (diff) | |
download | nextcloud-server-4025b95e0316595d5e3bc04a9b32caf2aeda4a37.tar.gz nextcloud-server-4025b95e0316595d5e3bc04a9b32caf2aeda4a37.zip |
show better quota warning for group folders and external storage
instead of showing the generic 'Your storage is full' message, better explain that it's the group folder/external storage that is full
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/files.js | 50 | ||||
-rw-r--r-- | apps/files/lib/Helper.php | 1 |
2 files changed, 37 insertions, 14 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 28e4c5f575a..cdc1c70ffc5 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -72,6 +72,7 @@ $('#free_space').val(response.data.freeSpace); $('#upload.button').attr('data-original-title', response.data.maxHumanFilesize); $('#usedSpacePercent').val(response.data.usedSpacePercent); + $('#usedSpacePercent').data('mount-type', response.data.mountType); $('#owner').val(response.data.owner); $('#ownerDisplayName').val(response.data.ownerDisplayName); Files.displayStorageWarnings(); @@ -155,21 +156,30 @@ var usedSpacePercent = $('#usedSpacePercent').val(), owner = $('#owner').val(), - ownerDisplayName = $('#ownerDisplayName').val(); + ownerDisplayName = $('#ownerDisplayName').val(), + mountType = $('#usedSpacePercent').data('mount-type'); if (usedSpacePercent > 98) { if (owner !== OC.getCurrentUser().uid) { OC.Notification.show(t('files', 'Storage of {owner} is full, files can not be updated or synced anymore!', {owner: ownerDisplayName}), {type: 'error'} ); - return; + } else if (mountType === 'group') { + OC.Notification.show(t('files', + 'This group folder is full, files can not be updated or synced anymore!'), + {type: 'error'} + ); + } else if (mountType === 'external') { + OC.Notification.show(t('files', + 'This external storage is full, files can not be updated or synced anymore!'), + {type : 'error'} + ); + } else { + OC.Notification.show(t('files', + 'Your storage is full, files can not be updated or synced anymore!'), + {type: 'error'} + ); } - OC.Notification.show(t('files', - 'Your storage is full, files can not be updated or synced anymore!'), - {type : 'error'} - ); - return; - } - if (usedSpacePercent > 90) { + } else if (usedSpacePercent > 90) { if (owner !== OC.getCurrentUser().uid) { OC.Notification.show(t('files', 'Storage of {owner} is almost full ({usedSpacePercent}%)', { @@ -180,12 +190,24 @@ type: 'error' } ); - return; + } else if (mountType === 'group') { + OC.Notification.show(t('files', + 'This group folder is almost full ({usedSpacePercent}%)', + {usedSpacePercent: usedSpacePercent}), + {type : 'error'} + ); + } else if (mountType === 'external') { + OC.Notification.show(t('files', + 'This external storage is almost full ({usedSpacePercent}%)', + {usedSpacePercent: usedSpacePercent}), + {type : 'error'} + ); + } else { + OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', + {usedSpacePercent: usedSpacePercent}), + {type : 'error'} + ); } - OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', - {usedSpacePercent: usedSpacePercent}), - {type : 'error'} - ); } }, diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 3431fb2ffc7..1f728565ca6 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -63,6 +63,7 @@ class Helper { 'usedSpacePercent' => (int)$storageInfo['relative'], 'owner' => $storageInfo['owner'], 'ownerDisplayName' => $storageInfo['ownerDisplayName'], + 'mountType' => $storageInfo['mountType'], ]; } |