mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 22:44:46 +02:00
Add toggle for custom image
This commit is contained in:
parent
f8550334dd
commit
f32aa8609d
@ -137,14 +137,35 @@ class ServerResource extends Resource
|
|||||||
->required(),
|
->required(),
|
||||||
|
|
||||||
Forms\Components\Select::make('image')
|
Forms\Components\Select::make('image')
|
||||||
|
->hidden(fn (Forms\Get $get) => $get('custom_image'))
|
||||||
|
->disabled(fn (Forms\Get $get) => $get('custom_image'))
|
||||||
|
->label('Docker Image')
|
||||||
->options(fn (Forms\Get $get) => array_flip(Egg::find($get('egg_id'))->docker_images ?? []))
|
->options(fn (Forms\Get $get) => array_flip(Egg::find($get('egg_id'))->docker_images ?? []))
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
|
->columnSpan(2)
|
||||||
->required(),
|
->required(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('image')
|
Forms\Components\TextInput::make('image')
|
||||||
|
->hidden(fn (Forms\Get $get) => !$get('custom_image'))
|
||||||
|
->disabled(fn (Forms\Get $get) => !$get('custom_image'))
|
||||||
->label('Docker Image')
|
->label('Docker Image')
|
||||||
->placeholder('Or enter a custom Image...')
|
->placeholder('Enter a custom Image')
|
||||||
->columnSpan(2),
|
->columnSpan(2)
|
||||||
|
->required(),
|
||||||
|
|
||||||
|
Forms\Components\ToggleButtons::make('custom_image')
|
||||||
|
->live()
|
||||||
|
->label('Custom Image?')
|
||||||
|
->default(false)
|
||||||
|
->options([
|
||||||
|
false => 'No',
|
||||||
|
true => 'Yes',
|
||||||
|
])
|
||||||
|
->colors([
|
||||||
|
false => 'primary',
|
||||||
|
true => 'danger',
|
||||||
|
])
|
||||||
|
->inline(),
|
||||||
|
|
||||||
Forms\Components\Fieldset::make('Application Feature Limits')
|
Forms\Components\Fieldset::make('Application Feature Limits')
|
||||||
->inlineLabel()
|
->inlineLabel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user