diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-01-04 19:06:52 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-01-17 18:30:41 +0100 |
commit | b9906fb21e9f1aadf14e473b8c26a2ec7537fa11 (patch) | |
tree | 3b068eb999c675760d715e78da2d5eee8668cb44 /apps/files/lib/Controller/ApiController.php | |
parent | 9af7ee8d11b43a7a3d14f7aa8390aff0a4174f55 (diff) | |
download | nextcloud-server-b9906fb21e9f1aadf14e473b8c26a2ec7537fa11.tar.gz nextcloud-server-b9906fb21e9f1aadf14e473b8c26a2ec7537fa11.zip |
feat(files): Quota in navigation
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/lib/Controller/ApiController.php')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index f2329fc384b..604cf9a3c64 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -257,6 +257,20 @@ class ApiController extends Controller { return new DataResponse(['files' => $files]); } + + /** + * Returns the current logged-in user's storage stats. + * + * @NoAdminRequired + * + * @param ?string $dir the directory to get the storage stats from + * @return JSONResponse + */ + public function getStorageStats($dir = '/'): JSONResponse { + $storageInfo = \OC_Helper::getStorageInfo($dir ?: '/'); + return new JSONResponse(['message' => 'ok', 'data' => $storageInfo]); + } + /** * Change the default sort mode * |