mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-31 10:44: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
|
// 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