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
2025-10-10 15:53:17 +02:00
parent b28875c612
commit 3c74620f36
4 changed files with 65 additions and 22 deletions

View File

@@ -21,6 +21,8 @@ class Create extends Component
public ?string $publicKey = null;
public bool $modal_mode = false;
protected function rules(): array
{
return [
@@ -77,6 +79,14 @@ class Create extends Component
'team_id' => currentTeam()->id,
]);
// If in modal mode, dispatch event and don't redirect
if ($this->modal_mode) {
$this->dispatch('privateKeyCreated', keyId: $privateKey->id);
$this->dispatch('success', 'Private key created successfully.');
return;
}
return $this->redirectAfterCreation($privateKey);
} catch (\Throwable $e) {
return handleError($e, $this);