mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 13:14:45 +02:00
Prevent Select All
Prevent Select all on allocations, prevent people from trying to delete 30,000 ports at once ....
This commit is contained in:
parent
d9016702d6
commit
a787af7a06
@ -48,6 +48,7 @@ class AllocationsRelationManager extends RelationManager
|
||||
// All assigned allocations
|
||||
->checkIfRecordIsSelectableUsing(fn(Allocation $allocation) => $allocation->server_id === null)
|
||||
->searchable()
|
||||
->selectCurrentPageOnly() //Prevent people from trying to nuke 30,000 ports at once.... -,-
|
||||
->columns([
|
||||
TextColumn::make('id'),
|
||||
TextColumn::make('port')
|
||||
@ -65,12 +66,6 @@ class AllocationsRelationManager extends RelationManager
|
||||
->searchable()
|
||||
->label('IP'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\Action::make('create new allocation')->label('Create Allocations')
|
||||
->form(fn() => [
|
||||
|
@ -40,6 +40,7 @@ class AllocationsRelationManager extends RelationManager
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->selectCurrentPageOnly()
|
||||
->recordTitleAttribute('ip')
|
||||
->recordTitle(fn(Allocation $allocation) => "$allocation->ip:$allocation->port")
|
||||
->checkIfRecordIsSelectableUsing(fn(Allocation $record) => $record->id !== $this->getOwnerRecord()->allocation_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user