diff --git a/app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php b/app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php index f56957edc6..a64cd19c58 100644 --- a/app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php +++ b/app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php @@ -97,6 +97,37 @@ public function form(Form $form): Form ->required() ->maxLength(255), + TextInput::make('external_id') + ->label('External ID') + ->columnSpan([ + 'default' => 2, + 'sm' => 3, + 'md' => 3, + 'lg' => 3, + ]) + ->unique() + ->maxLength(255), + + Select::make('node_id') + ->disabledOn('edit') + ->prefixIcon('tabler-server-2') + ->default(fn () => ($this->node = Node::query()->latest()->first())?->id) + ->columnSpan([ + 'default' => 2, + 'sm' => 1, + 'md' => 2, + 'lg' => 3, + ]) + ->live() + ->relationship('node', 'name') + ->searchable() + ->preload() + ->afterStateUpdated(function (Set $set, $state) { + $set('allocation_id', null); + $this->node = Node::find($state); + }) + ->required(), + Select::make('owner_id') ->preload() ->prefixIcon('tabler-user') @@ -104,8 +135,8 @@ public function form(Form $form): Form ->label('Owner') ->columnSpan([ 'default' => 2, - 'sm' => 3, - 'md' => 3, + 'sm' => 1, + 'md' => 2, 'lg' => 3, ]) ->relationship('user', 'username') @@ -136,26 +167,6 @@ public function form(Form $form): Form }) ->required(), - Select::make('node_id') - ->disabledOn('edit') - ->prefixIcon('tabler-server-2') - ->default(fn () => ($this->node = Node::query()->latest()->first())?->id) - ->columnSpan([ - 'default' => 2, - 'sm' => 3, - 'md' => 6, - 'lg' => 6, - ]) - ->live() - ->relationship('node', 'name') - ->searchable() - ->preload() - ->afterStateUpdated(function (Set $set, $state) { - $set('allocation_id', null); - $this->node = Node::find($state); - }) - ->required(), - Select::make('allocation_id') ->preload() ->live() diff --git a/app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php b/app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php index 064fb8dfc7..1adc1a2d7b 100644 --- a/app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php +++ b/app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php @@ -161,6 +161,7 @@ public function form(Form $form): Form 'md' => 2, 'lg' => 3, ]) + ->unique() ->maxLength(255), Select::make('node_id') ->label('Node')