mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 22:14:45 +02:00
Add Owner
Filter to ListServers
(#1180)
* Add `Owner` Filter to `ListServers` * Make `Owner` filter show on `other` & `all` tabs Co-authored-by: Boy132 <Boy132@users.noreply.github.com> --------- Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
parent
72b9c309d3
commit
db3b16e609
@ -45,9 +45,19 @@ class ListServers extends ListRecords
|
||||
->relationship('egg', 'name', fn (Builder $query) => $query->whereIn('id', $baseQuery->pluck('egg_id')))
|
||||
->searchable()
|
||||
->preload(),
|
||||
SelectFilter::make('owner')
|
||||
->relationship('user', 'username', fn (Builder $query) => $query->whereIn('id', $baseQuery->pluck('owner_id')))
|
||||
->searchable()
|
||||
->hidden(fn () => $this->activeTab === 'my')
|
||||
->preload(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function updatedActiveTab(): void
|
||||
{
|
||||
$this->resetTable();
|
||||
}
|
||||
|
||||
public function getTabs(): array
|
||||
{
|
||||
$all = auth()->user()->accessibleServers();
|
||||
|
Loading…
x
Reference in New Issue
Block a user