Skip to content

Commit

Permalink
Merge branch 'main' into charles/translations
Browse files Browse the repository at this point in the history
  • Loading branch information
notAreYouScared committed Jan 28, 2025
2 parents ac34c36 + dde5305 commit 4819c5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/Filament/Admin/Resources/EggResource/Pages/CreateEgg.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use AbdelhamidErrahmouni\FilamentMonacoEditor\MonacoEditor;
use App\Filament\Admin\Resources\EggResource;
use App\Models\EggVariable;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Fieldset;
use Filament\Forms\Components\Hidden;
Expand Down Expand Up @@ -189,8 +190,11 @@ public function form(Form $form): Form
->hintIcon('tabler-code')
->hintIconTooltip(fn ($state) => "{{{$state}}}")
->unique(modifyRuleUsing: fn (Unique $rule, Get $get) => $rule->where('egg_id', $get('../../id')), ignoreRecord: true)
->rules(EggVariable::$validationRules['env_variable'])
->validationMessages([
'unique' => 'A variable with this name already exists.',
'required' => ' The environment variable field is required.',
'*' => 'This environment variable is reserved and cannot be used.',
])
->required(),
TextInput::make('default_value')->maxLength(255),
Expand Down
4 changes: 4 additions & 0 deletions app/Filament/Admin/Resources/EggResource/Pages/EditEgg.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Filament\Components\Actions\ExportEggAction;
use App\Filament\Components\Actions\ImportEggAction;
use App\Models\Egg;
use App\Models\EggVariable;
use Filament\Actions\DeleteAction;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Fieldset;
Expand Down Expand Up @@ -180,8 +181,11 @@ public function form(Form $form): Form
->hintIcon('tabler-code')
->hintIconTooltip(fn ($state) => "{{{$state}}}")
->unique(modifyRuleUsing: fn (Unique $rule, Get $get) => $rule->where('egg_id', $get('../../id')), ignoreRecord: true)
->rules(EggVariable::$validationRules['env_variable'])
->validationMessages([
'unique' => 'A variable with this name already exists.',
'required' => ' The environment variable field is required.',
'*' => 'This environment variable is reserved and cannot be used.',
])
->required(),
TextInput::make('default_value')->maxLength(255),
Expand Down
2 changes: 1 addition & 1 deletion app/Models/EggVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class EggVariable extends Model
/**
* Reserved environment variable names.
*/
public const RESERVED_ENV_NAMES = 'SERVER_MEMORY,SERVER_IP,SERVER_PORT,ENV,HOME,USER,STARTUP,SERVER_UUID,UUID';
public const RESERVED_ENV_NAMES = 'P_SERVER_UUID,P_SERVER_ALLOCATION_LIMIT,SERVER_MEMORY,SERVER_IP,SERVER_PORT,ENV,HOME,USER,STARTUP,MODIFIED_STARTUP,SERVER_UUID,UUID,INTERNAL_IP';

/**
* The table associated with the model.
Expand Down

0 comments on commit 4819c5b

Please sign in to comment.