Enable Update URL

Since importing an egg via url was added, we can enable this.
This commit is contained in:
Charles 2024-07-03 10:27:57 -04:00
parent 7164951085
commit 160ea1ed50
4 changed files with 12 additions and 7 deletions

View File

@ -74,9 +74,10 @@ class CreateEgg extends CreateRecord
->helperText('') ->helperText('')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]),
TextInput::make('update_url') TextInput::make('update_url')
->disabled() ->hintIcon('tabler-question-mark')
->helperText('Not implemented.') ->hintToolTip('URLs must point directly to the raw .json file.')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2])
->url(),
KeyValue::make('docker_images') KeyValue::make('docker_images')
->live() ->live()
->columnSpanFull() ->columnSpanFull()

View File

@ -91,8 +91,10 @@ class EditEgg extends EditRecord
->helperText('') ->helperText('')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]),
TextInput::make('update_url') TextInput::make('update_url')
->disabled() ->label('Update URL')
->helperText('Not implemented.') ->url()
->hintIcon('tabler-question-mark')
->hintIconTooltip('URLs must point directly to the raw .json file.')
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]), ->columnSpan(['default' => 1, 'sm' => 1, 'md' => 2, 'lg' => 2]),
KeyValue::make('docker_images') KeyValue::make('docker_images')
->live() ->live()
@ -247,8 +249,9 @@ class EditEgg extends EditRecord
Tab::make('From URL') Tab::make('From URL')
->icon('tabler-world-upload') ->icon('tabler-world-upload')
->schema([ ->schema([
TextInput::make('url') TextInput::make('update_url')
->label('URL') ->label('URL')
->formatStateUsing(fn (Egg $egg): string => $egg->update_url)
->hint('Link to the egg file (eg. minecraft.json)') ->hint('Link to the egg file (eg. minecraft.json)')
->url(), ->url(),
]), ]),

View File

@ -233,7 +233,7 @@ class CreateServer extends CreateRecord
$end = min((int) $end, 2 ** 16 - 1); $end = min((int) $end, 2 ** 16 - 1);
$range = $start <= $end ? range($start, $end) : range($end, $start); $range = $start <= $end ? range($start, $end) : range($end, $start);
foreach ($range as $i) { foreach ($range as $i) {
if($i > 1024 && $i <= 65535) { if ($i > 1024 && $i <= 65535) {
$ports->push($i); $ports->push($i);
} }
} }

View File

@ -95,6 +95,7 @@ class Egg extends Model
'config_stop', 'config_stop',
'config_from', 'config_from',
'startup', 'startup',
'update_url',
'script_is_privileged', 'script_is_privileged',
'script_install', 'script_install',
'script_entry', 'script_entry',