mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-01 00:06:52 +01:00 
			
		
		
		
	Add restore to simplify form
This commit is contained in:
		
							parent
							
								
									d4484f5254
								
							
						
					
					
						commit
						48fd3cc84e
					
				| @ -461,6 +461,13 @@ class EditServer extends EditRecord | ||||
|                                 Forms\Components\Textarea::make('startup') | ||||
|                                     ->label('Startup Command') | ||||
|                                     ->required() | ||||
|                                     ->hintAction(Forms\Components\Actions\Action::make('startup-restore') | ||||
|                                         ->label('Restore Default') | ||||
|                                         ->icon('tabler-restore') | ||||
|                                         ->action(fn (Forms\Get $get, Forms\Set $set) => | ||||
|                                             $set('startup', Egg::find($get('egg_id'))?->startup ?? '') | ||||
|                                         ) | ||||
|                                     ) | ||||
|                                     ->columnSpan([ | ||||
|                                         'default' => 2, | ||||
|                                         'sm' => 4, | ||||
| @ -474,22 +481,6 @@ class EditServer extends EditRecord | ||||
|                                         ); | ||||
|                                     }), | ||||
| 
 | ||||
|                                 Forms\Components\Textarea::make('defaultStartup') | ||||
|                                     ->hintAction(CopyAction::make()) | ||||
|                                     ->label('Default Startup Command') | ||||
|                                     ->disabled() | ||||
|                                     ->formatStateUsing(function ($state, Forms\Get $get, Forms\Set $set) { | ||||
|                                         $egg = Egg::query()->find($get('egg_id')); | ||||
| 
 | ||||
|                                         return $egg->startup; | ||||
|                                     }) | ||||
|                                     ->columnSpan([ | ||||
|                                         'default' => 2, | ||||
|                                         'sm' => 4, | ||||
|                                         'md' => 4, | ||||
|                                         'lg' => 6, | ||||
|                                     ]), | ||||
| 
 | ||||
|                                 Forms\Components\Repeater::make('server_variables') | ||||
|                                     ->relationship('serverVariables') | ||||
|                                     ->grid() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lance Pioch
						Lance Pioch