mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 20:59:31 +01:00
Fix allocations by admins aren't locked by default (#1879)
This commit is contained in:
parent
f4ee33fa4f
commit
5c3b0919aa
@ -11,6 +11,7 @@ use Filament\Actions\AssociateAction;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\DissociateAction;
|
||||
use Filament\Actions\DissociateBulkAction;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
@ -126,6 +127,8 @@ class AllocationsRelationManager extends RelationManager
|
||||
->afterStateUpdated(fn ($state, Set $set, Get $get) => $set('allocation_ports', CreateServer::retrieveValidPorts($this->getOwnerRecord()->node, $state, $get('allocation_ip'))))
|
||||
->splitKeys(['Tab', ' ', ','])
|
||||
->required(),
|
||||
Hidden::make('is_locked')
|
||||
->default(true),
|
||||
])
|
||||
->action(fn (array $data, AssignmentService $service) => $service->handle($this->getOwnerRecord()->node, $data, $this->getOwnerRecord())),
|
||||
AssociateAction::make()
|
||||
|
||||
@ -85,6 +85,7 @@ class AssignmentService
|
||||
'port' => (int) $unit,
|
||||
'ip_alias' => array_get($data, 'allocation_alias'),
|
||||
'server_id' => $server->id ?? null,
|
||||
'is_locked' => array_get($data, 'is_locked', false),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
@ -98,6 +99,7 @@ class AssignmentService
|
||||
'port' => (int) $port,
|
||||
'ip_alias' => array_get($data, 'allocation_alias'),
|
||||
'server_id' => $server->id ?? null,
|
||||
'is_locked' => array_get($data, 'is_locked', false),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user