diff --git a/app/Http/Controllers/User/AccountController.php b/app/Http/Controllers/User/AccountController.php
index 6df745a9..fe21ff3c 100644
--- a/app/Http/Controllers/User/AccountController.php
+++ b/app/Http/Controllers/User/AccountController.php
@@ -2,7 +2,9 @@
namespace App\Http\Controllers\User;
+use App\FileManagerFile;
use App\FileManagerFolder;
+use App\Http\Resources\StorageDetailResource;
use App\Http\Tools\Demo;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\Facades\Validator;
@@ -34,10 +36,10 @@ class AccountController extends Controller
->get();
return [
- 'user' => $user->only(['name', 'email', 'avatar']),
- 'favourites' => $user->favourites->makeHidden(['pivot']),
- 'tree' => $tree,
- 'storage' => [
+ 'user' => $user->only(['name', 'email', 'avatar']),
+ 'favourites' => $user->favourites->makeHidden(['pivot']),
+ 'tree' => $tree,
+ 'storage' => [
'used' => Metric::bytes($user->used_capacity)->format(),
'capacity' => format_gigabytes(config('vuefilemanager.user_storage_capacity')),
'percentage' => get_storage_fill_percentage($user->used_capacity, config('vuefilemanager.user_storage_capacity')),
@@ -45,6 +47,89 @@ class AccountController extends Controller
];
}
+ /**
+ * Get storage details
+ *
+ * @return array
+ */
+ public function storage()
+ {
+ $document_mimetypes = [
+ 'pdf', 'numbers', 'xlsx', 'xls', 'txt', 'md', 'rtf', 'pptx', 'ppt', 'odt', 'ods', 'odp', 'epub', 'docx', 'doc', 'csv', 'pages'
+ ];
+
+ $user = Auth::user();
+ $storage_capacity = config('vuefilemanager.user_storage_capacity');
+
+ $images = FileManagerFile::where('user_id', $user->id)
+ ->where('type', 'image')->get()->map(function ($item) {
+ return (int)$item->getOriginal('filesize');
+ })->sum();
+
+ $audios = FileManagerFile::where('user_id', $user->id)
+ ->where('type', 'audio')->get()->map(function ($item) {
+ return (int)$item->getOriginal('filesize');
+ })->sum();
+
+ $videos = FileManagerFile::where('user_id', $user->id)
+ ->where('type', 'video')->get()->map(function ($item) {
+ return (int)$item->getOriginal('filesize');
+ })->sum();
+
+ $documents = FileManagerFile::where('user_id', $user->id)
+ ->whereIn('mimetype', $document_mimetypes)->get()->map(function ($item) {
+ return (int)$item->getOriginal('filesize');
+ })->sum();
+
+ $others = FileManagerFile::where('user_id', $user->id)
+ ->whereNotIn('mimetype', $document_mimetypes)
+ ->whereNotIn('type', ['audio', 'video', 'image'])
+ ->get()->map(function ($item) {
+ return (int)$item->getOriginal('filesize');
+ })->sum();
+
+ $usage = collect([
+ 'images' => [
+ 'used' => $images,
+ 'percentage' => get_storage_fill_percentage($images, $storage_capacity),
+ ],
+ 'audios' => [
+ 'used' => $audios,
+ 'percentage' => get_storage_fill_percentage($audios, $storage_capacity),
+ ],
+ 'videos' => [
+ 'used' => $videos,
+ 'percentage' => get_storage_fill_percentage($videos, $storage_capacity),
+ ],
+ 'documents' => [
+ 'used' => $documents,
+ 'percentage' => get_storage_fill_percentage($documents, $storage_capacity),
+ ],
+ 'others' => [
+ 'used' => $others,
+ 'percentage' => get_storage_fill_percentage($others, $storage_capacity),
+ ],
+ ]);
+
+ return [
+ 'data' => [
+ 'id' => '1',
+ 'type' => 'disk',
+ 'attributes' => [
+ 'used' => Metric::bytes($user->used_capacity)->format(),
+ 'capacity' => format_gigabytes($storage_capacity),
+ 'percentage' => get_storage_fill_percentage($user->used_capacity, $storage_capacity),
+ ],
+ 'relationships' => $usage->map(function ($item) {
+ return [
+ 'used' => Metric::bytes($item['used'])->format(),
+ 'percentage' => $item['percentage']
+ ];
+ })
+ ]
+ ];
+ }
+
/**
* Update user profile
*
diff --git a/app/Http/Tools/Editor.php b/app/Http/Tools/Editor.php
index 48bb89c9..fc2b1737 100644
--- a/app/Http/Tools/Editor.php
+++ b/app/Http/Tools/Editor.php
@@ -230,7 +230,7 @@ class Editor
$image = Image::make($file->getRealPath())->orientate();
// Resize image
- $image->resize(256, null, function ($constraint) {
+ $image->resize(564, null, function ($constraint) {
$constraint->aspectRatio();
})->stream();
diff --git a/public/mix-manifest.json b/public/mix-manifest.json
index dae1421f..8d26d53d 100644
--- a/public/mix-manifest.json
+++ b/public/mix-manifest.json
@@ -1,19 +1,50 @@
{
"/js/main.js": "/js/main.js",
"/css/app.css": "/css/app.css",
- "/js/main.e46fa96cd6ffd39a4562.hot-update.js": "/js/main.e46fa96cd6ffd39a4562.hot-update.js",
- "/js/main.f2d49bc1541da0f12970.hot-update.js": "/js/main.f2d49bc1541da0f12970.hot-update.js",
- "/js/main.1eef99df4b0f12424803.hot-update.js": "/js/main.1eef99df4b0f12424803.hot-update.js",
- "/js/main.5ddffc9a7b267188676c.hot-update.js": "/js/main.5ddffc9a7b267188676c.hot-update.js",
- "/js/main.390ae60e2291b0dbccc3.hot-update.js": "/js/main.390ae60e2291b0dbccc3.hot-update.js",
- "/js/main.6f2959aac5b1dece64a9.hot-update.js": "/js/main.6f2959aac5b1dece64a9.hot-update.js",
- "/js/main.46741bd43cbaa6ee89b1.hot-update.js": "/js/main.46741bd43cbaa6ee89b1.hot-update.js",
- "/js/main.273e3c85d127556c963f.hot-update.js": "/js/main.273e3c85d127556c963f.hot-update.js",
- "/js/main.262acc9e6f3602846eb5.hot-update.js": "/js/main.262acc9e6f3602846eb5.hot-update.js",
- "/js/main.340ad852bdc54fb22ddd.hot-update.js": "/js/main.340ad852bdc54fb22ddd.hot-update.js",
- "/js/main.0f01b236243cc4d2ab64.hot-update.js": "/js/main.0f01b236243cc4d2ab64.hot-update.js",
- "/js/main.bc5704d8e53dc4abc11a.hot-update.js": "/js/main.bc5704d8e53dc4abc11a.hot-update.js",
- "/js/main.d639deb26abe56ea8a48.hot-update.js": "/js/main.d639deb26abe56ea8a48.hot-update.js",
- "/js/main.4a2927afd0488259ade3.hot-update.js": "/js/main.4a2927afd0488259ade3.hot-update.js",
- "/js/main.11e163fdc882ac0dd7c2.hot-update.js": "/js/main.11e163fdc882ac0dd7c2.hot-update.js"
+ "/js/main.817eec0cf589070e068c.hot-update.js": "/js/main.817eec0cf589070e068c.hot-update.js",
+ "/js/main.febf57d8b972d78cd0b1.hot-update.js": "/js/main.febf57d8b972d78cd0b1.hot-update.js",
+ "/js/main.aacc9173e79145d56d68.hot-update.js": "/js/main.aacc9173e79145d56d68.hot-update.js",
+ "/js/main.ca3534dd246f7214e1ca.hot-update.js": "/js/main.ca3534dd246f7214e1ca.hot-update.js",
+ "/js/main.e92c163dbc9d8e0461fe.hot-update.js": "/js/main.e92c163dbc9d8e0461fe.hot-update.js",
+ "/js/main.977d0f1ba01a7ecdc83f.hot-update.js": "/js/main.977d0f1ba01a7ecdc83f.hot-update.js",
+ "/js/main.d20455489c82352218e1.hot-update.js": "/js/main.d20455489c82352218e1.hot-update.js",
+ "/js/main.c41fdf00e1caa293dcd4.hot-update.js": "/js/main.c41fdf00e1caa293dcd4.hot-update.js",
+ "/js/main.9f85a9b69995df3358b1.hot-update.js": "/js/main.9f85a9b69995df3358b1.hot-update.js",
+ "/js/main.d8ebb130e1de006f1b7d.hot-update.js": "/js/main.d8ebb130e1de006f1b7d.hot-update.js",
+ "/js/main.7ca180c1b27f6f443c15.hot-update.js": "/js/main.7ca180c1b27f6f443c15.hot-update.js",
+ "/js/main.3a13a704160c56773b6c.hot-update.js": "/js/main.3a13a704160c56773b6c.hot-update.js",
+ "/js/main.dd2255fe79ad7e9bd1cb.hot-update.js": "/js/main.dd2255fe79ad7e9bd1cb.hot-update.js",
+ "/js/main.ed6abb6ca89a967371e6.hot-update.js": "/js/main.ed6abb6ca89a967371e6.hot-update.js",
+ "/js/main.cb6413fa3b436014f6c0.hot-update.js": "/js/main.cb6413fa3b436014f6c0.hot-update.js",
+ "/js/main.1c62802df52b712688b8.hot-update.js": "/js/main.1c62802df52b712688b8.hot-update.js",
+ "/js/main.807705eac82af8c701fa.hot-update.js": "/js/main.807705eac82af8c701fa.hot-update.js",
+ "/js/main.afd9626567ad2df2ac9c.hot-update.js": "/js/main.afd9626567ad2df2ac9c.hot-update.js",
+ "/js/main.cf2327d8b73200ab16d4.hot-update.js": "/js/main.cf2327d8b73200ab16d4.hot-update.js",
+ "/js/main.1c91e2f63c823bd221e7.hot-update.js": "/js/main.1c91e2f63c823bd221e7.hot-update.js",
+ "/js/main.b2972d6f67a9ccedaef7.hot-update.js": "/js/main.b2972d6f67a9ccedaef7.hot-update.js",
+ "/js/main.0d8a9dd4bd71257d9296.hot-update.js": "/js/main.0d8a9dd4bd71257d9296.hot-update.js",
+ "/js/main.2b287dbf8bd092e3d350.hot-update.js": "/js/main.2b287dbf8bd092e3d350.hot-update.js",
+ "/js/main.9b2de5e892f0ae4a1e84.hot-update.js": "/js/main.9b2de5e892f0ae4a1e84.hot-update.js",
+ "/js/main.cf9b7d50041d873f8a81.hot-update.js": "/js/main.cf9b7d50041d873f8a81.hot-update.js",
+ "/js/main.8bacb170e9bc97bfcfd8.hot-update.js": "/js/main.8bacb170e9bc97bfcfd8.hot-update.js",
+ "/js/main.3a8f3274463b0c3957d7.hot-update.js": "/js/main.3a8f3274463b0c3957d7.hot-update.js",
+ "/js/main.12cfdab35701103a62d9.hot-update.js": "/js/main.12cfdab35701103a62d9.hot-update.js",
+ "/js/main.25b363299b1ff981c99a.hot-update.js": "/js/main.25b363299b1ff981c99a.hot-update.js",
+ "/js/main.ac60fa6550e88275018b.hot-update.js": "/js/main.ac60fa6550e88275018b.hot-update.js",
+ "/js/main.11cceb6b79b7bc522fd2.hot-update.js": "/js/main.11cceb6b79b7bc522fd2.hot-update.js",
+ "/js/main.7e5540a975e19e4a02eb.hot-update.js": "/js/main.7e5540a975e19e4a02eb.hot-update.js",
+ "/js/main.27f8370c72233614bc39.hot-update.js": "/js/main.27f8370c72233614bc39.hot-update.js",
+ "/js/main.2c2a0d75a6d3a7c4565e.hot-update.js": "/js/main.2c2a0d75a6d3a7c4565e.hot-update.js",
+ "/js/main.f334180312804bae36e9.hot-update.js": "/js/main.f334180312804bae36e9.hot-update.js",
+ "/js/main.0d0aaa4c32c5b8d3bb8f.hot-update.js": "/js/main.0d0aaa4c32c5b8d3bb8f.hot-update.js",
+ "/js/main.9eb0004310ed2536b0c4.hot-update.js": "/js/main.9eb0004310ed2536b0c4.hot-update.js",
+ "/js/main.875b00580be4eff0d64b.hot-update.js": "/js/main.875b00580be4eff0d64b.hot-update.js",
+ "/js/main.65819ac7c832f34c71bd.hot-update.js": "/js/main.65819ac7c832f34c71bd.hot-update.js",
+ "/js/main.5db94bea7020fc6c29ba.hot-update.js": "/js/main.5db94bea7020fc6c29ba.hot-update.js",
+ "/js/main.22b4060751a2d9bcca48.hot-update.js": "/js/main.22b4060751a2d9bcca48.hot-update.js",
+ "/js/main.bb942b8829b5fb097736.hot-update.js": "/js/main.bb942b8829b5fb097736.hot-update.js",
+ "/js/main.6babdb7ce1c9178fe8f7.hot-update.js": "/js/main.6babdb7ce1c9178fe8f7.hot-update.js",
+ "/js/main.fb55dc009cd6252dff65.hot-update.js": "/js/main.fb55dc009cd6252dff65.hot-update.js",
+ "/js/main.0a8179cde3b86b4f0623.hot-update.js": "/js/main.0a8179cde3b86b4f0623.hot-update.js",
+ "/js/main.84773de15d7781e4d40d.hot-update.js": "/js/main.84773de15d7781e4d40d.hot-update.js"
}
diff --git a/resources/js/App.vue b/resources/js/App.vue
index 994b3968..02eca096 100644
--- a/resources/js/App.vue
+++ b/resources/js/App.vue
@@ -164,7 +164,7 @@
color: $dark_mode_text_primary;
img {
- opacity: .8;
+ opacity: .95;
}
}
}
diff --git a/resources/js/components/Mobile/MenuItemList.vue b/resources/js/components/Mobile/MenuItemList.vue
index 8ec85321..a0343913 100644
--- a/resources/js/components/Mobile/MenuItemList.vue
+++ b/resources/js/components/Mobile/MenuItemList.vue
@@ -8,6 +8,8 @@
+
+