feat: add modal support for creating private keys in server creation form and enhance UI for private key selection

This commit is contained in:
Andras Bacsai committed 2025-10-10 15:53:17 +02:00
1 parent b28875c612
commit 3c74620f36
4 files changed
+65 -22

No files matched your search

+13
View File
@@ -72,6 +72,7 @@ class ByHetzner extends Component
{
return [
'tokenAdded' => 'handleTokenAdded',
'privateKeyCreated' => 'handlePrivateKeyCreated',
'modalClosed' => 'resetSelection',
];
}
@@ -101,6 +102,18 @@ class ByHetzner extends Component
$this->nextStep();
}
public function handlePrivateKeyCreated($keyId)
{
// Refresh private keys list
$this->private_keys = PrivateKey::ownedByCurrentTeam()->get();
// Auto-select the new key
$this->private_key_id = $keyId;
// Clear validation errors for private_key_id
$this->resetErrorBag('private_key_id');
}
protected function rules(): array
{
$rules = [