Merge pull request #708 from pelican-dev/charles/fixbulk
Prevent Select All on Allocations
This commit is contained in:
commit
9491322d8c
@ -48,6 +48,7 @@ class AllocationsRelationManager extends RelationManager
|
|||||||
// All assigned allocations
|
// All assigned allocations
|
||||||
->checkIfRecordIsSelectableUsing(fn (Allocation $allocation) => $allocation->server_id === null)
|
->checkIfRecordIsSelectableUsing(fn (Allocation $allocation) => $allocation->server_id === null)
|
||||||
->searchable()
|
->searchable()
|
||||||
|
->selectCurrentPageOnly() //Prevent people from trying to nuke 30,000 ports at once.... -,-
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id'),
|
TextColumn::make('id'),
|
||||||
TextColumn::make('port')
|
TextColumn::make('port')
|
||||||
@ -65,12 +66,6 @@ class AllocationsRelationManager extends RelationManager
|
|||||||
->searchable()
|
->searchable()
|
||||||
->label('IP'),
|
->label('IP'),
|
||||||
])
|
])
|
||||||
->filters([
|
|
||||||
//
|
|
||||||
])
|
|
||||||
->actions([
|
|
||||||
//
|
|
||||||
])
|
|
||||||
->headerActions([
|
->headerActions([
|
||||||
Tables\Actions\Action::make('create new allocation')->label('Create Allocations')
|
Tables\Actions\Action::make('create new allocation')->label('Create Allocations')
|
||||||
->form(fn () => [
|
->form(fn () => [
|
||||||
|
@ -40,6 +40,7 @@ class AllocationsRelationManager extends RelationManager
|
|||||||
public function table(Table $table): Table
|
public function table(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
|
->selectCurrentPageOnly()
|
||||||
->recordTitleAttribute('ip')
|
->recordTitleAttribute('ip')
|
||||||
->recordTitle(fn (Allocation $allocation) => "$allocation->ip:$allocation->port")
|
->recordTitle(fn (Allocation $allocation) => "$allocation->ip:$allocation->port")
|
||||||
->checkIfRecordIsSelectableUsing(fn (Allocation $record) => $record->id !== $this->getOwnerRecord()->allocation_id)
|
->checkIfRecordIsSelectableUsing(fn (Allocation $record) => $record->id !== $this->getOwnerRecord()->allocation_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user