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