From 566897fd9add6fb03987189a644dda097629b14c Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 15 Jul 2020 14:11:27 -0700 Subject: [PATCH] Added disk quota exceed notification. --- webserver.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webserver.js b/webserver.js index 0afab7f2..8bb4aa54 100644 --- a/webserver.js +++ b/webserver.js @@ -3018,6 +3018,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { }); }); })(xfile.fullpath, names[i], filedata); + } else { + // Send a notification + obj.parent.DispatchEvent([user._id], obj, { action: 'notify', title: "Disk quota exceed", value: names[i], nolog: 1, id: Math.random() }); } } } @@ -3048,10 +3051,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { } }); } else { + // Send a notification + obj.parent.DispatchEvent([user._id], obj, { action: 'notify', title: "Disk quota exceed", value: file.originalFilename, nolog: 1, id: Math.random() }); try { obj.fs.unlink(file.path, function (err) { }); } catch (e) { } } } } + } else { + // Send a notification + obj.parent.DispatchEvent([user._id], obj, { action: 'notify', value: "Disk quota exceed", nolog: 1, id: Math.random() }); } res.send(''); });