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 --}}