mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-09 21:28:53 +02:00
Add toggle for starting server after install
This commit is contained in:
parent
58307c15a3
commit
e152efc5f9
@ -321,9 +321,9 @@ class CreateServer extends CreateRecord
|
|||||||
->completedIcon('tabler-check')
|
->completedIcon('tabler-check')
|
||||||
->columns([
|
->columns([
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 4,
|
||||||
'md' => 2,
|
'md' => 4,
|
||||||
'lg' => 4,
|
'lg' => 6,
|
||||||
])
|
])
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\Select::make('egg_id')
|
Forms\Components\Select::make('egg_id')
|
||||||
@ -333,7 +333,7 @@ class CreateServer extends CreateRecord
|
|||||||
'default' => 1,
|
'default' => 1,
|
||||||
'sm' => 2,
|
'sm' => 2,
|
||||||
'md' => 2,
|
'md' => 2,
|
||||||
'lg' => 3,
|
'lg' => 4,
|
||||||
])
|
])
|
||||||
->searchable()
|
->searchable()
|
||||||
->preload()
|
->preload()
|
||||||
@ -390,29 +390,51 @@ class CreateServer extends CreateRecord
|
|||||||
->inline()
|
->inline()
|
||||||
->required(),
|
->required(),
|
||||||
|
|
||||||
|
Forms\Components\ToggleButtons::make('start_on_completion')
|
||||||
|
->label('Start Server After Install?')
|
||||||
|
->default(true)
|
||||||
|
->required()
|
||||||
|
->columnSpan([
|
||||||
|
'default' => 1,
|
||||||
|
'sm' => 1,
|
||||||
|
'md' => 1,
|
||||||
|
'lg' => 1,
|
||||||
|
])
|
||||||
|
->options([
|
||||||
|
true => 'Yes',
|
||||||
|
false => 'No',
|
||||||
|
])
|
||||||
|
->colors([
|
||||||
|
true => 'primary',
|
||||||
|
false => 'danger',
|
||||||
|
])
|
||||||
|
->icons([
|
||||||
|
true => 'tabler-code',
|
||||||
|
false => 'tabler-code-off',
|
||||||
|
])
|
||||||
|
->inline(),
|
||||||
|
|
||||||
Forms\Components\Textarea::make('startup')
|
Forms\Components\Textarea::make('startup')
|
||||||
->hintIcon('tabler-code')
|
->hintIcon('tabler-code')
|
||||||
->label('Startup Command')
|
->label('Startup Command')
|
||||||
->hidden(fn (Forms\Get $get) => $get('egg_id') === null)
|
->hidden(fn (Forms\Get $get) => $get('egg_id') === null)
|
||||||
->required()
|
->required()
|
||||||
->live()
|
->live()
|
||||||
->columnSpan([
|
|
||||||
'default' => 1,
|
|
||||||
'sm' => 2,
|
|
||||||
'md' => 2,
|
|
||||||
'lg' => 4,
|
|
||||||
])
|
|
||||||
->rows(function ($state) {
|
->rows(function ($state) {
|
||||||
return str($state)->explode("\n")->reduce(
|
return str($state)->explode("\n")->reduce(
|
||||||
fn (int $carry, $line) => $carry + floor(strlen($line) / 125),
|
fn (int $carry, $line) => $carry + floor(strlen($line) / 125),
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}),
|
})
|
||||||
|
->columnSpan([
|
||||||
|
'default' => 1,
|
||||||
|
'sm' => 4,
|
||||||
|
'md' => 4,
|
||||||
|
'lg' => 6,
|
||||||
|
]),
|
||||||
|
|
||||||
Forms\Components\Hidden::make('environment')->default([]),
|
Forms\Components\Hidden::make('environment')->default([]),
|
||||||
|
|
||||||
Forms\Components\Hidden::make('start_on_completion')->default(true),
|
|
||||||
|
|
||||||
Forms\Components\Section::make('Variables')
|
Forms\Components\Section::make('Variables')
|
||||||
->icon('tabler-eggs')
|
->icon('tabler-eggs')
|
||||||
->iconColor('primary')
|
->iconColor('primary')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user