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:
authorRobin Appelman <robin@icewind.nl>2020-09-17 17:19:41 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2020-10-04 12:02:32 +0300
commit0dfdf3ee9978fdfd119acaa98b8747026d60599b (patch)
tree6a75d920b0cfb7c0d79da58cc7b6b74e1858fa75
parent12da69d79d3546348356d4b71d010e206634c582 (diff)
add mount point to quota warning message
makes it more clear to the user what the quota applies to Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files/js/files.js18
-rw-r--r--apps/files/lib/Helper.php1
-rw-r--r--lib/private/legacy/OC_Helper.php4
3 files changed, 15 insertions, 8 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 5481ece055c..6dbd87c1e2e 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -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();
@@ -157,7 +158,8 @@
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!',
@@ -165,12 +167,14 @@
);
} 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 {
@@ -192,14 +196,14 @@
);
} else if (mountType === 'group') {
OC.Notification.show(t('files',
- 'This group folder is almost full ({usedSpacePercent}%).',
- {usedSpacePercent: usedSpacePercent}),
+ 'Group folder "{mountPoint}" is almost full ({usedSpacePercent}%).',
+ {mountPoint: mountPoint, usedSpacePercent: usedSpacePercent}),
{type : 'error'}
);
} else if (mountType === 'external') {
OC.Notification.show(t('files',
- 'This external storage is almost full ({usedSpacePercent}%).',
- {usedSpacePercent: usedSpacePercent}),
+ 'External storage "{mountPoint}" is almost full ({usedSpacePercent}%).',
+ {mountPoint: mountPoint, usedSpacePercent: usedSpacePercent}),
{type : 'error'}
);
} else {
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php
index 1f728565ca6..2d5a3e2f26e 100644
--- a/apps/files/lib/Helper.php
+++ b/apps/files/lib/Helper.php
@@ -64,6 +64,7 @@ class Helper {
'owner' => $storageInfo['owner'],
'ownerDisplayName' => $storageInfo['ownerDisplayName'],
'mountType' => $storageInfo['mountType'],
+ 'mountPoint' => $storageInfo['mountPoint'],
];
}
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 77f0d922564..8a38ca3b0d2 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -545,6 +545,7 @@ class OC_Helper {
if ($owner) {
$ownerDisplayName = $owner->getDisplayName();
}
+ [,,,$mountPoint] = explode('/', $mount->getMountPoint(), 4);
return [
'free' => $free,
@@ -554,7 +555,8 @@ class OC_Helper {
'relative' => $relative,
'owner' => $ownerId,
'ownerDisplayName' => $ownerDisplayName,
- 'mountType' => $mount->getMountType()
+ 'mountType' => $mount->getMountType(),
+ 'mountPoint' => trim($mountPoint, '/'),
];
}