Fix file manager navigation and bulk select

This commit is contained in:
root
2026-01-29 05:52:25 +02:00
parent 5862fd62cc
commit a412c9d2c9
3 changed files with 16 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
A modern web hosting control panel for WordPress and general PHP hosting. Built with Laravel 12, Filament v5, Livewire 4, and Tailwind CSS v4. A modern web hosting control panel for WordPress and general PHP hosting. Built with Laravel 12, Filament v5, Livewire 4, and Tailwind CSS v4.
Version: 0.9-rc30 (release candidate) Version: 0.9-rc31 (release candidate)
This is a release candidate. Expect rapid iteration and breaking changes until 1.0. This is a release candidate. Expect rapid iteration and breaking changes until 1.0.
@@ -156,6 +156,7 @@ php artisan test --compact
## Initial Release ## Initial Release
- 0.9-rc31: File manager navigation uses Livewire actions; parent row excluded from bulk select.
- 0.9-rc30: Avoid IncludeOptional in ModSecurity CRS includes. - 0.9-rc30: Avoid IncludeOptional in ModSecurity CRS includes.
- 0.9-rc29: Ensure ModSecurity unicode mapping is installed automatically. - 0.9-rc29: Ensure ModSecurity unicode mapping is installed automatically.
- 0.9-rc28: ModSecurity unicode mapping setup fixes. - 0.9-rc28: ModSecurity unicode mapping setup fixes.

View File

@@ -1 +1 @@
VERSION=0.9-rc30 VERSION=0.9-rc31

View File

@@ -232,6 +232,7 @@ class Files extends Page implements HasActions, HasForms, HasTable
try { try {
$this->currentPath = $this->sanitizePath($path); $this->currentPath = $this->sanitizePath($path);
$this->loadDirectory(); $this->loadDirectory();
$this->resetTable();
} catch (Exception $e) { } catch (Exception $e) {
Notification::make() Notification::make()
->title('Invalid path') ->title('Invalid path')
@@ -280,7 +281,15 @@ class Files extends Page implements HasActions, HasForms, HasTable
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
->records(fn () => $this->items) ->records(function () {
return collect($this->items)
->mapWithKeys(function (array $item, int $index): array {
$key = $item['path'] ?? $item['name'] ?? (string) $index;
return [$key => $item];
})
->all();
})
->columns([ ->columns([
TextColumn::make('name') TextColumn::make('name')
->label(__('Name')) ->label(__('Name'))
@@ -294,10 +303,8 @@ class Files extends Page implements HasActions, HasForms, HasTable
$record['is_dir'] => 'warning', $record['is_dir'] => 'warning',
default => 'info', default => 'info',
}) })
->url(fn (array $record): ?string => $record['is_dir'] ->action(fn (array $record) => $this->navigateTo($record['path']))
? route('filament.jabali.pages.files', ['path' => $record['path']]) ->disabledClick(fn (array $record): bool => ! $record['is_dir'])
: null)
->openUrlInNewTab(false)
->weight('medium') ->weight('medium')
->searchable(), ->searchable(),
TextColumn::make('size') TextColumn::make('size')
@@ -619,6 +626,7 @@ class Files extends Page implements HasActions, HasForms, HasTable
$this->resetTable(); $this->resetTable();
}), }),
]) ])
->checkIfRecordIsSelectableUsing(fn (array $record): bool => ! ($record['is_parent'] ?? false))
->headerActions([ ->headerActions([
$this->newFolderAction(), $this->newFolderAction(),
$this->newFileAction(), $this->newFileAction(),