mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
frontend function consolidation part 1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=testing
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:47yorkyoH3qCrKKO4eG6LpZUogoTC51qey5vYq/O3AM=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
@@ -117,6 +117,14 @@ class SetupDevEnvironment extends Command
|
||||
'user_id' => $user->id,
|
||||
'user_scope' => 'master',
|
||||
'name' => 'Shared Folder',
|
||||
'emoji' => [
|
||||
"codes" => "1F680",
|
||||
"char" => "\ud83d\ude80",
|
||||
"name" => "rocket",
|
||||
"category" => "Travel & Places (transport-air)",
|
||||
"group" => "Travel & Places",
|
||||
"subgroup" => "transport-air"
|
||||
],
|
||||
]);
|
||||
|
||||
Share::factory(Share::class)
|
||||
@@ -143,6 +151,14 @@ class SetupDevEnvironment extends Command
|
||||
'user_id' => $user->id,
|
||||
'user_scope' => 'master',
|
||||
'name' => 'Random Pics',
|
||||
'emoji' => [
|
||||
'codes' => '1F4F7',
|
||||
'char' => '📷',
|
||||
'name' => 'camera',
|
||||
'category' => 'Objects (light & video)',
|
||||
'group' => 'Objects',
|
||||
'subgroup' => 'light & video',
|
||||
],
|
||||
]);
|
||||
|
||||
$nature = Folder::factory(Folder::class)
|
||||
@@ -151,6 +167,14 @@ class SetupDevEnvironment extends Command
|
||||
'parent_id' => $random_pics->id,
|
||||
'user_scope' => 'master',
|
||||
'name' => "Nature",
|
||||
'emoji' => [
|
||||
'codes' => '26F0',
|
||||
'char' => '⛰',
|
||||
'name' => 'mountain',
|
||||
'category' => 'Travel & Places (place-geographic)',
|
||||
'group' => 'Travel & Places',
|
||||
'subgroup' => 'place-geographic',
|
||||
],
|
||||
]);
|
||||
|
||||
$apartments = Folder::factory(Folder::class)
|
||||
@@ -159,6 +183,14 @@ class SetupDevEnvironment extends Command
|
||||
'parent_id' => $random_pics->id,
|
||||
'user_scope' => 'master',
|
||||
'name' => "Apartments",
|
||||
'emoji' => [
|
||||
'codes' => '1F3E0',
|
||||
'char' => '🏠',
|
||||
'name' => 'house',
|
||||
'category' => 'Travel & Places (place-building)',
|
||||
'group' => 'Travel & Places',
|
||||
'subgroup' => 'place-building',
|
||||
],
|
||||
]);
|
||||
|
||||
// 3.
|
||||
|
||||
@@ -47,7 +47,7 @@ class EditItemsController extends Controller
|
||||
}
|
||||
|
||||
// Check permission to create folder for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -57,7 +57,7 @@ class EditItemsController extends Controller
|
||||
|
||||
// Check access to requested directory
|
||||
$this->helper->check_item_access($request->parent_id, $shared);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Create new folder
|
||||
return $this->filemanager->create_folder($request);
|
||||
@@ -79,7 +79,7 @@ class EditItemsController extends Controller
|
||||
}
|
||||
|
||||
// Check permission to rename item for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -96,7 +96,7 @@ class EditItemsController extends Controller
|
||||
} else {
|
||||
$this->helper->check_item_access($item->folder_id, $shared);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// If request have a change folder icon values set the folder icon
|
||||
if ($request->type === 'folder' && ($request->filled('emoji') || $request->filled('color'))) {
|
||||
@@ -125,7 +125,7 @@ class EditItemsController extends Controller
|
||||
foreach ($request->input('items') as $item) {
|
||||
|
||||
// Check permission to delete item for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// Prevent force delete for non-master users
|
||||
if ($item['force_delete']) abort('401');
|
||||
@@ -145,7 +145,7 @@ class EditItemsController extends Controller
|
||||
} else {
|
||||
$this->helper->check_item_access($item->folder_id, $shared);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Delete item
|
||||
$this->filemanager->delete_item($item, $item['id']);
|
||||
@@ -169,7 +169,7 @@ class EditItemsController extends Controller
|
||||
}
|
||||
|
||||
// Check permission to upload for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -179,7 +179,7 @@ class EditItemsController extends Controller
|
||||
|
||||
// Check access to requested directory
|
||||
$this->helper->check_item_access($request->parent_id, $shared);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Return new uploaded file
|
||||
return $this->filemanager->upload($request);
|
||||
@@ -202,7 +202,7 @@ class EditItemsController extends Controller
|
||||
$to_id = $request->input('to_id');
|
||||
|
||||
// Check permission to upload for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -212,7 +212,7 @@ class EditItemsController extends Controller
|
||||
|
||||
// Check access to requested directory
|
||||
$this->helper->check_item_access($to_id, $shared);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Move item
|
||||
$this->filemanager->move($request, $to_id);
|
||||
@@ -232,7 +232,7 @@ class EditItemsController extends Controller
|
||||
$user_id = Auth::id();
|
||||
|
||||
// Check permission to download for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -242,7 +242,7 @@ class EditItemsController extends Controller
|
||||
|
||||
// Check access to requested directory
|
||||
$this->helper->check_item_access($id, $shared);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Get folder
|
||||
$folder = Folder::whereUserId($user_id)
|
||||
@@ -270,7 +270,7 @@ class EditItemsController extends Controller
|
||||
public function zip_multiple_files(Request $request)
|
||||
{
|
||||
// Check permission to upload for authenticated editor
|
||||
if ($request->user()->tokenCan('editor')) {
|
||||
/*if ($request->user()->tokenCan('editor')) {
|
||||
|
||||
// check if shared_token cookie exist
|
||||
if (!$request->hasCookie('shared_token')) abort('401');
|
||||
@@ -286,7 +286,7 @@ class EditItemsController extends Controller
|
||||
|
||||
// Check access to requested directory
|
||||
$this->helper->check_item_access($file_parent_folders, $shared);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Get requested files
|
||||
$files = File::whereUserId(Auth::id())
|
||||
|
||||
@@ -73,7 +73,7 @@ class BrowseShareController extends Controller
|
||||
->get();
|
||||
|
||||
// Get all children content
|
||||
$foldersIds = Folder::with('folders:id,parent_id,unique_id,name')
|
||||
$foldersIds = Folder::with('folders:id,parent_id,id,name')
|
||||
->where('user_id', $shared->user_id)
|
||||
->where('parent_id', $shared->item_id)
|
||||
->get();
|
||||
|
||||
@@ -26,7 +26,6 @@ class UploadRequest extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'is_last' => 'sometimes|boolean',
|
||||
'folder_id' => 'uuid|nullable',
|
||||
'file' => ['required', 'file', new MimetypeBlacklistValidation]
|
||||
];
|
||||
|
||||
@@ -35,15 +35,14 @@ class DemoService
|
||||
|
||||
return [
|
||||
'user_id' => 1,
|
||||
'id' => random_int(1000, 9999),
|
||||
'id' => Str::uuid(),
|
||||
'parent_id' => random_int(1000, 9999),
|
||||
'name' => $name,
|
||||
'type' => 'folder',
|
||||
'unique_id' => random_int(1000, 9999),
|
||||
'user_scope' => $user_scope,
|
||||
'items' => '0',
|
||||
'icon_color' => isset($request->icon['color']) ? $request->icon['color'] : null,
|
||||
'icon_emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
|
||||
'color' => isset($request->icon['color']) ? $request->icon['color'] : null,
|
||||
'emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
|
||||
'updated_at' => Carbon::now()->format('j M Y \a\t H:i'),
|
||||
'created_at' => Carbon::now()->format('j M Y \a\t H:i'),
|
||||
];
|
||||
@@ -53,38 +52,38 @@ class DemoService
|
||||
* Rename item name
|
||||
*
|
||||
* @param RenameItemRequest $request
|
||||
* @param $unique_id
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
function rename_item($request, $unique_id)
|
||||
function rename_item($request, $id)
|
||||
{
|
||||
// Get item
|
||||
if ($request->type === 'folder') {
|
||||
|
||||
$item = Folder::where('unique_id', $unique_id)
|
||||
$item = Folder::where('id', $id)
|
||||
->where('user_id', 1)
|
||||
->first();
|
||||
|
||||
} else {
|
||||
|
||||
$item = File::where('unique_id', $unique_id)
|
||||
$item = File::where('id', $id)
|
||||
->where('user_id', 1)
|
||||
->first();
|
||||
}
|
||||
|
||||
if ($item) {
|
||||
$item->name = $request->name;
|
||||
$item->icon_emoji = $request->icon['emoji'] ?? null;
|
||||
$item->icon_color = $request->icon['color'] ?? null;
|
||||
$item->emoji = $request->icon['emoji'] ?? null;
|
||||
$item->color = $request->icon['color'] ?? null;
|
||||
|
||||
return $item;
|
||||
|
||||
} else {
|
||||
|
||||
return [
|
||||
'unique_id' => $request->unique_id,
|
||||
'name' => $request->name,
|
||||
'type' => $request->type,
|
||||
'id' => $request->id,
|
||||
'name' => $request->name,
|
||||
'type' => $request->type,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -109,8 +108,7 @@ class DemoService
|
||||
$filetype = get_file_type($file->getMimeType());
|
||||
|
||||
return [
|
||||
'id' => random_int(1000, 9999),
|
||||
'unique_id' => random_int(1000, 9999),
|
||||
'id' => Str::uuid(),
|
||||
'folder_id' => $request->parent_id,
|
||||
'thumbnail' => 'data:' . $request->file('file')->getMimeType() . ';base64, ' . base64_encode(file_get_contents($request->file('file'))),
|
||||
'name' => $file->getClientOriginalName(),
|
||||
|
||||
@@ -179,8 +179,8 @@ class FileManagerService
|
||||
'user_id' => $user_id,
|
||||
'type' => 'folder',
|
||||
'name' => $name,
|
||||
'icon_color' => isset($request->icon['color']) ? $request->icon['color'] : null,
|
||||
'icon_emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
|
||||
'color' => $request->color ?? null,
|
||||
'emoji' => $request->emoji ?? null,
|
||||
]);;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ class FileManagerService
|
||||
}
|
||||
|
||||
// Delete item
|
||||
if ($item['type'] === 'file') {
|
||||
if ($item['type'] !== 'folder') {
|
||||
|
||||
// Get file
|
||||
$file = UserFile::withTrashed()
|
||||
@@ -346,7 +346,7 @@ class FileManagerService
|
||||
}
|
||||
|
||||
// Move file
|
||||
if ($item['type'] === 'file') {
|
||||
if ($item['type'] !== 'folder') {
|
||||
UserFile::find($item['id'])
|
||||
->update([
|
||||
'folder_id' => $to_id
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"/css/app.css": "/css/app.css",
|
||||
"/chunks/admin.js": "/chunks/admin.js?id=d2e6acc904b1c1a9387b",
|
||||
"/chunks/admin-account.js": "/chunks/admin-account.js?id=b306bc83a32911dc7bbc",
|
||||
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js?id=f8aa71af8223ad1df2a0",
|
||||
"/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~01aef58e.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~01aef58e.js?id=bc5af3a7a82d95c71c52",
|
||||
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~c7a13fb0.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~c7a13fb0.js?id=5842ebc2d92f96d9a14e",
|
||||
"/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~7cf65924.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~7cf65924.js?id=e1ae154ca60eff2f45be",
|
||||
"/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js": "/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js?id=dfc7c9e8edb8146d9bd0",
|
||||
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=bc5212d24fc85d890346",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~605f4c49.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~605f4c49.js?id=1ae1e65bb6a5ed7c3e10",
|
||||
@@ -29,7 +29,7 @@
|
||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=b835f8fdedb4bc19f4a5",
|
||||
"/chunks/files.js": "/chunks/files.js?id=9b47294bd85e1f1db78e",
|
||||
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js?id=bfc9bbbc5c50bc21cad7",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=b60552f07141e4e4d4a6",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=6a7f5d7c260bb41b6f75",
|
||||
"/chunks/files~chunks/shared-page.js": "/chunks/files~chunks/shared-page.js?id=c869bb74e66efcad0288",
|
||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=7f6474e743f5e147705a",
|
||||
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=7e924ee2e747d16a2810",
|
||||
@@ -57,12 +57,11 @@
|
||||
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=c6b88005b133268ed88f",
|
||||
"/chunks/shared-files.js": "/chunks/shared-files.js?id=e6f7de2910d85a2dd3e4",
|
||||
"/chunks/shared-page.js": "/chunks/shared-page.js?id=04a3534a1a31f006d7de",
|
||||
"/chunks/sign-in.js": "/chunks/sign-in.js?id=7990aa527e933e0f0ebf",
|
||||
"/chunks/sign-in.js": "/chunks/sign-in.js?id=af61663f3e69eae3e5ee",
|
||||
"/chunks/sign-up.js": "/chunks/sign-up.js?id=2bc6c1353362c0063d45",
|
||||
"/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=8bfaa10b8499114b79a2",
|
||||
"/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=1790ab9aa493a483cf3c",
|
||||
"/chunks/subscription-service.js": "/chunks/subscription-service.js?id=8fc09aa45881d0c04e17",
|
||||
"/chunks/upgrade.js": "/chunks/upgrade.js?id=6f401f5d12d22bfde1c9",
|
||||
"/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=8a1684e4910b4729ce56",
|
||||
"/chunks/upgrade-billing~chunks/upgrade-plan.js": "/chunks/upgrade-billing~chunks/upgrade-plan.js?id=94cfb5164e5e7f0c2943",
|
||||
"/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=2ce4b7a0ff69e192a968",
|
||||
@@ -75,71 +74,43 @@
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=d989f56de65842d84727",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=ce13a0e7a3ee2b607278",
|
||||
"/chunks/users.js": "/chunks/users.js?id=b26ed0a3ad0087236fd9",
|
||||
"/js/main.acd102588e8a8be37f5a.hot-update.js": "/js/main.acd102588e8a8be37f5a.hot-update.js",
|
||||
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~c7a13fb0.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~c7a13fb0.js?id=5842ebc2d92f96d9a14e",
|
||||
"/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~7cf65924.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~7cf65924.js?id=e1ae154ca60eff2f45be",
|
||||
"/chunks/upgrade.acd102588e8a8be37f5a.hot-update.js": "/chunks/upgrade.acd102588e8a8be37f5a.hot-update.js",
|
||||
"/js/main.50cf26e4dfe081f6e9d8.hot-update.js": "/js/main.50cf26e4dfe081f6e9d8.hot-update.js",
|
||||
"/chunks/setup-wizard.50cf26e4dfe081f6e9d8.hot-update.js": "/chunks/setup-wizard.50cf26e4dfe081f6e9d8.hot-update.js",
|
||||
"/chunks/settings.cee80629f3ef6d9a48d3.hot-update.js": "/chunks/settings.cee80629f3ef6d9a48d3.hot-update.js",
|
||||
"/chunks/profile.b8afc7952982a4fd4d0e.hot-update.js": "/chunks/profile.b8afc7952982a4fd4d0e.hot-update.js",
|
||||
"/chunks/profile.c6e207e3f2b5aa2cfff3.hot-update.js": "/chunks/profile.c6e207e3f2b5aa2cfff3.hot-update.js",
|
||||
"/chunks/profile.192c927aaed6e7cbdc00.hot-update.js": "/chunks/profile.192c927aaed6e7cbdc00.hot-update.js",
|
||||
"/chunks/profile.87eff7a19b5e01529315.hot-update.js": "/chunks/profile.87eff7a19b5e01529315.hot-update.js",
|
||||
"/chunks/dashboard.95d674ae20c836e40e96.hot-update.js": "/chunks/dashboard.95d674ae20c836e40e96.hot-update.js",
|
||||
"/chunks/dashboard.4faee9d07770e137375f.hot-update.js": "/chunks/dashboard.4faee9d07770e137375f.hot-update.js",
|
||||
"/chunks/dashboard.1f3f20e8f882567968b5.hot-update.js": "/chunks/dashboard.1f3f20e8f882567968b5.hot-update.js",
|
||||
"/chunks/dashboard.975afd2837cb09ec3d93.hot-update.js": "/chunks/dashboard.975afd2837cb09ec3d93.hot-update.js",
|
||||
"/chunks/dashboard.c44958949b4aa0440320.hot-update.js": "/chunks/dashboard.c44958949b4aa0440320.hot-update.js",
|
||||
"/chunks/dashboard.7584873af2dfc8636e4d.hot-update.js": "/chunks/dashboard.7584873af2dfc8636e4d.hot-update.js",
|
||||
"/chunks/dashboard.7dd853280ea6d580a0fc.hot-update.js": "/chunks/dashboard.7dd853280ea6d580a0fc.hot-update.js",
|
||||
"/chunks/users.3cb9c0872f96ecbf98f0.hot-update.js": "/chunks/users.3cb9c0872f96ecbf98f0.hot-update.js",
|
||||
"/chunks/users.79bdec551cc28db9798e.hot-update.js": "/chunks/users.79bdec551cc28db9798e.hot-update.js",
|
||||
"/chunks/users.5f63771757ee59c71ab7.hot-update.js": "/chunks/users.5f63771757ee59c71ab7.hot-update.js",
|
||||
"/chunks/users.67da0a6baae8b441589b.hot-update.js": "/chunks/users.67da0a6baae8b441589b.hot-update.js",
|
||||
"/chunks/user.3fddfa5cd493ba39284d.hot-update.js": "/chunks/user.3fddfa5cd493ba39284d.hot-update.js",
|
||||
"/chunks/user.138e6b07b04d718ef7b4.hot-update.js": "/chunks/user.138e6b07b04d718ef7b4.hot-update.js",
|
||||
"/chunks/user.076cb56294ad6ec281a6.hot-update.js": "/chunks/user.076cb56294ad6ec281a6.hot-update.js",
|
||||
"/chunks/user.22613097b84c3ddb703c.hot-update.js": "/chunks/user.22613097b84c3ddb703c.hot-update.js",
|
||||
"/chunks/user.851daea4573084138b30.hot-update.js": "/chunks/user.851daea4573084138b30.hot-update.js",
|
||||
"/chunks/user.ee41abbb94245be22dd2.hot-update.js": "/chunks/user.ee41abbb94245be22dd2.hot-update.js",
|
||||
"/chunks/user.3f1437b24d3353d099a4.hot-update.js": "/chunks/user.3f1437b24d3353d099a4.hot-update.js",
|
||||
"/chunks/user.1d618db9e20455d8bf22.hot-update.js": "/chunks/user.1d618db9e20455d8bf22.hot-update.js",
|
||||
"/chunks/user-detail.f6d70e1f13d33dcfcae7.hot-update.js": "/chunks/user-detail.f6d70e1f13d33dcfcae7.hot-update.js",
|
||||
"/chunks/user-delete.6fba20937425844d9cf5.hot-update.js": "/chunks/user-delete.6fba20937425844d9cf5.hot-update.js",
|
||||
"/chunks/user-storage.4fbcc4fac1376d1e478e.hot-update.js": "/chunks/user-storage.4fbcc4fac1376d1e478e.hot-update.js",
|
||||
"/chunks/user-storage.146ee3ac909f1fb1f5c3.hot-update.js": "/chunks/user-storage.146ee3ac909f1fb1f5c3.hot-update.js",
|
||||
"/chunks/user-detail.bf5b21de12e279d5e41d.hot-update.js": "/chunks/user-detail.bf5b21de12e279d5e41d.hot-update.js",
|
||||
"/chunks/user-invoices.bf5b21de12e279d5e41d.hot-update.js": "/chunks/user-invoices.bf5b21de12e279d5e41d.hot-update.js",
|
||||
"/chunks/user-password.bf5b21de12e279d5e41d.hot-update.js": "/chunks/user-password.bf5b21de12e279d5e41d.hot-update.js",
|
||||
"/chunks/user-storage.3d71713649a1be81cc7a.hot-update.js": "/chunks/user-storage.3d71713649a1be81cc7a.hot-update.js",
|
||||
"/chunks/user-subscription.759a864602c6db4bd639.hot-update.js": "/chunks/user-subscription.759a864602c6db4bd639.hot-update.js",
|
||||
"/chunks/user-create.df9e613449e0abc9c927.hot-update.js": "/chunks/user-create.df9e613449e0abc9c927.hot-update.js",
|
||||
"/chunks/invoices.5198b050405708b07643.hot-update.js": "/chunks/invoices.5198b050405708b07643.hot-update.js",
|
||||
"/chunks/pages.fecc0d5d9a54471490cc.hot-update.js": "/chunks/pages.fecc0d5d9a54471490cc.hot-update.js",
|
||||
"/chunks/plan-create.ca500945cbeeb35e4763.hot-update.js": "/chunks/plan-create.ca500945cbeeb35e4763.hot-update.js",
|
||||
"/chunks/plans.ca500945cbeeb35e4763.hot-update.js": "/chunks/plans.ca500945cbeeb35e4763.hot-update.js",
|
||||
"/chunks/dashboard.ae8b35b4b0e457789953.hot-update.js": "/chunks/dashboard.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/page-edit.ae8b35b4b0e457789953.hot-update.js": "/chunks/page-edit.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/plan.ae8b35b4b0e457789953.hot-update.js": "/chunks/plan.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/plan-delete.ae8b35b4b0e457789953.hot-update.js": "/chunks/plan-delete.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/plan-settings.ae8b35b4b0e457789953.hot-update.js": "/chunks/plan-settings.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/plan-subscribers.ae8b35b4b0e457789953.hot-update.js": "/chunks/plan-subscribers.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/plans.ae8b35b4b0e457789953.hot-update.js": "/chunks/plans.ae8b35b4b0e457789953.hot-update.js",
|
||||
"/chunks/app-payments.fbf17904c778df71a5a2.hot-update.js": "/chunks/app-payments.fbf17904c778df71a5a2.hot-update.js",
|
||||
"/chunks/app-appearance.8f581dd73cc45c256cab.hot-update.js": "/chunks/app-appearance.8f581dd73cc45c256cab.hot-update.js",
|
||||
"/chunks/app-billings.8f581dd73cc45c256cab.hot-update.js": "/chunks/app-billings.8f581dd73cc45c256cab.hot-update.js",
|
||||
"/chunks/app-email.8f581dd73cc45c256cab.hot-update.js": "/chunks/app-email.8f581dd73cc45c256cab.hot-update.js",
|
||||
"/chunks/app-index.8f581dd73cc45c256cab.hot-update.js": "/chunks/app-index.8f581dd73cc45c256cab.hot-update.js",
|
||||
"/chunks/app-others.8f581dd73cc45c256cab.hot-update.js": "/chunks/app-others.8f581dd73cc45c256cab.hot-update.js",
|
||||
"/js/main.8b15852e6652ad7df4c4.hot-update.js": "/js/main.8b15852e6652ad7df4c4.hot-update.js",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~152bcf79.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~152bcf79.js?id=1a78f1864cdc370970bf",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~e724aa94.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~e724aa94.js?id=bef61fb2d7f2feeedb08",
|
||||
"/chunks/user-delete.8b15852e6652ad7df4c4.hot-update.js": "/chunks/user-delete.8b15852e6652ad7df4c4.hot-update.js",
|
||||
"/js/main.89fde28708af035907b2.hot-update.js": "/js/main.89fde28708af035907b2.hot-update.js",
|
||||
"/chunks/user-delete.89fde28708af035907b2.hot-update.js": "/chunks/user-delete.89fde28708af035907b2.hot-update.js",
|
||||
"/chunks/app-appearance.547cc213dbf1b7f47fa1.hot-update.js": "/chunks/app-appearance.547cc213dbf1b7f47fa1.hot-update.js",
|
||||
"/chunks/profile.db40feee26819d8809b4.hot-update.js": "/chunks/profile.db40feee26819d8809b4.hot-update.js",
|
||||
"/chunks/profile.aa9ff62154eb1cc577e3.hot-update.js": "/chunks/profile.aa9ff62154eb1cc577e3.hot-update.js",
|
||||
"/chunks/settings-storage.d3303207e2c793d85f99.hot-update.js": "/chunks/settings-storage.d3303207e2c793d85f99.hot-update.js"
|
||||
"/chunks/sign-in.c0df83f38f9620d6ab71.hot-update.js": "/chunks/sign-in.c0df83f38f9620d6ab71.hot-update.js",
|
||||
"/js/main.7417dde29297cbd69e55.hot-update.js": "/js/main.7417dde29297cbd69e55.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.8944cc718ff4bb32d069.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.8944cc718ff4bb32d069.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.fb8368ad554a2a428564.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.fb8368ad554a2a428564.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.40f9fae6c45f2df25a52.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.40f9fae6c45f2df25a52.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.11878cb3a23571f05616.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.11878cb3a23571f05616.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.a495ff2c47ac8a06dbdd.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.a495ff2c47ac8a06dbdd.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.88c9c728c54e69b1c225.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.88c9c728c54e69b1c225.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.7cd76b38051b485334e2.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.7cd76b38051b485334e2.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.ebde209595425d6ecefd.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.ebde209595425d6ecefd.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.619d37953ce70f2d9c97.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.619d37953ce70f2d9c97.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.e4e435f6df4e15c1e40f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.e4e435f6df4e15c1e40f.hot-update.js",
|
||||
"/js/main.20864a59a92c0129339a.hot-update.js": "/js/main.20864a59a92c0129339a.hot-update.js",
|
||||
"/js/main.a0ecc5181365124d1abd.hot-update.js": "/js/main.a0ecc5181365124d1abd.hot-update.js",
|
||||
"/js/main.a91c6d3b956ef3d3f1e8.hot-update.js": "/js/main.a91c6d3b956ef3d3f1e8.hot-update.js",
|
||||
"/js/main.4ba0741466b2fd877fa5.hot-update.js": "/js/main.4ba0741466b2fd877fa5.hot-update.js",
|
||||
"/js/main.e2cefad0246806b24af4.hot-update.js": "/js/main.e2cefad0246806b24af4.hot-update.js",
|
||||
"/js/main.72c2861585470c2a2c10.hot-update.js": "/js/main.72c2861585470c2a2c10.hot-update.js",
|
||||
"/js/main.8446252ef7ddc3afec51.hot-update.js": "/js/main.8446252ef7ddc3afec51.hot-update.js",
|
||||
"/js/main.6b03f320410161b90310.hot-update.js": "/js/main.6b03f320410161b90310.hot-update.js",
|
||||
"/js/main.2b6a3e1a38b1bf0feeb4.hot-update.js": "/js/main.2b6a3e1a38b1bf0feeb4.hot-update.js",
|
||||
"/js/main.3a61d5e4304773dce727.hot-update.js": "/js/main.3a61d5e4304773dce727.hot-update.js",
|
||||
"/js/main.e6c48ba61975e4559b26.hot-update.js": "/js/main.e6c48ba61975e4559b26.hot-update.js",
|
||||
"/js/main.962fe0e076ecadbfa271.hot-update.js": "/js/main.962fe0e076ecadbfa271.hot-update.js",
|
||||
"/js/main.d094301f874d238bb30e.hot-update.js": "/js/main.d094301f874d238bb30e.hot-update.js",
|
||||
"/js/main.5ce03add9ec3ed119589.hot-update.js": "/js/main.5ce03add9ec3ed119589.hot-update.js",
|
||||
"/js/main.b9dbc0aab87a27bcc71c.hot-update.js": "/js/main.b9dbc0aab87a27bcc71c.hot-update.js",
|
||||
"/js/main.591858a32599e4d84561.hot-update.js": "/js/main.591858a32599e4d84561.hot-update.js",
|
||||
"/js/main.b77927912541bb4e014d.hot-update.js": "/js/main.b77927912541bb4e014d.hot-update.js",
|
||||
"/js/main.9697569c85fd0f645f8a.hot-update.js": "/js/main.9697569c85fd0f645f8a.hot-update.js",
|
||||
"/js/main.b58aab39213782fa858f.hot-update.js": "/js/main.b58aab39213782fa858f.hot-update.js",
|
||||
"/js/main.4ed545e82dc5273ba538.hot-update.js": "/js/main.4ed545e82dc5273ba538.hot-update.js",
|
||||
"/js/main.ff207924ea2f4585a5cc.hot-update.js": "/js/main.ff207924ea2f4585a5cc.hot-update.js",
|
||||
"/js/main.66e9ba4410158801c974.hot-update.js": "/js/main.66e9ba4410158801c974.hot-update.js",
|
||||
"/js/main.0970ccdf59cbd34da77e.hot-update.js": "/js/main.0970ccdf59cbd34da77e.hot-update.js",
|
||||
"/js/main.f7286199453d4271e692.hot-update.js": "/js/main.f7286199453d4271e692.hot-update.js",
|
||||
"/js/main.de3eaa7ec85c41a75abc.hot-update.js": "/js/main.de3eaa7ec85c41a75abc.hot-update.js",
|
||||
"/js/main.d211f3e62bc08a5fd565.hot-update.js": "/js/main.d211f3e62bc08a5fd565.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.d211f3e62bc08a5fd565.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.d211f3e62bc08a5fd565.hot-update.js"
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<!-- File Preview -->
|
||||
<div class="menu-options" id="menu-list" v-if="showFromPreview">
|
||||
<OptionGroup class="menu-option-group">
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename"/>
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item"/>
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item" />
|
||||
<Option @click.native="shareItem" v-if="$checkPermission('master')" :title="item.shared
|
||||
? $t('context_menu.share_edit')
|
||||
: $t('context_menu.share')" icon="share"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" class="menu-option"/>
|
||||
: $t('context_menu.share')" icon="share" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" class="menu-option" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
</div>
|
||||
|
||||
@@ -21,26 +21,26 @@
|
||||
<div v-if="$isThisLocation(['trash', 'trash-root']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
<OptionGroup v-if="multiSelectContextMenu">
|
||||
<Option @click.native="restoreItem" v-if="item" :title="$t('context_menu.restore')" icon="restore"/>
|
||||
<Option @click.native="deleteItem" v-if="item" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<Option @click.native="emptyTrash" :title="$t('context_menu.empty_trash')" icon="empty-trash"/>
|
||||
<OptionGroup v-if="isMultiSelectContextMenu">
|
||||
<Option @click.native="restoreItem" v-if="item" :title="$t('context_menu.restore')" icon="restore" />
|
||||
<Option @click.native="deleteItem" v-if="item" :title="$t('context_menu.delete')" icon="trash" />
|
||||
<Option @click.native="emptyTrash" :title="$t('context_menu.empty_trash')" icon="empty-trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail" />
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Multi options -->
|
||||
<OptionGroup v-if="!multiSelectContextMenu">
|
||||
<Option @click.native="restoreItem" v-if="item" :title="$t('context_menu.restore')" icon="restore"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<Option @click.native="emptyTrash" :title="$t('context_menu.empty_trash')" icon="empty-trash"/>
|
||||
<OptionGroup v-if="!isMultiSelectContextMenu">
|
||||
<Option @click.native="restoreItem" v-if="item" :title="$t('context_menu.restore')" icon="restore" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
<Option @click.native="emptyTrash" :title="$t('context_menu.empty_trash')" icon="empty-trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
</div>
|
||||
|
||||
@@ -48,38 +48,38 @@
|
||||
<div v-if="$isThisLocation(['shared']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
<OptionGroup class="menu-option-group" v-if="item && isFolder && multiSelectContextMenu">
|
||||
<Option @click.native="addToFavourites" :title=" isInFavourites
|
||||
<OptionGroup class="menu-option-group" v-if="item && isFolder && isMultiSelectContextMenu">
|
||||
<Option @click.native="addToFavourites" :title="isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites"/>
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename"/>
|
||||
<Option @click.native="shareItem" :title=" item.shared ? $t('context_menu.share_edit'): $t('context_menu.share')" icon="share"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="shareItem" :title=" item.shared ? $t('context_menu.share_edit'): $t('context_menu.share')" icon="share" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail" />
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Multi options -->
|
||||
<OptionGroup class="menu-option-group" v-if="item && !hasFile && !multiSelectContextMenu">
|
||||
<Option @click.native="addToFavourites" :title=" isInFavourites
|
||||
<OptionGroup class="menu-option-group" v-if="item && !hasFile && !isMultiSelectContextMenu">
|
||||
<Option @click.native="addToFavourites" :title="isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites"/>
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu">
|
||||
<Option @click.native="shareCancel" :title="$t('context_menu.share_cancel')" icon="share"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu">
|
||||
<Option @click.native="shareCancel" :title="$t('context_menu.share_cancel')" icon="share" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
</div>
|
||||
|
||||
@@ -87,46 +87,46 @@
|
||||
<div v-if="$isThisLocation(['base', 'participant_uploads', 'latest']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- No Files options -->
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && multiSelectContextMenu && !item">
|
||||
<Option @click.native="createFolder" :title="$t('context_menu.create_folder')" icon="create-folder"/>
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && isMultiSelectContextMenu && !item">
|
||||
<Option @click.native="createFolder" :title="$t('context_menu.create_folder')" icon="create-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Single options -->
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && item && multiSelectContextMenu && isFolder">
|
||||
<Option @click.native="addToFavourites" :title="isInFavourites ? $t('context_menu.remove_from_favourites') : $t('context_menu.add_to_favourites')" icon="favourites"/>
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && item && isMultiSelectContextMenu && isFolder">
|
||||
<Option @click.native="addToFavourites" :title="isInFavourites ? $t('context_menu.remove_from_favourites') : $t('context_menu.add_to_favourites')" icon="favourites" />
|
||||
</OptionGroup>
|
||||
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename"/>
|
||||
<Option @click.native="moveItem" v-if="!$isThisLocation(['latest'])" :title="$t('context_menu.move')" icon="move-item"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title="$t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="moveItem" v-if="!$isThisLocation(['latest'])" :title="$t('context_menu.move')" icon="move-item" />
|
||||
<Option @click.native="shareItem" :title="item.shared
|
||||
? $t('context_menu.share_edit')
|
||||
: $t('context_menu.share')" icon="share"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
: $t('context_menu.share')" icon="share" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu ">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu ">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail" />
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Multi options -->
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && !multiSelectContextMenu && item && !hasFile">
|
||||
<OptionGroup v-if="!$isThisLocation(['participant_uploads', 'latest']) && !isMultiSelectContextMenu && item && !hasFile">
|
||||
<Option @click.native="addToFavourites" :title=" isInFavourites
|
||||
? $t('context_menu.remove_from_favourites')
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites"/>
|
||||
: $t('context_menu.add_to_favourites')" icon="favourites" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu">
|
||||
<Option @click.native="moveItem" v-if="!$isThisLocation(['latest'])" :title="$t('context_menu.move')" icon="move-item"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu">
|
||||
<Option @click.native="moveItem" v-if="!$isThisLocation(['latest'])" :title="$t('context_menu.move')" icon="move-item" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
</div>
|
||||
|
||||
@@ -134,33 +134,33 @@
|
||||
<div v-if="$isThisLocation(['base', 'public']) && $checkPermission('editor') && !showFromPreview " id="menu-list" class="menu-options">
|
||||
|
||||
<!-- No Files options -->
|
||||
<OptionGroup v-if="multiSelectContextMenu && !item">
|
||||
<Option @click.native="createFolder" :title="$t('context_menu.create_folder')" icon="create-folder"/>
|
||||
<OptionGroup v-if="isMultiSelectContextMenu && !item">
|
||||
<Option @click.native="createFolder" :title="$t('context_menu.create_folder')" icon="create-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Single options -->
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title=" $t('context_menu.rename')" icon="rename"/>
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="renameItem" :title=" $t('context_menu.rename')" icon="rename" />
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail" />
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Multi options -->
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu">
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item"/>
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu">
|
||||
<Option @click.native="moveItem" :title="$t('context_menu.move')" icon="move-item" />
|
||||
<Option @click.native="deleteItem" :title="$t('context_menu.delete')" icon="trash" />
|
||||
</OptionGroup>
|
||||
|
||||
<OptionGroup v-if="item && !multiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download"/>
|
||||
<OptionGroup v-if="item && !isMultiSelectContextMenu && !hasFolder">
|
||||
<Option @click.native="downloadItem" :title="$t('context_menu.download')" icon="download" />
|
||||
</OptionGroup>
|
||||
</div>
|
||||
|
||||
@@ -168,16 +168,16 @@
|
||||
<div v-if="$isThisLocation(['base', 'public']) && $checkPermission('visitor') && !showFromPreview" id="menu-list" class="menu-options">
|
||||
|
||||
<!-- Single options -->
|
||||
<OptionGroup v-if="item && multiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail"/>
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder"/>
|
||||
<OptionGroup v-if="item && isMultiSelectContextMenu">
|
||||
<Option @click.native="ItemDetail" :title="$t('context_menu.detail')" icon="detail" />
|
||||
<Option @click.native="downloadItem" v-if="!isFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
<Option @click.native="downloadFolder" v-if="isFolder" :title="$t('context_menu.zip_folder')" icon="zip-folder" />
|
||||
</OptionGroup>
|
||||
|
||||
<!-- Multi options -->
|
||||
<OptionGroup v-if="!multiSelectContextMenu && item ">
|
||||
<Option @click.native="downloadItem" v-if="!hasFolder" :title="$t('context_menu.download')" icon="download"/>
|
||||
<Option v-if="hasFolder" :title="$t('context_menu.no_options')" icon="no-options" class="no-options"/>
|
||||
<OptionGroup v-if="!isMultiSelectContextMenu && item ">
|
||||
<Option @click.native="downloadItem" v-if="!hasFolder" :title="$t('context_menu.download')" icon="download" />
|
||||
<Option v-if="hasFolder" :title="$t('context_menu.no_options')" icon="no-options" class="no-options" />
|
||||
</OptionGroup>
|
||||
|
||||
</div>
|
||||
@@ -187,8 +187,8 @@
|
||||
<script>
|
||||
import OptionGroup from '@/components/FilesView/OptionGroup'
|
||||
import Option from '@/components/FilesView/Option'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { events } from '@/bus'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'ContextMenu',
|
||||
@@ -199,20 +199,12 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['user', 'fileInfoDetail']),
|
||||
hasFolder() {
|
||||
|
||||
// Check if selected items includes some folder
|
||||
if (this.fileInfoDetail.find(item => item.type === 'folder'))
|
||||
return true
|
||||
|
||||
return this.fileInfoDetail.find(item => item.type === 'folder')
|
||||
},
|
||||
hasFile() {
|
||||
|
||||
// Check if selected items includes some files
|
||||
if (this.fileInfoDetail.find(item => item.type !== 'folder'))
|
||||
return true
|
||||
|
||||
return this.fileInfoDetail.find(item => item.type !== 'folder')
|
||||
},
|
||||
multiSelectContextMenu() {
|
||||
isMultiSelectContextMenu() {
|
||||
|
||||
// If is context Menu open on multi selected items open just options for the multi selected items
|
||||
if (this.fileInfoDetail.length > 1 && this.fileInfoDetail.includes(this.item))
|
||||
@@ -221,10 +213,9 @@ export default {
|
||||
// If is context Menu open for the non selected item open options for the single item
|
||||
if (this.fileInfoDetail.length < 2 || !this.fileInfoDetail.includes(this.item))
|
||||
return true
|
||||
|
||||
},
|
||||
favourites() {
|
||||
return this.user.relationships.favourites.data.attributes.folders
|
||||
return this.user.data.relationships.favourites.data.attributes.folders
|
||||
},
|
||||
isFolder() {
|
||||
return this.item && this.item.type === 'folder'
|
||||
@@ -241,7 +232,7 @@ export default {
|
||||
return this.item && this.item.type === 'image'
|
||||
},
|
||||
isInFavourites() {
|
||||
return this.favourites.find((el) => el.unique_id == this.item.unique_id)
|
||||
return this.favourites.find((el) => el.id === this.item.id)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -253,10 +244,9 @@ export default {
|
||||
positionY: 0
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
downloadFolder(){
|
||||
this.$store.dispatch('downloadFolder' , this.item)
|
||||
downloadFolder() {
|
||||
this.$store.dispatch('downloadFolder', this.item)
|
||||
},
|
||||
emptyTrash() {
|
||||
this.$store.dispatch('emptyTrash')
|
||||
@@ -264,36 +254,36 @@ export default {
|
||||
restoreItem() {
|
||||
|
||||
// If is item not in selected items restore just this single item
|
||||
if(!this.fileInfoDetail.includes(this.item))
|
||||
if (!this.fileInfoDetail.includes(this.item))
|
||||
this.$store.dispatch('restoreItem', this.item)
|
||||
|
||||
// If is item in selected items restore all items from fileInfoDetail
|
||||
if(this.fileInfoDetail.includes(this.item))
|
||||
if (this.fileInfoDetail.includes(this.item))
|
||||
this.$store.dispatch('restoreItem', null)
|
||||
},
|
||||
shareCancel() {
|
||||
this.$store.dispatch('shareCancel')
|
||||
},
|
||||
renameItem() {
|
||||
events.$emit('popup:open', { name: 'rename-item', item: this.item })
|
||||
events.$emit('popup:open', {name: 'rename-item', item: this.item})
|
||||
},
|
||||
moveItem() {
|
||||
events.$emit('popup:open', { name: 'move', item: [this.item] })
|
||||
events.$emit('popup:open', {name: 'move', item: [this.item]})
|
||||
},
|
||||
shareItem() {
|
||||
if (this.item.shared) {
|
||||
// Open edit share popup
|
||||
events.$emit('popup:open', { name: 'share-edit', item: this.item })
|
||||
events.$emit('popup:open', {name: 'share-edit', item: this.item})
|
||||
} else {
|
||||
// Open create share popup
|
||||
events.$emit('popup:open', { name: 'share-create', item: this.item })
|
||||
events.$emit('popup:open', {name: 'share-create', item: this.item})
|
||||
}
|
||||
},
|
||||
addToFavourites() {
|
||||
// Check if folder is in favourites and then add/remove from favourites
|
||||
if (
|
||||
this.favourites &&
|
||||
!this.favourites.find(el => el.unique_id == this.item.unique_id)
|
||||
!this.favourites.find(el => el.id === this.item.id)
|
||||
) {
|
||||
// Add to favourite folder that is not selected
|
||||
if (!this.fileInfoDetail.includes(this.item)) {
|
||||
@@ -419,10 +409,8 @@ export default {
|
||||
this.isVisible = false
|
||||
this.showFromPreview = false
|
||||
this.item = undefined
|
||||
|
||||
})
|
||||
|
||||
|
||||
events.$on('contextMenu:show', (event, item) => {
|
||||
// Store item
|
||||
this.item = item
|
||||
|
||||
@@ -88,16 +88,16 @@ export default {
|
||||
folderEmojiOrColor() {
|
||||
|
||||
// If folder have set some color
|
||||
if (this.item.icon_color) {
|
||||
if (this.item.color) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[`folder${this.item.id}`].firstElementChild.style.fill = this.item.icon_color
|
||||
this.$refs[`folder${this.item.id}`].firstElementChild.style.fill = this.item.color
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// If folder have set some emoji
|
||||
if (this.item.icon_emoji)
|
||||
return this.item.icon_emoji
|
||||
if (this.item.emoji)
|
||||
return this.item.emoji
|
||||
|
||||
},
|
||||
isClicked() {
|
||||
|
||||
@@ -289,7 +289,7 @@ export default {
|
||||
})
|
||||
|
||||
// Change item name
|
||||
events.$on('change:name', (item) => {
|
||||
events.$on('change:name', item => {
|
||||
if (this.item.id === item.id) this.itemName = item.name
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
showingImageIndex() {
|
||||
let activeIndex = ''
|
||||
this.filteredFiles.filter((element, index) => {
|
||||
if (element.unique_id == this.fileInfoDetail[0].unique_id) {
|
||||
if (element.id === this.fileInfoDetail[0].id) {
|
||||
activeIndex = index + 1
|
||||
}
|
||||
})
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
export default {
|
||||
name: 'FolderIcon',
|
||||
props: [
|
||||
'item',
|
||||
'folderIcon',
|
||||
'location'
|
||||
'location',
|
||||
'item',
|
||||
],
|
||||
components: {
|
||||
Emoji
|
||||
@@ -37,7 +37,7 @@
|
||||
return this.folderIcon.emoji ? this.folderIcon.emoji : false
|
||||
|
||||
// Return emoji if is already set
|
||||
return this.item.icon_emoji ? this.item.icon_emoji : false
|
||||
return this.item.emoji ? this.item.emoji : false
|
||||
},
|
||||
color() {
|
||||
// Return color if is changed from rename popup
|
||||
@@ -45,7 +45,7 @@
|
||||
return this.folderIcon.color ? this.folderIcon.color : false
|
||||
|
||||
// Return color if is already set
|
||||
return this.item.icon_color ? this.item.icon_color : false
|
||||
return this.item.color ? this.item.color : false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,14 @@
|
||||
<!-- Emojis List -->
|
||||
<transition name="slide-in">
|
||||
<div v-if="selectOpen">
|
||||
|
||||
<!-- Spinner -->
|
||||
<div v-if="!loadedList" class="emoji-wrapper">
|
||||
<div v-if="!isLoadedEmojis" class="emoji-wrapper">
|
||||
<Spinner />
|
||||
</div>
|
||||
|
||||
<!-- List -->
|
||||
<div v-if="loadedList && emojis" class="emoji-wrapper">
|
||||
<div v-if="isLoadedEmojis && emojis" class="emoji-wrapper">
|
||||
|
||||
<!-- Search input -->
|
||||
<input @click.stop @input="searchEmojis" v-model="searchInput" class="emoji-input" :placeholder="$t('popup_rename.search_emoji_input_placeholder')">
|
||||
@@ -100,7 +101,7 @@ export default {
|
||||
searchInput: '',
|
||||
filteredEmojis: [],
|
||||
selectOpen: false,
|
||||
loadedList: false,
|
||||
isLoadedEmojis: false,
|
||||
filteredEmojisLoaded: true,
|
||||
groupInView: 'Smileys & Emotion',
|
||||
}
|
||||
@@ -150,8 +151,7 @@ export default {
|
||||
|
||||
}, 800),
|
||||
openList() {
|
||||
|
||||
this.loadedList = false
|
||||
this.isLoadedEmojis = false
|
||||
|
||||
this.selectOpen = !this.selectOpen
|
||||
|
||||
@@ -160,14 +160,15 @@ export default {
|
||||
|
||||
axios.get('/assets/emojis.json')
|
||||
.then(response => {
|
||||
this.$store.commit('LOAD_EMOJIS_LIST', response.data[0])
|
||||
this.$store.commit('LOAD_EMOJIS_LIST', response.data)
|
||||
})
|
||||
.finally(() => this.isLoadedEmojis = true)
|
||||
}
|
||||
|
||||
// Simulate loading for the emojisList processing
|
||||
if (this.emojis) {
|
||||
setTimeout(() => {
|
||||
this.loadedList = true
|
||||
this.isLoadedEmojis = true
|
||||
}, 20);
|
||||
}
|
||||
|
||||
@@ -199,7 +200,7 @@ export default {
|
||||
|
||||
this.selectOpen = false
|
||||
|
||||
this.loadedList = false
|
||||
this.isLoadedEmojis = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,33 +7,33 @@
|
||||
<PopupContent type="height-limited" v-if="pickedItem">
|
||||
|
||||
<!--Show Spinner when loading folders-->
|
||||
<Spinner v-if="isLoadingTree"/>
|
||||
<Spinner v-if="isLoadingTree" />
|
||||
|
||||
<!--Folder tree-->
|
||||
<div v-if="! isLoadingTree && navigation">
|
||||
<ThumbnailItem v-if="fileInfoDetail.length < 2 || noSelectedItem" class="item-thumbnail" :item="pickedItem" info="location"/>
|
||||
<ThumbnailItem v-if="fileInfoDetail.length < 2 || noSelectedItem" class="item-thumbnail" :item="pickedItem" info="location" />
|
||||
|
||||
<MultiSelected class="multiple-selected"
|
||||
:title="$t('file_detail.selected_multiple')"
|
||||
:subtitle="this.fileInfoDetail.length + ' ' + $tc('file_detail.items', this.fileInfoDetail.length)"
|
||||
v-if="fileInfoDetail.length > 1 && !noSelectedItem"/>
|
||||
<MultiSelected class="multiple-selected"
|
||||
:title="$t('file_detail.selected_multiple')"
|
||||
:subtitle="this.fileInfoDetail.length + ' ' + $tc('file_detail.items', this.fileInfoDetail.length)"
|
||||
v-if="fileInfoDetail.length > 1 && !noSelectedItem" />
|
||||
|
||||
<TreeMenu :disabled-by-id="pickedItem" :depth="1" :nodes="items" v-for="items in navigation" :key="items.unique_id"/>
|
||||
<TreeMenu :disabled-by-id="pickedItem" :depth="1" :nodes="items" v-for="items in navigation" :key="items.id" />
|
||||
</div>
|
||||
</PopupContent>
|
||||
|
||||
<!--Actions-->
|
||||
<PopupActions>
|
||||
<ButtonBase
|
||||
class="popup-button"
|
||||
@click.native="$closePopup()"
|
||||
button-style="secondary"
|
||||
class="popup-button"
|
||||
@click.native="$closePopup()"
|
||||
button-style="secondary"
|
||||
>{{ $t('popup_move_item.cancel') }}
|
||||
</ButtonBase>
|
||||
<ButtonBase
|
||||
class="popup-button"
|
||||
@click.native="moveItem"
|
||||
:button-style="selectedFolder ? 'theme' : 'secondary'"
|
||||
class="popup-button"
|
||||
@click.native="moveItem"
|
||||
:button-style="selectedFolder ? 'theme' : 'secondary'"
|
||||
>{{ $t('popup_move_item.submit') }}
|
||||
</ButtonBase>
|
||||
</PopupActions>
|
||||
@@ -80,25 +80,25 @@
|
||||
methods: {
|
||||
moveItem() {
|
||||
// Prevent empty submit
|
||||
if (! this.selectedFolder) return
|
||||
if (!this.selectedFolder) return
|
||||
|
||||
//Prevent to move items to the same parent
|
||||
if(this.fileInfoDetail.find(item => item.parent_id === this.selectedFolder.unique_id)) return
|
||||
if (this.fileInfoDetail.find(item => item.parent_id === this.selectedFolder.id)) return
|
||||
|
||||
// Move item
|
||||
if(!this.noSelectedItem){
|
||||
this.$store.dispatch('moveItem', {to_item:this.selectedFolder ,noSelectedItem: null})
|
||||
if (!this.noSelectedItem) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.selectedFolder, noSelectedItem: null})
|
||||
}
|
||||
|
||||
if(this.noSelectedItem){
|
||||
this.$store.dispatch('moveItem', {to_item:this.selectedFolder ,noSelectedItem:this.pickedItem})
|
||||
if (this.noSelectedItem) {
|
||||
this.$store.dispatch('moveItem', {to_item: this.selectedFolder, noSelectedItem: this.pickedItem})
|
||||
}
|
||||
|
||||
|
||||
// Close popup
|
||||
events.$emit('popup:close')
|
||||
|
||||
// If is mobile, close the selecting mod after done the move action
|
||||
if(this.$isMobile())
|
||||
if (this.$isMobile())
|
||||
events.$emit('mobileSelecting:stop')
|
||||
},
|
||||
},
|
||||
@@ -107,7 +107,7 @@
|
||||
// Select folder in tree
|
||||
events.$on('pick-folder', folder => {
|
||||
|
||||
if (folder.unique_id === this.pickedItem.unique_id) {
|
||||
if (folder.id === this.pickedItem.id) {
|
||||
this.selectedFolder = undefined
|
||||
} else {
|
||||
this.selectedFolder = folder
|
||||
@@ -118,6 +118,7 @@
|
||||
events.$on('popup:open', args => {
|
||||
|
||||
if (args.name !== 'move') return
|
||||
|
||||
// Show tree spinner
|
||||
this.isLoadingTree = true
|
||||
|
||||
@@ -127,11 +128,12 @@
|
||||
})
|
||||
|
||||
// Store picked item
|
||||
if(!this.fileInfoDetail.includes(args.item[0])){
|
||||
if (!this.fileInfoDetail.includes(args.item[0])) {
|
||||
this.pickedItem = args.item[0]
|
||||
this.noSelectedItem = true
|
||||
}
|
||||
if(this.fileInfoDetail.includes(args.item[0])){
|
||||
|
||||
if (this.fileInfoDetail.includes(args.item[0])) {
|
||||
this.pickedItem = this.fileInfoDetail[0]
|
||||
this.noSelectedItem = false
|
||||
}
|
||||
@@ -153,37 +155,42 @@
|
||||
@import '@assets/vue-file-manager/_variables';
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
|
||||
.item-thumbnail {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.multiple-selected {
|
||||
padding: 0 20px;;
|
||||
margin-bottom: 20px;
|
||||
/deep/.text{
|
||||
.title {
|
||||
color: $text;
|
||||
}
|
||||
.count {
|
||||
color: $text-muted;
|
||||
}
|
||||
.item-thumbnail {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.multiple-selected {
|
||||
padding: 0 20px;;
|
||||
margin-bottom: 20px;
|
||||
|
||||
/deep/ .text {
|
||||
.title {
|
||||
color: $text;
|
||||
}
|
||||
/deep/.icon-wrapper {
|
||||
.icon {
|
||||
stroke: $theme;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: $text-muted;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
/deep/ .icon-wrapper {
|
||||
.icon {
|
||||
stroke: $theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.multiple-selected {
|
||||
/deep/.text {
|
||||
/deep/ .text {
|
||||
.title {
|
||||
color: $dark_mode_text_primary;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: $dark_mode_text_secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<PopupWrapper name="rename-item">
|
||||
<!--Title-->
|
||||
<PopupHeader :title="$t('popup_rename.title', {item: itemTypeTitle})" icon="edit"/>
|
||||
<PopupHeader :title="$t('popup_rename.title', {item: itemTypeTitle})" icon="edit" />
|
||||
|
||||
<!--Content-->
|
||||
<PopupContent>
|
||||
|
||||
<!--Item Thumbnail-->
|
||||
<ThumbnailItem class="item-thumbnail" :item="pickedItem" info="metadata" :setFolderIcon="setFolderIcon"/>
|
||||
<ThumbnailItem class="item-thumbnail" :item="pickedItem" info="metadata" :setFolderIcon="folderIcon" />
|
||||
|
||||
<!--Form to set sharing-->
|
||||
<ValidationObserver @submit.prevent="changeName" ref="renameForm" v-slot="{ invalid }" tag="form" class="form-wrapper">
|
||||
@@ -18,33 +18,32 @@
|
||||
<div class="input">
|
||||
<input v-model="pickedItem.name" :class="{'is-error': errors[0]}" ref="input" type="text" :placeholder="$t('popup_rename.placeholder')">
|
||||
<div @click="pickedItem.name = ''" class="close-icon-wrapper">
|
||||
<x-icon class="close-icon" size="14"/>
|
||||
<x-icon class="close-icon" size="14" />
|
||||
</div>
|
||||
</div>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
|
||||
<SetFolderIcon v-if="isMoreOptions" :folderData="pickedItem"/>
|
||||
<SetFolderIcon v-if="isMoreOptions" :folderData="pickedItem" />
|
||||
|
||||
<ActionButton v-if="pickedItem.type === 'folder'" @click.native.stop="moreOptions" :icon="isMoreOptions ? 'x' : 'pencil-alt'">{{ moreOptionsTitle }}</ActionButton>
|
||||
|
||||
</ValidationObserver>
|
||||
|
||||
|
||||
</PopupContent>
|
||||
|
||||
<!--Actions-->
|
||||
<PopupActions>
|
||||
<ButtonBase class="popup-button" @click.native="$closePopup()" button-style="secondary">{{ $t('popup_move_item.cancel') }}
|
||||
<ButtonBase class="popup-button" @click.native="$closePopup()" button-style="secondary">
|
||||
{{ $t('popup_move_item.cancel') }}
|
||||
</ButtonBase>
|
||||
<ButtonBase class="popup-button" @click.native="changeName" button-style="theme">{{ $t('popup_share_edit.save') }}
|
||||
<ButtonBase class="popup-button" @click.native="changeName" button-style="theme">
|
||||
{{ $t('popup_share_edit.save') }}
|
||||
</ButtonBase>
|
||||
</PopupActions>
|
||||
</PopupWrapper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ValidationProvider, ValidationObserver } from 'vee-validate/dist/vee-validate.full'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/Others/Popup/PopupContent'
|
||||
@@ -53,9 +52,9 @@ import SetFolderIcon from '@/components/Others/SetFolderIcon'
|
||||
import ThumbnailItem from '@/components/Others/ThumbnailItem'
|
||||
import ActionButton from '@/components/Others/ActionButton'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import { XIcon } from 'vue-feather-icons'
|
||||
import { required } from 'vee-validate/dist/rules'
|
||||
import { events } from '@/bus'
|
||||
import {XIcon} from 'vue-feather-icons'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'RenameItem',
|
||||
@@ -85,7 +84,7 @@ export default {
|
||||
return {
|
||||
pickedItem: undefined,
|
||||
isMoreOptions: false,
|
||||
setFolderIcon: undefined
|
||||
folderIcon: undefined
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -99,9 +98,14 @@ export default {
|
||||
id: this.pickedItem.id,
|
||||
type: this.pickedItem.type,
|
||||
name: this.pickedItem.name,
|
||||
icon: this.setFolderIcon ? this.setFolderIcon : null
|
||||
}
|
||||
|
||||
if (this.folderIcon.emoji)
|
||||
item['emoji'] = this.folderIcon.emoji
|
||||
|
||||
if (this.folderIcon.color)
|
||||
item['color'] = this.folderIcon.color
|
||||
|
||||
// Rename item request
|
||||
this.$store.dispatch('renameItem', item)
|
||||
|
||||
@@ -119,20 +123,20 @@ export default {
|
||||
|
||||
if (args.name !== 'rename-item') return
|
||||
|
||||
if (! this.$isMobile()) {
|
||||
if (!this.$isMobile()) {
|
||||
this.$nextTick(() => this.$refs.input.focus())
|
||||
}
|
||||
|
||||
this.isMoreOptions = false
|
||||
|
||||
this.setFolderIcon = undefined
|
||||
this.folderIcon = undefined
|
||||
|
||||
// Store picked item
|
||||
this.pickedItem = args.item
|
||||
})
|
||||
|
||||
events.$on('setFolderIcon', (icon) => {
|
||||
this.setFolderIcon = icon
|
||||
this.folderIcon = icon
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<!-- Colors Picker-->
|
||||
<TabOption :title="$t('popup_rename.tab_color_title')" icon="folder">
|
||||
<ColorPicker :picked-color="pickedColor" v-model="selectedColor"/>
|
||||
<ColorPicker :picked-color="pickedColor" v-model="selectedColor" />
|
||||
</TabOption>
|
||||
</TabWrapper>
|
||||
</template>
|
||||
@@ -18,11 +18,11 @@ import EmojiPicker from '@/components/Others/EmojiPicker'
|
||||
import ColorPicker from '@/components/Others/ColorPicker'
|
||||
import TabWrapper from '@/components/Others/TabWrapper'
|
||||
import TabOption from '@/components/Others/TabOption'
|
||||
import { events } from '@/bus'
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'SetFolderIcon',
|
||||
props: [ 'folderData' ],
|
||||
props: ['folderData'],
|
||||
components: {
|
||||
EmojiPicker,
|
||||
ColorPicker,
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
TabOption,
|
||||
},
|
||||
computed: {
|
||||
pickedEmoji () {
|
||||
pickedEmoji() {
|
||||
// If is color not selected and emoji is selected, push picked emoji to EmojiPicker for the EmojiSelected input
|
||||
return !this.selectedColor && this.selectedEmoji ? this.selectedEmoji : undefined
|
||||
},
|
||||
@@ -46,46 +46,44 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selectedColor () {
|
||||
|
||||
selectedColor() {
|
||||
let color = {'color': this.selectedColor}
|
||||
|
||||
if( this.selectedColor ) {
|
||||
if (this.selectedColor) {
|
||||
|
||||
this.selectedEmoji = undefined
|
||||
events.$emit('setFolderIcon', color )
|
||||
events.$emit('setFolderIcon', color)
|
||||
}
|
||||
|
||||
},
|
||||
selectedEmoji () {
|
||||
selectedEmoji() {
|
||||
|
||||
let emoji = { 'emoji': this.selectedEmoji }
|
||||
let emoji = {'emoji': this.selectedEmoji}
|
||||
|
||||
if( this.selectedEmoji ) {
|
||||
if (this.selectedEmoji) {
|
||||
|
||||
this.selectedColor = undefined
|
||||
events.$emit('setFolderIcon', this.selectedEmoji ==='default' ? 'default' : emoji )
|
||||
events.$emit('setFolderIcon', this.selectedEmoji === 'default' ? 'default' : emoji)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if(this.folderData) {
|
||||
|
||||
if (this.folderData) {
|
||||
|
||||
// If folder have already set some color set this color to selected color
|
||||
this.folderData.icon_color ? this.selectedColor = this.folderData.icon_color : ''
|
||||
this.folderData.color ? this.selectedColor = this.folderData.color : ''
|
||||
|
||||
// If folder have already set some emojit set this emoji to selected emoji
|
||||
this.folderData.icon_emoji ? this.selectedEmoji = this.folderData.icon_emoji : ''
|
||||
this.folderData.emoji ? this.selectedEmoji = this.folderData.emoji : ''
|
||||
}
|
||||
},
|
||||
destroyed () {
|
||||
if(this.folderData) {
|
||||
|
||||
destroyed() {
|
||||
if (this.folderData) {
|
||||
|
||||
// After close SetFolderIcon set the saved folder icon for thumbnail
|
||||
let color = {'color': this.folderData.icon_color }
|
||||
let emoji = {'emoji': this.folderData.icon_emoji }
|
||||
|
||||
events.$emit('setFolderIcon', this.folderData.icon_emoji ? emoji : color )
|
||||
let color = {'color': this.folderData.color}
|
||||
let emoji = {'emoji': this.folderData.emoji}
|
||||
|
||||
events.$emit('setFolderIcon', this.folderData.emoji ? emoji : color)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!--Folder Icon-->
|
||||
<div class="folder-item-wrapper" :class="{'is-inactive': disabledById && disabledById.unique_id === nodes.unique_id || !disableId} ">
|
||||
<div class="folder-item-wrapper" :class="{'is-inactive': disabledById && disabledById.id === nodes.id || !disableId} ">
|
||||
|
||||
<div class="folder-item" :class="{'is-selected': isSelected}" @click="getFolder" :style="indent">
|
||||
<chevron-right-icon @click.stop="showTree" size="17" class="icon-arrow" :class="{'is-opened': isVisible, 'is-visible': nodes.folders.length !== 0}"></chevron-right-icon>
|
||||
@@ -9,7 +9,7 @@
|
||||
<span class="label">{{ nodes.name }}</span>
|
||||
</div>
|
||||
|
||||
<TreeMenu :disabled-by-id="disabledById" :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders" :key="item.unique_id" />
|
||||
<TreeMenu :disabled-by-id="disabledById" :depth="depth + 1" v-if="isVisible" :nodes="item" v-for="item in nodes.folders" :key="item.id" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
let canBeShow = true
|
||||
if(this.fileInfoDetail.includes(this.disabledById)){
|
||||
this.fileInfoDetail.map(item => {
|
||||
if(item.unique_id === this.nodes.unique_id) {
|
||||
if(item.id === this.nodes.id) {
|
||||
canBeShow = false
|
||||
}
|
||||
})
|
||||
@@ -73,7 +73,7 @@
|
||||
events.$on('pick-folder', node => {
|
||||
this.isSelected = false
|
||||
|
||||
if (this.nodes.unique_id == node.unique_id)
|
||||
if (this.nodes.id === node.id)
|
||||
this.isSelected = true
|
||||
})
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
events.$on('show-folder-item', node => {
|
||||
this.isSelected = false
|
||||
|
||||
if (this.nodes.unique_id == node.unique_id)
|
||||
if (this.nodes.id === node.id)
|
||||
this.isSelected = true
|
||||
})
|
||||
}
|
||||
|
||||
4
resources/js/helpers.js
vendored
4
resources/js/helpers.js
vendored
@@ -85,7 +85,7 @@ const Helpers = {
|
||||
// Push items to file queue
|
||||
[...files].map(item => {
|
||||
this.$store.commit('ADD_FILES_TO_QUEUE', {
|
||||
parent_id: store.getters.currentFolder.id,
|
||||
folder_id: store.getters.currentFolder.id,
|
||||
file: item,
|
||||
})
|
||||
});
|
||||
@@ -106,7 +106,7 @@ const Helpers = {
|
||||
// Push items to file queue
|
||||
[...event.dataTransfer.items].map(item => {
|
||||
this.$store.commit('ADD_FILES_TO_QUEUE', {
|
||||
parent_id: parent_id,
|
||||
folder_id: parent_id,
|
||||
file: item.getAsFile(),
|
||||
})
|
||||
});
|
||||
|
||||
2080
resources/js/store/modules/app.js
vendored
2080
resources/js/store/modules/app.js
vendored
File diff suppressed because it is too large
Load Diff
19
resources/js/store/modules/fileBrowser.js
vendored
19
resources/js/store/modules/fileBrowser.js
vendored
@@ -88,7 +88,6 @@ const actions = {
|
||||
commit('LOADING_STATE', {loading: true, data: []})
|
||||
commit('FLUSH_FOLDER_HISTORY')
|
||||
|
||||
|
||||
let currentFolder = {
|
||||
name: i18n.t('sidebar.my_shared'),
|
||||
location: 'shared',
|
||||
@@ -98,7 +97,7 @@ const actions = {
|
||||
commit('STORE_CURRENT_FOLDER', currentFolder)
|
||||
|
||||
axios
|
||||
.get(getters.api + '/browse/shared-all' + getters.sorting.URI)
|
||||
.get(getters.api + '/browse/shared' + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
commit('STORE_PREVIOUS_FOLDER', currentFolder)
|
||||
@@ -118,7 +117,7 @@ const actions = {
|
||||
})
|
||||
|
||||
axios
|
||||
.get(getters.api + '/browse/participant-uploads' + getters.sorting.URI)
|
||||
.get(getters.api + '/browse/participants' + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
|
||||
@@ -139,7 +138,7 @@ const actions = {
|
||||
commit('STORE_CURRENT_FOLDER', trash)
|
||||
|
||||
axios
|
||||
.get(getters.api + '/trash' + getters.sorting.URI)
|
||||
.get(getters.api + '/browse/trash' + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
commit('STORE_PREVIOUS_FOLDER', trash)
|
||||
@@ -156,9 +155,9 @@ const actions = {
|
||||
let route = undefined
|
||||
|
||||
if (getters.sharedDetail && getters.sharedDetail.protected)
|
||||
route = '/api/search/private'
|
||||
route = '/api/browse/search/private'
|
||||
else if (getters.sharedDetail && !getters.sharedDetail.protected)
|
||||
route = '/api/search/public/' + router.currentRoute.params.token
|
||||
route = '/api/browse/search/public/' + router.currentRoute.params.token
|
||||
else
|
||||
route = '/api/browse/search'
|
||||
|
||||
@@ -179,9 +178,9 @@ const actions = {
|
||||
let route = undefined
|
||||
|
||||
if (getters.sharedDetail && getters.sharedDetail.protected)
|
||||
route = '/api/navigation/private'
|
||||
route = '/api/browse/navigation/private'
|
||||
else if (getters.sharedDetail && !getters.sharedDetail.protected)
|
||||
route = '/api/navigation/public/' + router.currentRoute.params.token
|
||||
route = '/api/browse/navigation/public/' + router.currentRoute.params.token
|
||||
else
|
||||
route = '/api/browse/navigation'
|
||||
|
||||
@@ -234,8 +233,8 @@ const mutations = {
|
||||
state.data.find(item => {
|
||||
if (item.id === updatedFile.id) {
|
||||
item.name = updatedFile.name
|
||||
item.icon_color = updatedFile.icon_color ? updatedFile.icon_color : null
|
||||
item.icon_emoji = updatedFile.icon_emoji ? updatedFile.icon_emoji : null
|
||||
item.color = updatedFile.color ? updatedFile.color : null
|
||||
item.emoji = updatedFile.emoji ? updatedFile.emoji : null
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
848
resources/js/store/modules/fileFunctions.js
vendored
848
resources/js/store/modules/fileFunctions.js
vendored
@@ -1,447 +1,439 @@
|
||||
import i18n from '@/i18n/index'
|
||||
import router from '@/router'
|
||||
import { events } from '@/bus'
|
||||
import { last } from 'lodash'
|
||||
import {events} from '@/bus'
|
||||
import {last} from 'lodash'
|
||||
import axios from 'axios'
|
||||
import Vue from 'vue'
|
||||
import store from '../index'
|
||||
|
||||
const defaultState = {
|
||||
processingPopup: undefined,
|
||||
fileQueue: [],
|
||||
filesInQueueTotal: 0,
|
||||
filesInQueueUploaded: 0,
|
||||
|
||||
isProcessingFile: false,
|
||||
uploadingProgress: 0
|
||||
processingPopup: undefined,
|
||||
fileQueue: [],
|
||||
filesInQueueTotal: 0,
|
||||
filesInQueueUploaded: 0,
|
||||
isProcessingFile: false,
|
||||
uploadingProgress: 0
|
||||
}
|
||||
|
||||
const actions = {
|
||||
downloadFolder: ({ commit, getters }, folder) => {
|
||||
|
||||
commit('PROCESSING_POPUP', {
|
||||
title: i18n.t('popup_zipping.title'),
|
||||
message: i18n.t('popup_zipping.message')
|
||||
})
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/zip-folder/' + folder.id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/zip-folder/' + folder.id
|
||||
|
||||
axios.get(route)
|
||||
.then(response => {
|
||||
Vue.prototype.$downloadFile(response.data.url, response.data.name)
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
.finally(() => {
|
||||
commit('PROCESSING_POPUP', undefined)
|
||||
})
|
||||
|
||||
},
|
||||
downloadFiles: ({ commit, getters }) => {
|
||||
let files = []
|
||||
|
||||
// get ids of selected files
|
||||
getters.fileInfoDetail.forEach(file => files.push(file.id))
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/zip/public/' + router.currentRoute.params.token
|
||||
: '/api/zip'
|
||||
|
||||
commit('PROCESSING_POPUP', {
|
||||
title: i18n.t('popup_zipping.title'),
|
||||
message: i18n.t('popup_zipping.message'),
|
||||
})
|
||||
|
||||
axios.post(route, {
|
||||
files: files
|
||||
})
|
||||
.then(response => {
|
||||
Vue.prototype.$downloadFile(response.data.url, response.data.name)
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
.finally(() => {
|
||||
commit('PROCESSING_POPUP', undefined)
|
||||
})
|
||||
},
|
||||
moveItem: ({ commit, getters, dispatch }, { to_item, noSelectedItem }) => {
|
||||
|
||||
let itemsToMove = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
items.forEach(data => itemsToMove.push({
|
||||
'force_delete': data.deleted_at ? true : false,
|
||||
'id': data.id,
|
||||
'type': data.type
|
||||
}))
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem)
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/move/public/' + router.currentRoute.params.token
|
||||
: '/api/move'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
_method: 'post',
|
||||
to_id: to_item.id,
|
||||
items: itemsToMove
|
||||
})
|
||||
.then(() => {
|
||||
itemsToMove.forEach(item => {
|
||||
commit('REMOVE_ITEM', item.id)
|
||||
commit('INCREASE_FOLDER_ITEM', to_item.id)
|
||||
|
||||
if (item.type === 'folder')
|
||||
dispatch('getAppData')
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
createFolder: ({ commit, getters, dispatch }, folder) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/create-folder/public/' + router.currentRoute.params.token
|
||||
: '/api/create-folder'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
parent_id: getters.currentFolder.id,
|
||||
name: folder.name,
|
||||
icon: folder.icon
|
||||
})
|
||||
.then(response => {
|
||||
commit('ADD_NEW_FOLDER', response.data)
|
||||
|
||||
events.$emit('scrollTop')
|
||||
|
||||
//Set focus on new folder name
|
||||
setTimeout(() => {
|
||||
events.$emit('newFolder:focus', response.data.id)
|
||||
}, 10)
|
||||
|
||||
if (getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
renameItem: ({ commit, getters, dispatch }, data) => {
|
||||
|
||||
// Updated name in favourites panel
|
||||
if (getters.permission === 'master' && data.type === 'folder')
|
||||
commit('UPDATE_NAME_IN_FAVOURITES', data)
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/rename-item/' + data.id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/rename-item/' + data.id
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
name: data.name,
|
||||
type: data.type,
|
||||
icon: data.icon,
|
||||
_method: 'patch'
|
||||
})
|
||||
.then(response => {
|
||||
commit('CHANGE_ITEM_NAME', response.data)
|
||||
|
||||
if (data.type === 'folder' && getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
if (data.type === 'folder' && getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
uploadFiles: ({ commit, getters }, { form, fileSize, totalUploadedSize }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/upload/public/' + router.currentRoute.params.token
|
||||
: '/api/upload'
|
||||
|
||||
// Create cancel token for axios cancellation
|
||||
const CancelToken = axios.CancelToken,
|
||||
source = CancelToken.source()
|
||||
|
||||
axios
|
||||
.post(route, form, {
|
||||
cancelToken: source.token,
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream'
|
||||
},
|
||||
onUploadProgress: event => {
|
||||
var percentCompleted = Math.floor(((totalUploadedSize + event.loaded) / fileSize) * 100)
|
||||
|
||||
commit('UPLOADING_FILE_PROGRESS', percentCompleted >= 100 ? 100 : percentCompleted)
|
||||
|
||||
// Set processing file
|
||||
if (percentCompleted >= 100)
|
||||
commit('PROCESSING_FILE', true)
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
resolve(response)
|
||||
|
||||
commit('PROCESSING_FILE', false)
|
||||
|
||||
// Remove first file from file queue
|
||||
commit('SHIFT_FROM_FILE_QUEUE')
|
||||
|
||||
// Check if user is in uploading folder, if yes, than show new file
|
||||
if (response.data.folder_id == getters.currentFolder.id) {
|
||||
|
||||
// Add uploaded item into view
|
||||
commit('ADD_NEW_ITEMS', response.data)
|
||||
|
||||
// Reset file progress
|
||||
commit('UPLOADING_FILE_PROGRESS', 0)
|
||||
|
||||
// Increase count in files in queue uploaded for 1
|
||||
commit('INCREASE_FILES_IN_QUEUE_UPLOADED')
|
||||
}
|
||||
|
||||
// Start uploading next file if file queue is not empty
|
||||
if (getters.fileQueue.length) {
|
||||
Vue.prototype.$handleUploading(getters.fileQueue[0])
|
||||
}
|
||||
|
||||
// Reset upload process
|
||||
if (! getters.fileQueue.length)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
|
||||
let messages = {
|
||||
'423': {
|
||||
title: i18n.t('popup_exceed_limit.title'),
|
||||
message: i18n.t('popup_exceed_limit.message')
|
||||
},
|
||||
'415': {
|
||||
title: i18n.t('popup_mimetypes_blacklist.title'),
|
||||
message: i18n.t('popup_mimetypes_blacklist.message')
|
||||
},
|
||||
'413': {
|
||||
title: i18n.t('popup_paylod_error.title'),
|
||||
message: i18n.t('popup_paylod_error.message')
|
||||
}
|
||||
}
|
||||
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😬😬😬',
|
||||
title: messages[error.response.status]['title'],
|
||||
message: messages[error.response.status]['message']
|
||||
})
|
||||
|
||||
commit('PROCESSING_FILE', false)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
})
|
||||
|
||||
// Cancel the upload request
|
||||
events.$on('cancel-upload', () => {
|
||||
source.cancel()
|
||||
|
||||
// Hide upload progress bar
|
||||
commit('PROCESSING_FILE', false)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
})
|
||||
})
|
||||
},
|
||||
restoreItem: ({ commit, getters }, item) => {
|
||||
|
||||
let itemToRestore = []
|
||||
let items = [item]
|
||||
let restoreToHome = false
|
||||
|
||||
// If coming no selected item dont get items to restore from fileInfoDetail
|
||||
if (!item)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
// Check if file can be restored to home directory
|
||||
if (getters.currentFolder.location === 'trash')
|
||||
restoreToHome = true
|
||||
|
||||
items.forEach(data => itemToRestore.push({
|
||||
type: data.type,
|
||||
id: data.id
|
||||
}))
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
axios
|
||||
.post(getters.api + '/trash/restore-items', {
|
||||
to_home: restoreToHome,
|
||||
data: itemToRestore
|
||||
})
|
||||
.then(
|
||||
// Remove file
|
||||
items.forEach(data => commit('REMOVE_ITEM', data.id))
|
||||
)
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
deleteItem: ({ commit, getters, dispatch }, noSelectedItem) => {
|
||||
|
||||
let itemsToDelete = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
items.forEach(data => {
|
||||
itemsToDelete.push({
|
||||
force_delete: data.deleted_at ? true : false,
|
||||
type: data.type,
|
||||
id: data.id
|
||||
})
|
||||
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.id)
|
||||
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
}
|
||||
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.id)
|
||||
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
}
|
||||
})
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem) {
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/remove-item/public/' + router.currentRoute.params.token
|
||||
: '/api/remove-item'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
_method: 'post',
|
||||
data: itemsToDelete
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
itemsToDelete.forEach(data => {
|
||||
|
||||
// If is folder, update app data
|
||||
if (data.type === 'folder') {
|
||||
|
||||
if (data.id === getters.currentFolder.id) {
|
||||
|
||||
if (getters.currentFolder.location === 'public') {
|
||||
dispatch('browseShared', [{ folder: last(getters.browseHistory), back: true, init: false }])
|
||||
} else {
|
||||
dispatch('getFolder', [{ folder: last(getters.browseHistory), back: true, init: false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
emptyTrash: ({ commit, getters }) => {
|
||||
|
||||
// Clear file browser
|
||||
commit('LOADING_STATE', { loading: true, data: [] })
|
||||
|
||||
axios
|
||||
.post(getters.api + '/trash/empty-trash', {
|
||||
_method: 'delete'
|
||||
})
|
||||
.then(() => {
|
||||
commit('LOADING_STATE', { loading: false, data: [] })
|
||||
events.$emit('scrollTop')
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
}
|
||||
downloadFolder: ({commit, getters}, folder) => {
|
||||
|
||||
commit('PROCESSING_POPUP', {
|
||||
title: i18n.t('popup_zipping.title'),
|
||||
message: i18n.t('popup_zipping.message')
|
||||
})
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/zip/folder/' + folder.id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/zip/folder/' + folder.id
|
||||
|
||||
axios.get(route)
|
||||
.then(response => {
|
||||
Vue.prototype.$downloadFile(response.data.url, response.data.name)
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
.finally(() => {
|
||||
commit('PROCESSING_POPUP', undefined)
|
||||
})
|
||||
|
||||
},
|
||||
downloadFiles: ({commit, getters}) => {
|
||||
let files = []
|
||||
|
||||
// get ids of selected files
|
||||
getters.fileInfoDetail.forEach(file => files.push(file.id))
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/zip/files/public/' + router.currentRoute.params.token
|
||||
: '/api/zip/files'
|
||||
|
||||
commit('PROCESSING_POPUP', {
|
||||
title: i18n.t('popup_zipping.title'),
|
||||
message: i18n.t('popup_zipping.message'),
|
||||
})
|
||||
|
||||
axios.post(route, {
|
||||
files: files
|
||||
})
|
||||
.then(response => {
|
||||
Vue.prototype.$downloadFile(response.data.url, response.data.name)
|
||||
})
|
||||
.catch(() => {
|
||||
Vue.prototype.$isSomethingWrong()
|
||||
})
|
||||
.finally(() => {
|
||||
commit('PROCESSING_POPUP', undefined)
|
||||
})
|
||||
},
|
||||
moveItem: ({commit, getters, dispatch}, {to_item, noSelectedItem}) => {
|
||||
|
||||
let itemsToMove = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
items.forEach(data => itemsToMove.push({
|
||||
'id': data.id,
|
||||
'type': data.type
|
||||
}))
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem)
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/editor/move/public/' + router.currentRoute.params.token
|
||||
: '/api/move'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
to_id: to_item.id,
|
||||
items: itemsToMove
|
||||
})
|
||||
.then(() => {
|
||||
itemsToMove.forEach(item => {
|
||||
commit('REMOVE_ITEM', item.id)
|
||||
commit('INCREASE_FOLDER_ITEM', to_item.id)
|
||||
|
||||
if (item.type === 'folder')
|
||||
dispatch('getAppData')
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
createFolder: ({commit, getters, dispatch}, folder) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/editor/create-folder/public/' + router.currentRoute.params.token
|
||||
: '/api/create-folder'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
parent_id: getters.currentFolder.id,
|
||||
name: folder.name,
|
||||
icon: folder.icon
|
||||
})
|
||||
.then(response => {
|
||||
commit('ADD_NEW_FOLDER', response.data)
|
||||
|
||||
events.$emit('scrollTop')
|
||||
|
||||
// Set focus on new folder name
|
||||
setTimeout(() => {
|
||||
events.$emit('newFolder:focus', response.data.id)
|
||||
}, 10)
|
||||
|
||||
if (getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
renameItem: ({commit, getters, dispatch}, data) => {
|
||||
|
||||
// Updated name in favourites panel
|
||||
if (getters.permission === 'master' && data.type === 'folder')
|
||||
commit('UPDATE_NAME_IN_FAVOURITES', data)
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/editor/rename/' + data.id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/rename/' + data.id
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
...data,
|
||||
_method: 'patch'
|
||||
})
|
||||
.then(response => {
|
||||
commit('CHANGE_ITEM_NAME', response.data)
|
||||
|
||||
if (data.type === 'folder' && getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
if (data.type === 'folder' && getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
uploadFiles: ({commit, getters}, {form, fileSize, totalUploadedSize}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/editor/upload/public/' + router.currentRoute.params.token
|
||||
: '/api/upload'
|
||||
|
||||
// Create cancel token for axios cancellation
|
||||
const CancelToken = axios.CancelToken,
|
||||
source = CancelToken.source()
|
||||
|
||||
axios
|
||||
.post(route, form, {
|
||||
cancelToken: source.token,
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream'
|
||||
},
|
||||
onUploadProgress: event => {
|
||||
var percentCompleted = Math.floor(((totalUploadedSize + event.loaded) / fileSize) * 100)
|
||||
|
||||
commit('UPLOADING_FILE_PROGRESS', percentCompleted >= 100 ? 100 : percentCompleted)
|
||||
|
||||
// Set processing file
|
||||
if (percentCompleted >= 100)
|
||||
commit('PROCESSING_FILE', true)
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
resolve(response)
|
||||
|
||||
commit('PROCESSING_FILE', false)
|
||||
|
||||
// Remove first file from file queue
|
||||
commit('SHIFT_FROM_FILE_QUEUE')
|
||||
|
||||
// Check if user is in uploading folder, if yes, than show new file
|
||||
if (response.data.folder_id == getters.currentFolder.id) {
|
||||
|
||||
// Add uploaded item into view
|
||||
commit('ADD_NEW_ITEMS', response.data)
|
||||
|
||||
// Reset file progress
|
||||
commit('UPLOADING_FILE_PROGRESS', 0)
|
||||
|
||||
// Increase count in files in queue uploaded for 1
|
||||
commit('INCREASE_FILES_IN_QUEUE_UPLOADED')
|
||||
}
|
||||
|
||||
// Start uploading next file if file queue is not empty
|
||||
if (getters.fileQueue.length) {
|
||||
Vue.prototype.$handleUploading(getters.fileQueue[0])
|
||||
}
|
||||
|
||||
// Reset upload process
|
||||
if (!getters.fileQueue.length)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
|
||||
let messages = {
|
||||
'423': {
|
||||
title: i18n.t('popup_exceed_limit.title'),
|
||||
message: i18n.t('popup_exceed_limit.message')
|
||||
},
|
||||
'415': {
|
||||
title: i18n.t('popup_mimetypes_blacklist.title'),
|
||||
message: i18n.t('popup_mimetypes_blacklist.message')
|
||||
},
|
||||
'413': {
|
||||
title: i18n.t('popup_paylod_error.title'),
|
||||
message: i18n.t('popup_paylod_error.message')
|
||||
}
|
||||
}
|
||||
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😬😬😬',
|
||||
title: messages[error.response.status]['title'],
|
||||
message: messages[error.response.status]['message']
|
||||
})
|
||||
|
||||
commit('PROCESSING_FILE', false)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
})
|
||||
|
||||
// Cancel the upload request
|
||||
events.$on('cancel-upload', () => {
|
||||
source.cancel()
|
||||
|
||||
// Hide upload progress bar
|
||||
commit('PROCESSING_FILE', false)
|
||||
commit('CLEAR_UPLOAD_PROGRESS')
|
||||
})
|
||||
})
|
||||
},
|
||||
restoreItem: ({commit, getters}, item) => {
|
||||
|
||||
let itemToRestore = []
|
||||
let items = [item]
|
||||
let restoreToHome = false
|
||||
|
||||
// If coming no selected item dont get items to restore from fileInfoDetail
|
||||
if (!item)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
// Check if file can be restored to home directory
|
||||
if (getters.currentFolder.location === 'trash')
|
||||
restoreToHome = true
|
||||
|
||||
items.forEach(data => itemToRestore.push({
|
||||
type: data.type,
|
||||
id: data.id
|
||||
}))
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
axios
|
||||
.post(getters.api + '/trash/restore', {
|
||||
to_home: restoreToHome,
|
||||
items: itemToRestore
|
||||
})
|
||||
.then(
|
||||
// Remove file
|
||||
items.forEach(data => commit('REMOVE_ITEM', data.id))
|
||||
)
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
deleteItem: ({commit, getters, dispatch}, noSelectedItem) => {
|
||||
|
||||
let itemsToDelete = []
|
||||
let items = [noSelectedItem]
|
||||
|
||||
// If coming no selected item dont get items to move from fileInfoDetail
|
||||
if (!noSelectedItem)
|
||||
items = getters.fileInfoDetail
|
||||
|
||||
items.forEach(data => {
|
||||
itemsToDelete.push({
|
||||
force_delete: data.deleted_at ? true : false,
|
||||
type: data.type,
|
||||
id: data.id
|
||||
})
|
||||
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.id)
|
||||
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
}
|
||||
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.id)
|
||||
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
}
|
||||
})
|
||||
|
||||
// Remove file preview
|
||||
if (!noSelectedItem) {
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && !getters.sharedDetail.protected
|
||||
? '/api/editor/remove/public/' + router.currentRoute.params.token
|
||||
: '/api/remove'
|
||||
|
||||
axios
|
||||
.post(route, {
|
||||
items: itemsToDelete
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
itemsToDelete.forEach(data => {
|
||||
|
||||
// If is folder, update app data
|
||||
if (data.type === 'folder') {
|
||||
|
||||
if (data.id === getters.currentFolder.id) {
|
||||
|
||||
if (getters.currentFolder.location === 'public') {
|
||||
dispatch('browseShared', [{folder: last(getters.browseHistory), back: true, init: false}])
|
||||
} else {
|
||||
dispatch('getFolder', [{folder: last(getters.browseHistory), back: true, init: false}])
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (getters.currentFolder.location !== 'public')
|
||||
dispatch('getAppData')
|
||||
|
||||
if (getters.currentFolder.location === 'public')
|
||||
dispatch('getFolderTree')
|
||||
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
emptyTrash: ({commit, getters}) => {
|
||||
|
||||
// Clear file browser
|
||||
commit('LOADING_STATE', {loading: true, data: []})
|
||||
|
||||
axios
|
||||
.post(getters.api + '/trash/dump', {
|
||||
_method: 'delete'
|
||||
})
|
||||
.then(() => {
|
||||
commit('LOADING_STATE', {loading: false, data: []})
|
||||
events.$emit('scrollTop')
|
||||
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
PROCESSING_POPUP(state, status) {
|
||||
state.processingPopup = status
|
||||
},
|
||||
ADD_FILES_TO_QUEUE(state, file) {
|
||||
state.fileQueue.push(file)
|
||||
},
|
||||
SHIFT_FROM_FILE_QUEUE(state) {
|
||||
state.fileQueue.shift()
|
||||
},
|
||||
PROCESSING_FILE(state, status) {
|
||||
state.isProcessingFile = status
|
||||
},
|
||||
UPLOADING_FILE_PROGRESS(state, percentage) {
|
||||
state.uploadingProgress = percentage
|
||||
},
|
||||
INCREASE_FILES_IN_QUEUES_TOTAL(state, count) {
|
||||
state.filesInQueueTotal += count
|
||||
},
|
||||
INCREASE_FILES_IN_QUEUE_UPLOADED(state) {
|
||||
state.filesInQueueUploaded++
|
||||
},
|
||||
CLEAR_UPLOAD_PROGRESS(state) {
|
||||
state.filesInQueueUploaded = 0
|
||||
state.filesInQueueTotal = 0
|
||||
state.fileQueue = []
|
||||
}
|
||||
PROCESSING_POPUP(state, status) {
|
||||
state.processingPopup = status
|
||||
},
|
||||
ADD_FILES_TO_QUEUE(state, file) {
|
||||
state.fileQueue.push(file)
|
||||
},
|
||||
SHIFT_FROM_FILE_QUEUE(state) {
|
||||
state.fileQueue.shift()
|
||||
},
|
||||
PROCESSING_FILE(state, status) {
|
||||
state.isProcessingFile = status
|
||||
},
|
||||
UPLOADING_FILE_PROGRESS(state, percentage) {
|
||||
state.uploadingProgress = percentage
|
||||
},
|
||||
INCREASE_FILES_IN_QUEUES_TOTAL(state, count) {
|
||||
state.filesInQueueTotal += count
|
||||
},
|
||||
INCREASE_FILES_IN_QUEUE_UPLOADED(state) {
|
||||
state.filesInQueueUploaded++
|
||||
},
|
||||
CLEAR_UPLOAD_PROGRESS(state) {
|
||||
state.filesInQueueUploaded = 0
|
||||
state.filesInQueueTotal = 0
|
||||
state.fileQueue = []
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
filesInQueueUploaded: state => state.filesInQueueUploaded,
|
||||
filesInQueueTotal: state => state.filesInQueueTotal,
|
||||
uploadingProgress: state => state.uploadingProgress,
|
||||
isProcessingFile: state => state.isProcessingFile,
|
||||
processingPopup: state => state.processingPopup,
|
||||
fileQueue: state => state.fileQueue
|
||||
filesInQueueUploaded: state => state.filesInQueueUploaded,
|
||||
filesInQueueTotal: state => state.filesInQueueTotal,
|
||||
uploadingProgress: state => state.uploadingProgress,
|
||||
isProcessingFile: state => state.isProcessingFile,
|
||||
processingPopup: state => state.processingPopup,
|
||||
fileQueue: state => state.fileQueue
|
||||
}
|
||||
|
||||
export default {
|
||||
state: defaultState,
|
||||
mutations,
|
||||
actions,
|
||||
getters
|
||||
state: defaultState,
|
||||
mutations,
|
||||
actions,
|
||||
getters
|
||||
}
|
||||
|
||||
9
resources/js/store/modules/sharing.js
vendored
9
resources/js/store/modules/sharing.js
vendored
@@ -81,8 +81,7 @@ const actions = {
|
||||
})
|
||||
|
||||
axios
|
||||
.post('/api/share/cancel', {
|
||||
_method: 'post',
|
||||
.post('/api/share/revoke', {
|
||||
tokens: tokens
|
||||
})
|
||||
.then(() => {
|
||||
@@ -90,7 +89,7 @@ const actions = {
|
||||
items.forEach(item => {
|
||||
|
||||
// Remove item from file browser
|
||||
if ( getters.currentFolder , getters.currentFolder.location === 'shared' ) {
|
||||
if ( getters.currentFolder && getters.currentFolder.location === 'shared' ) {
|
||||
commit('REMOVE_ITEM', item.id)
|
||||
}
|
||||
|
||||
@@ -112,8 +111,8 @@ const actions = {
|
||||
getSingleFile: ({commit, state}) => {
|
||||
|
||||
let route = state.sharedDetail.protected
|
||||
? '/api/files/private'
|
||||
: '/api/files/' + router.currentRoute.params.token + '/public'
|
||||
? '/api/browse/files/private'
|
||||
: '/api/browse/files/' + router.currentRoute.params.token + '/public'
|
||||
|
||||
axios.get(route)
|
||||
.then(response => {
|
||||
|
||||
32
resources/js/store/modules/userAuth.js
vendored
32
resources/js/store/modules/userAuth.js
vendored
@@ -21,7 +21,7 @@ const actions = {
|
||||
|
||||
// Redirect user if is logged
|
||||
if (router.currentRoute.name === 'SignIn')
|
||||
router.push({ name: 'Files' })
|
||||
router.push({name: 'Files'})
|
||||
|
||||
commit('RETRIEVE_USER', response.data)
|
||||
|
||||
@@ -61,13 +61,13 @@ const actions = {
|
||||
let items = [folder]
|
||||
|
||||
// If dont coming single folder get folders to add to favourites from fileInfoDetail
|
||||
if(!folder)
|
||||
if (!folder)
|
||||
items = context.getters.fileInfoDetail
|
||||
|
||||
items.forEach((data) => {
|
||||
if(data.type === 'folder' ) {
|
||||
if (data.type === 'folder') {
|
||||
|
||||
if(context.getters.user.data.relationships.favourites.data.attributes.folders.find(folder => folder.id === data.id)) return
|
||||
if (context.getters.user.data.relationships.favourites.data.attributes.folders.find(folder => folder.id === data.id)) return
|
||||
|
||||
addFavourites.push({
|
||||
id: data.id
|
||||
@@ -76,24 +76,24 @@ const actions = {
|
||||
})
|
||||
|
||||
// If dont coming single folder clear the selected folders in fileInfoDetail
|
||||
if(!folder) {
|
||||
if (!folder) {
|
||||
context.commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
let pushToFavorites = []
|
||||
|
||||
|
||||
// Check is favorites already don't include some of pushed folders
|
||||
items.map(data => {
|
||||
if(!context.getters.user.data.relationships.favourites.data.attributes.folders.find(folder => folder.id === data.id)){
|
||||
if (!context.getters.user.data.relationships.favourites.data.attributes.folders.find(folder => folder.id === data.id)) {
|
||||
pushToFavorites.push(data)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// Add to storage
|
||||
context.commit('ADD_TO_FAVOURITES', pushToFavorites)
|
||||
|
||||
axios
|
||||
.post(context.getters.api + '/browse/folders/favourites', {
|
||||
.post(context.getters.api + '/folders/favourites', {
|
||||
folders: addFavourites
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -127,13 +127,13 @@ const mutations = {
|
||||
state.app = undefined
|
||||
},
|
||||
ADD_TO_FAVOURITES(state, folder) {
|
||||
folder.forEach(item => {
|
||||
state.user.data.relationships.favourites.data.attributes.folders.push({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
folder.forEach(item => {
|
||||
state.user.data.relationships.favourites.data.attributes.folders.push({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
UPDATE_NAME(state, name) {
|
||||
state.user.data.relationships.settings.data.attributes.name = name
|
||||
@@ -155,7 +155,7 @@ const mutations = {
|
||||
|
||||
const getters = {
|
||||
permission: state => state.permission,
|
||||
isGuest: state => ! state.authorized,
|
||||
isGuest: state => !state.authorized,
|
||||
isLogged: state => state.authorized,
|
||||
user: state => state.user,
|
||||
}
|
||||
|
||||
@@ -210,10 +210,10 @@
|
||||
this.$scrollTop()
|
||||
this.$store.commit('PROCESSING_POPUP', undefined)
|
||||
|
||||
if (this.config.isDemo) {
|
||||
//if (this.config.isDemo) {
|
||||
this.loginEmail = 'howdy@hi5ve.digital'
|
||||
this.loginPassword = 'vuefilemanager'
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -99,70 +99,56 @@ class UserAccountTest extends TestCase
|
||||
$this->getJson('/api/user')
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
"data" => [
|
||||
"id" => (string) $user->id,
|
||||
"type" => "user",
|
||||
"attributes" => [
|
||||
"data" => [
|
||||
"id" => (string)$user->id,
|
||||
"type" => "user",
|
||||
"attributes" => [
|
||||
"storage_capacity" => "5",
|
||||
"subscription" => false,
|
||||
"incomplete_payment" => null,
|
||||
"stripe_customer" => false,
|
||||
"email" => $user->email,
|
||||
"role" => $user->role,
|
||||
"folders" => [],
|
||||
"storage" => [
|
||||
"used" => 0,
|
||||
"used_formatted" => "0.00%",
|
||||
"capacity" => "5",
|
||||
"capacity_formatted" => "5GB",
|
||||
],
|
||||
"created_at_formatted" => format_date($user->created_at, '%d. %B. %Y'),
|
||||
"created_at" => $user->created_at->toJson(),
|
||||
"updated_at" => $user->updated_at->toJson(),
|
||||
],
|
||||
"relationships" => [
|
||||
"settings" => [
|
||||
"data" => [
|
||||
"id" => (string)$user->id,
|
||||
"type" => "settings",
|
||||
"attributes" => [
|
||||
'avatar' => $user->settings->avatar,
|
||||
'name' => $user->settings->name,
|
||||
'address' => $user->settings->address,
|
||||
'state' => $user->settings->state,
|
||||
'city' => $user->settings->city,
|
||||
'postal_code' => $user->settings->postal_code,
|
||||
'country' => $user->settings->country,
|
||||
'phone_number' => $user->settings->phone_number,
|
||||
'timezone' => $user->settings->timezone
|
||||
]
|
||||
]
|
||||
],
|
||||
"favourites" => [
|
||||
"data" => [
|
||||
"id" => (string)$user->id,
|
||||
"type" => "favourite_folders",
|
||||
"attributes" => [
|
||||
"folders" => []
|
||||
]
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
"relationships" => [
|
||||
"settings" => [
|
||||
"data" => [
|
||||
"id" => (string) $user->id,
|
||||
"type" => "settings",
|
||||
"attributes" => [
|
||||
'avatar' => $user->settings->avatar,
|
||||
'billing_name' => $user->settings->name,
|
||||
'billing_address' => $user->settings->address,
|
||||
'billing_state' => $user->settings->state,
|
||||
'billing_city' => $user->settings->city,
|
||||
'billing_postal_code' => $user->settings->postal_code,
|
||||
'billing_country' => $user->settings->country,
|
||||
'billing_phone_number' => $user->settings->phone_number,
|
||||
'timezone' => $user->settings->timezone
|
||||
]
|
||||
]
|
||||
],
|
||||
"storage" => [
|
||||
"data" => [
|
||||
"id" => "1",
|
||||
"type" => "storage",
|
||||
"attributes" => [
|
||||
"used" => 0,
|
||||
"used_formatted" => "0.00%",
|
||||
"capacity" => "5",
|
||||
"capacity_formatted" => "5GB",
|
||||
]
|
||||
]
|
||||
],
|
||||
"favourites" => [
|
||||
"data" => [
|
||||
"id" => "1",
|
||||
"type" => "folders_favourite",
|
||||
"attributes" => [
|
||||
"folders" => []
|
||||
]
|
||||
]
|
||||
],
|
||||
"tree" => [
|
||||
"data" => [
|
||||
"id" => "1",
|
||||
"type" => "folders_tree",
|
||||
"attributes" => [
|
||||
"folders" => [],
|
||||
]
|
||||
]
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user