mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 06:24:44 +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(),
|
||||
|
||||
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 ?? []))
|
||||
->selectablePlaceholder(false)
|
||||
->columnSpan(2)
|
||||
->required(),
|
||||
|
||||
Forms\Components\TextInput::make('image')
|
||||
->hidden(fn (Forms\Get $get) => !$get('custom_image'))
|
||||
->disabled(fn (Forms\Get $get) => !$get('custom_image'))
|
||||
->label('Docker Image')
|
||||
->placeholder('Or enter a custom Image...')
|
||||
->columnSpan(2),
|
||||
->placeholder('Enter a custom Image')
|
||||
->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')
|
||||
->inlineLabel()
|
||||
|
Loading…
x
Reference in New Issue
Block a user