mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 23:59:33 +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\CreateAction;
|
||||||
use Filament\Actions\DissociateAction;
|
use Filament\Actions\DissociateAction;
|
||||||
use Filament\Actions\DissociateBulkAction;
|
use Filament\Actions\DissociateBulkAction;
|
||||||
|
use Filament\Forms\Components\Hidden;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TagsInput;
|
use Filament\Forms\Components\TagsInput;
|
||||||
use Filament\Forms\Components\TextInput;
|
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'))))
|
->afterStateUpdated(fn ($state, Set $set, Get $get) => $set('allocation_ports', CreateServer::retrieveValidPorts($this->getOwnerRecord()->node, $state, $get('allocation_ip'))))
|
||||||
->splitKeys(['Tab', ' ', ','])
|
->splitKeys(['Tab', ' ', ','])
|
||||||
->required(),
|
->required(),
|
||||||
|
Hidden::make('is_locked')
|
||||||
|
->default(true),
|
||||||
])
|
])
|
||||||
->action(fn (array $data, AssignmentService $service) => $service->handle($this->getOwnerRecord()->node, $data, $this->getOwnerRecord())),
|
->action(fn (array $data, AssignmentService $service) => $service->handle($this->getOwnerRecord()->node, $data, $this->getOwnerRecord())),
|
||||||
AssociateAction::make()
|
AssociateAction::make()
|
||||||
|
|||||||
@ -85,6 +85,7 @@ class AssignmentService
|
|||||||
'port' => (int) $unit,
|
'port' => (int) $unit,
|
||||||
'ip_alias' => array_get($data, 'allocation_alias'),
|
'ip_alias' => array_get($data, 'allocation_alias'),
|
||||||
'server_id' => $server->id ?? null,
|
'server_id' => $server->id ?? null,
|
||||||
|
'is_locked' => array_get($data, 'is_locked', false),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -98,6 +99,7 @@ class AssignmentService
|
|||||||
'port' => (int) $port,
|
'port' => (int) $port,
|
||||||
'ip_alias' => array_get($data, 'allocation_alias'),
|
'ip_alias' => array_get($data, 'allocation_alias'),
|
||||||
'server_id' => $server->id ?? null,
|
'server_id' => $server->id ?? null,
|
||||||
|
'is_locked' => array_get($data, 'is_locked', false),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user