81 lines
5.6 KiB
PHP
81 lines
5.6 KiB
PHP
<?php
|
|
|
|
return [
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| NAS Connection
|
|
|--------------------------------------------------------------------------
|
|
| Protocol: sftp | ftp | ftps | smb
|
|
*/
|
|
'connection' => [
|
|
'protocol' => env('NAS_PROTOCOL', 'sftp'),
|
|
'host' => env('NAS_HOST', ''),
|
|
'port' => (int) env('NAS_PORT', 22),
|
|
'username' => env('NAS_USERNAME', ''),
|
|
'password' => env('NAS_PASSWORD', ''),
|
|
'path' => env('NAS_PATH', '/media'),
|
|
'smb_share' => env('NAS_SMB_SHARE', ''),
|
|
'smb_domain' => env('NAS_SMB_DOMAIN', ''),
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Routing
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
'route_prefix' => env('NAS_FM_ROUTE_PREFIX', 'nas-file-manager'),
|
|
'middleware' => ['web', 'auth', 'super_admin'],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Authorization
|
|
|--------------------------------------------------------------------------
|
|
| Gate or permission name that controls create / rename / delete actions.
|
|
| Set to null to allow any authenticated user.
|
|
| Example: 'edit-nas' (checked with Gate::allows())
|
|
*/
|
|
'edit_gate' => null,
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Folder Schema
|
|
|--------------------------------------------------------------------------
|
|
| Static schema shown in the "Schema" tab.
|
|
| Each node: depth (int), label (string), path (string),
|
|
| parent_path (?string), is_template (bool), can_edit (bool)
|
|
|
|
|
| You can also pass $nodes dynamically to the Blade component:
|
|
| <x-nas-file-manager::file-manager :nodes="$myNodes" />
|
|
*/
|
|
'schema' => [
|
|
|
|
// ── users ─────────────────────────────────────────────────────────────
|
|
['depth' => 0, 'label' => 'users', 'path' => 'users', 'parent_path' => null, 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 1, 'label' => '{username}', 'path' => 'users/{username}', 'parent_path' => 'users', 'is_template' => true, 'can_edit' => false],
|
|
|
|
// ── profile ───────────────────────────────────────────────────────────
|
|
['depth' => 2, 'label' => 'profile', 'path' => 'u/profile', 'parent_path' => 'users/{username}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 3, 'label' => 'avatar.webp', 'path' => 'profile/avatar.webp', 'parent_path' => 'u/profile', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 3, 'label' => 'cover.webp', 'path' => 'profile/cover.webp', 'parent_path' => 'u/profile', 'is_template' => false, 'can_edit' => false],
|
|
|
|
// ── videos ────────────────────────────────────────────────────────────
|
|
['depth' => 2, 'label' => 'videos', 'path' => 'u/videos', 'parent_path' => 'users/{username}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 3, 'label' => '{video-slug}', 'path' => 'videos/{video-slug}', 'parent_path' => 'u/videos', 'is_template' => true, 'can_edit' => false],
|
|
['depth' => 4, 'label' => '{video-slug}.{ext}', 'path' => 'vid/file', 'parent_path' => 'videos/{video-slug}', 'is_template' => true, 'can_edit' => false],
|
|
['depth' => 4, 'label' => 'thumb.webp', 'path' => 'vid/thumb.webp', 'parent_path' => 'videos/{video-slug}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 4, 'label' => 'meta.json', 'path' => 'vid/meta.json', 'parent_path' => 'videos/{video-slug}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 4, 'label' => 'view-log.json', 'path' => 'vid/view-log.json', 'parent_path' => 'videos/{video-slug}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 4, 'label' => 'edit-log.json', 'path' => 'vid/edit-log.json', 'parent_path' => 'videos/{video-slug}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 4, 'label' => 'slides', 'path' => 'vid/slides', 'parent_path' => 'videos/{video-slug}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 5, 'label' => '{position}.{ext}','path' => 'slide/file', 'parent_path' => 'vid/slides', 'is_template' => true, 'can_edit' => false],
|
|
|
|
// ── posts ─────────────────────────────────────────────────────────────
|
|
['depth' => 2, 'label' => 'posts', 'path' => 'u/posts', 'parent_path' => 'users/{username}', 'is_template' => false, 'can_edit' => false],
|
|
['depth' => 3, 'label' => '{post_id}', 'path' => 'posts/{post_id}', 'parent_path' => 'u/posts', 'is_template' => true, 'can_edit' => false],
|
|
['depth' => 4, 'label' => '{n}.{ext}', 'path' => 'post/image', 'parent_path' => 'posts/{post_id}', 'is_template' => true, 'can_edit' => false],
|
|
|
|
],
|
|
|
|
];
|