diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-08-26 21:15:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 21:15:47 +0200 |
commit | 7685d1fc615231edb144a4a3057389d7deb3daa9 (patch) | |
tree | 1ad1c898b39c89c09a91a62d807b38c05e76fd49 /apps/files/js | |
parent | df99d8f0e02c23b8b9fb43c72183eef5e49430ba (diff) | |
parent | 06ae93b270a63574ae486acbcbaa35bec3fbd43a (diff) | |
download | nextcloud-server-7685d1fc615231edb144a4a3057389d7deb3daa9.tar.gz nextcloud-server-7685d1fc615231edb144a4a3057389d7deb3daa9.zip |
Merge pull request #22421 from nextcloud/group-folder-quota-warning
show better quota warning for group folders and external storage
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/files.js | 50 |
1 files changed, 36 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'} - ); } }, |