From 24f9a8aeb101c98ab9b5644a2aae5716707afb1f Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Thu, 11 Apr 2024 03:11:27 -0400 Subject: [PATCH] Use default --- .../ServerResource/Pages/EditServer.php | 142 ------------------ 1 file changed, 142 deletions(-) diff --git a/app/Filament/Resources/ServerResource/Pages/EditServer.php b/app/Filament/Resources/ServerResource/Pages/EditServer.php index fca1df519..af104ef17 100644 --- a/app/Filament/Resources/ServerResource/Pages/EditServer.php +++ b/app/Filament/Resources/ServerResource/Pages/EditServer.php @@ -18,146 +18,4 @@ class EditServer extends EditRecord Actions\DeleteAction::make(), ]; } - - public function form(Forms\Form $form): Forms\Form - { - return $form - ->columns(6) - ->schema([ - Forms\Components\TextInput::make('name') - ->label('Display Name') - ->columnSpan(4) - ->required() - ->maxLength(191), - - Forms\Components\Select::make('owner_id') - ->label('Owner') - ->columnSpan(2) - ->relationship('user', 'username') - ->searchable() - ->preload() - ->required(), - - Forms\Components\Select::make('allocation_id') - ->columnSpan(2) - ->label('Primary Allocation') - ->relationship('allocation', 'port') - ->getOptionLabelFromRecordUsing(fn (Allocation $allocation) => - "$allocation->ip:$allocation->port" . - ($allocation->ip_alias ? " ($allocation->ip_alias)" : '') - ) - ->searchable(['ip', 'port', 'ip_alias']) - ->required(), - - Forms\Components\Textarea::make('description') - ->hidden() - ->default('') - ->required() - ->columnSpanFull(), - - Forms\Components\TextInput::make('memory') - ->label('Allocated Memory') - ->suffix('MB') - ->required() - ->numeric(), - Forms\Components\TextInput::make('swap') - ->label('Allocated Swap') - ->suffix('MB') - ->required() - ->numeric(), - - Forms\Components\TextInput::make('disk') - ->label('Disk Space Limit') - ->suffix('MB') - ->required() - ->numeric(), - - Forms\Components\TextInput::make('io') - ->columnSpan(2) - ->label('Block IO Proportion') - ->hint('Advanced') - ->hintColor('danger') - ->required() - ->minValue(10) - ->maxValue(1000) - ->step(10) - ->default(500) - ->numeric(), - - Forms\Components\TextInput::make('cpu') - ->columnSpan(1) - ->label('CPU Limit') - ->suffix('%') - ->required() - ->numeric(), - - Forms\Components\TextInput::make('threads') - ->hidden() - ->columnSpan(2) - ->hint('Advanced') - ->hintColor('danger') - ->helperText('Examples: 0, 0-1,3, or 0,1,3,4') - ->label('CPU Pinning') - ->suffixIcon('tabler-cpu') - ->maxLength(191), - - Forms\Components\ToggleButtons::make('skip_scripts') - ->label('Run Egg Install Script?') - ->columnSpan(1) - ->options([ - false => 'Yes', - true => 'Skip', - ]) - ->colors([ - false => 'primary', - true => 'danger', - ]) - ->inline() - ->required(), - - Forms\Components\ToggleButtons::make('oom_disabled') - ->columnSpan(2) - ->label('OOM Killer') - ->inline() - ->options([ - false => 'Disabled', - true => 'Enabled', - ]) - ->colors([ - false => 'success', - true => 'danger', - ]) - ->required(), - - Forms\Components\Textarea::make('startup') - ->required() - ->rows(4) - ->columnSpanFull(), - - Forms\Components\TextInput::make('image') - ->label('Docker Image') - ->columnSpan(2) - ->required(), - - Forms\Components\TextInput::make('allocation_limit') - ->label('Allocation Limit') - ->numeric(), - - Forms\Components\TextInput::make('database_limit') - ->label('Database Limit') - ->numeric() - ->default(0), - - Forms\Components\TextInput::make('backup_limit') - ->label('Backup Limit') - ->required() - ->numeric() - ->default(0), - - Forms\Components\TextInput::make('external_id') - ->maxLength(191) - ->hidden(), - - ]); - } }