mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 10:54:46 +02:00
When editing set the custom image selector correctly
This commit is contained in:
parent
25177d1685
commit
4c5072b5c0
@ -325,6 +325,15 @@ class ServerResource extends Resource
|
|||||||
->live()
|
->live()
|
||||||
->label('Custom Image?')
|
->label('Custom Image?')
|
||||||
->default(false)
|
->default(false)
|
||||||
|
->formatStateUsing(function ($state, Forms\Get $get) {
|
||||||
|
if ($state !== null) {
|
||||||
|
return $state;
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = Egg::find($get('egg_id'))->docker_images ?? [];
|
||||||
|
|
||||||
|
return !in_array($get('image'), $images);
|
||||||
|
})
|
||||||
->options([
|
->options([
|
||||||
false => 'No',
|
false => 'No',
|
||||||
true => 'Yes',
|
true => 'Yes',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user