Cleanup files mount and fix path for global search (#1341)

This commit is contained in:
Boy132 2025-05-06 08:36:51 +02:00 committed by GitHub
parent 85d625d118
commit 292523d153
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 17 deletions

View File

@ -46,17 +46,10 @@ class ListFiles extends ListRecords
protected static string $resource = FileResource::class; protected static string $resource = FileResource::class;
#[Locked] #[Locked]
public string $path; public string $path = '/';
private DaemonFileRepository $fileRepository; private DaemonFileRepository $fileRepository;
public function mount(?string $path = null): void
{
parent::mount();
$this->path = $path ?? '/';
}
public function getBreadcrumbs(): array public function getBreadcrumbs(): array
{ {
$resource = static::getResource(); $resource = static::getResource();

View File

@ -12,6 +12,7 @@ use Filament\Resources\Pages\ListRecords;
use Filament\Tables\Columns\TextColumn; use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table; use Filament\Tables\Table;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Url;
class SearchFiles extends ListRecords class SearchFiles extends ListRecords
{ {
@ -22,15 +23,8 @@ class SearchFiles extends ListRecords
#[Locked] #[Locked]
public string $searchTerm; public string $searchTerm;
#[Locked] #[Url]
public string $path; public string $path = '/';
public function mount(?string $searchTerm = null, ?string $path = null): void
{
parent::mount();
$this->searchTerm = $searchTerm;
$this->path = $path ?? '/';
}
public function getBreadcrumbs(): array public function getBreadcrumbs(): array
{ {