mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 15:36:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Filament\Resources\DatabaseResource\Pages;
 | 
						|
 | 
						|
use App\Filament\Resources\DatabaseResource;
 | 
						|
use Filament\Actions;
 | 
						|
use Filament\Forms\Form;
 | 
						|
use Filament\Resources\Pages\EditRecord;
 | 
						|
use Filament\Forms;
 | 
						|
 | 
						|
class EditDatabase extends EditRecord
 | 
						|
{
 | 
						|
    protected static string $resource = DatabaseResource::class;
 | 
						|
 | 
						|
    public function form(Form $form): Form
 | 
						|
    {
 | 
						|
        return $form
 | 
						|
            ->schema([
 | 
						|
                Forms\Components\Select::make('server_id')
 | 
						|
                    ->relationship('server', 'name')
 | 
						|
                    ->searchable()
 | 
						|
                    ->preload()
 | 
						|
                    ->required(),
 | 
						|
                Forms\Components\TextInput::make('database_host_id')
 | 
						|
                    ->required()
 | 
						|
                    ->numeric(),
 | 
						|
                Forms\Components\TextInput::make('database')
 | 
						|
                    ->required()
 | 
						|
                    ->maxLength(191),
 | 
						|
                Forms\Components\TextInput::make('remote')
 | 
						|
                    ->required()
 | 
						|
                    ->maxLength(191)
 | 
						|
                    ->default('%'),
 | 
						|
                Forms\Components\TextInput::make('username')
 | 
						|
                    ->required()
 | 
						|
                    ->maxLength(191),
 | 
						|
                Forms\Components\TextInput::make('password')
 | 
						|
                    ->password()
 | 
						|
                    ->revealable()
 | 
						|
                    ->required(),
 | 
						|
                Forms\Components\TextInput::make('max_connections')
 | 
						|
                    ->numeric()
 | 
						|
                    ->minValue(0)
 | 
						|
                    ->default(0),
 | 
						|
            ]);
 | 
						|
    }
 | 
						|
 | 
						|
    protected function getHeaderActions(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            Actions\DeleteAction::make(),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |