diff --git a/app/Livewire/Boarding/Index.php b/app/Livewire/Boarding/Index.php index ac2b9213b..7912c4b85 100644 --- a/app/Livewire/Boarding/Index.php +++ b/app/Livewire/Boarding/Index.php @@ -107,7 +107,7 @@ public function mount() if ($this->selectedServerType === 'remote') { if ($this->privateKeys->isEmpty()) { - $this->privateKeys = PrivateKey::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get(); + $this->privateKeys = PrivateKey::ownedAndOnlySShKeys(['name'])->where('id', '!=', 0)->get(); } if ($this->servers->isEmpty()) { $this->servers = Server::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get(); @@ -186,7 +186,7 @@ public function setServerType(string $type) return $this->validateServer('localhost'); } elseif ($this->selectedServerType === 'remote') { - $this->privateKeys = PrivateKey::ownedByCurrentTeam(['name'])->where('id', '!=', 0)->get(); + $this->privateKeys = PrivateKey::ownedAndOnlySShKeys(['name'])->where('id', '!=', 0)->get(); // Auto-select first key if available for better UX if ($this->privateKeys->count() > 0) { $this->selectedExistingPrivateKey = $this->privateKeys->first()->id; diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php index c5cbc6338..46531ed34 100644 --- a/app/Models/PrivateKey.php +++ b/app/Models/PrivateKey.php @@ -88,6 +88,16 @@ public static function ownedByCurrentTeam(array $select = ['*']) return self::whereTeamId($teamId)->select($selectArray->all()); } + public static function ownedAndOnlySShKeys(array $select = ['*']) + { + $teamId = currentTeam()->id; + $selectArray = collect($select)->concat(['id']); + + return self::whereTeamId($teamId) + ->where('is_git_related', false) + ->select($selectArray->all()); + } + public static function validatePrivateKey($privateKey) { try { diff --git a/resources/views/components/forms/datalist.blade.php b/resources/views/components/forms/datalist.blade.php index 5bb12aa8d..79a14d16f 100644 --- a/resources/views/components/forms/datalist.blade.php +++ b/resources/views/components/forms/datalist.blade.php @@ -14,14 +14,156 @@ @if ($multiple) {{-- Multiple Selection Mode with Alpine.js --}}
+ + {{-- Unified Input Container with Tags Inside --}} +
+ + {{-- Selected Tags Inside Input --}} + + + {{-- Search Input (Borderless, Inside Container) --}} + +
+ + {{-- Dropdown Options --}} +
+ + + + +
+ + {{-- Hidden datalist for options --}} + + {{ $slot }} + +
+ @else + {{-- Single Selection Mode with Alpine.js --}} +
- {{-- Unified Input Container with Tags Inside --}} -
+ + {{-- Input Container --}} +
+ }" wire:loading.class="opacity-50" wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4"> - {{-- Selected Tags Inside Input --}} - +
- {{-- Search Input (Borderless, Inside Container) --}} - + + + + +
+ + {{-- Hidden datalist for options --}} + + {{ $slot }} + +
@endif - class="flex-1 min-w-[120px] text-sm border-0 outline-none bg-transparent p-0 focus:ring-0 placeholder:text-neutral-400 dark:placeholder:text-neutral-600 text-black dark:text-white" - /> - -{{-- Dropdown Options --}} -
- - - - -
- -{{-- Hidden datalist for options --}} - - {{ $slot }} - - -@else -{{-- Single Selection Mode with Alpine.js --}} -
- - {{-- Hidden input for form validation --}} - - - {{-- Input Container --}} -
- - {{-- Display Selected Value or Search Input --}} -
- - -
- - {{-- Dropdown Arrow --}} - -
- - {{-- Dropdown Options --}} -
- - - - -
- - {{-- Hidden datalist for options --}} - - {{ $slot }} - -
-@endif - -@error($modelBinding) - -@enderror - + @error($modelBinding) + + @enderror + \ No newline at end of file