mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-09-19 23:31:12 +00:00
update
This commit is contained in:
parent
081b67f1ef
commit
207148a6a4
|
@ -146,6 +146,17 @@ class ManageHostingSubscriptionFileManager extends ViewRecord implements HasTabl
|
||||||
->checkIfRecordIsSelectableUsing(fn (FileItem $record): bool => ! $record->isPreviousPath())
|
->checkIfRecordIsSelectableUsing(fn (FileItem $record): bool => ! $record->isPreviousPath())
|
||||||
->headerActionsPosition(HeaderActionsPosition::Bottom)
|
->headerActionsPosition(HeaderActionsPosition::Bottom)
|
||||||
->headerActions([
|
->headerActions([
|
||||||
|
|
||||||
|
Action::make('home')
|
||||||
|
->label('Home')
|
||||||
|
->action(fn () => $this->path = '')
|
||||||
|
->icon('heroicon-o-home'),
|
||||||
|
|
||||||
|
Action::make('back')
|
||||||
|
->label('Back')
|
||||||
|
->action(fn () => $this->path = dirname($this->path))
|
||||||
|
->icon('heroicon-o-arrow-left'),
|
||||||
|
|
||||||
Action::make('create_folder')
|
Action::make('create_folder')
|
||||||
->label('Create Folder')
|
->label('Create Folder')
|
||||||
->icon('heroicon-o-folder-plus')
|
->icon('heroicon-o-folder-plus')
|
||||||
|
|
|
@ -96,15 +96,14 @@ class FileItem extends Model
|
||||||
'size' => null,
|
'size' => null,
|
||||||
'type' => 'Folder',
|
'type' => 'Folder',
|
||||||
'path' => $directory,
|
'path' => $directory,
|
||||||
]
|
]),
|
||||||
),
|
|
||||||
...collect($storage->files(static::$path))
|
...collect($storage->files(static::$path))
|
||||||
->sort()
|
->sort()
|
||||||
->map(fn (string $file): array => [
|
->map(fn (string $file): array => [
|
||||||
'name' => Str::remove(self::$path.'/', $file),
|
'name' => Str::remove(self::$path.'/', $file),
|
||||||
'dateModified' => $storage->lastModified($file),
|
'dateModified' => $storage->lastModified($file),
|
||||||
'size' => $storage->size($file),
|
'size' => $storage->size($file),
|
||||||
'type' => $storage->mimeType($file) ?: null,
|
'type' => $storage->mimeType($file) ?: 'File',
|
||||||
'path' => $file,
|
'path' => $file,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue