Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add mount point to quota warning message
makes it more clear to the user what the quota applies to

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Oct 4, 2020
commit e2e517f4406b3c4c2d96b07de0475a3e80cc4db6
10 changes: 7 additions & 3 deletions apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
$('#upload.button').attr('data-original-title', response.data.maxHumanFilesize);
$('#usedSpacePercent').val(response.data.usedSpacePercent);
$('#usedSpacePercent').data('mount-type', response.data.mountType);
$('#usedSpacePercent').data('mount-point', response.data.mountPoint);
$('#owner').val(response.data.owner);
$('#ownerDisplayName').val(response.data.ownerDisplayName);
Files.displayStorageWarnings();
Expand Down Expand Up @@ -155,20 +156,23 @@
var usedSpacePercent = $('#usedSpacePercent').val(),
owner = $('#owner').val(),
ownerDisplayName = $('#ownerDisplayName').val(),
mountType = $('#usedSpacePercent').data('mount-type');
mountType = $('#usedSpacePercent').data('mount-type'),
mountPoint = $('#usedSpacePercent').data('mount-point');
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'}
);
} else if (mountType === 'group') {
OC.Notification.show(t('files',
'This group folder is full, files can not be updated or synced anymore!'),
'Group folder "{mountPoint}" is full, files can not be updated or synced anymore!',
{mountPoint: mountPoint}),
{type: 'error'}
);
} else if (mountType === 'external') {
OC.Notification.show(t('files',
'This external storage is full, files can not be updated or synced anymore!'),
'External storage "{mountPoint}" is full, files can not be updated or synced anymore!',
{mountPoint: mountPoint}),
{type : 'error'}
);
} else {
Expand Down
1 change: 1 addition & 0 deletions apps/files/lib/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public static function buildFileStorageStatistics($dir) {
'owner' => $storageInfo['owner'],
'ownerDisplayName' => $storageInfo['ownerDisplayName'],
'mountType' => $storageInfo['mountType'],
'mountPoint' => $storageInfo['mountPoint'],
];
}

Expand Down
4 changes: 3 additions & 1 deletion lib/private/legacy/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ public static function getStorageInfo($path, $rootInfo = null) {
if($owner) {
$ownerDisplayName = $owner->getDisplayName();
}
[,,,$mountPoint] = explode('/', $mount->getMountPoint(), 4);

return [
'free' => $free,
Expand All @@ -553,7 +554,8 @@ public static function getStorageInfo($path, $rootInfo = null) {
'relative' => $relative,
'owner' => $ownerId,
'ownerDisplayName' => $ownerDisplayName,
'mountType' => $mount->getMountType()
'mountType' => $mount->getMountType(),
'mountPoint' => trim($mountPoint, '/'),
];
}

Expand Down