diff --git a/app/Livewire/Server/ShowPrivateKey.php b/app/Livewire/Server/ShowPrivateKey.php index d5e20702d..8e9b59157 100644 --- a/app/Livewire/Server/ShowPrivateKey.php +++ b/app/Livewire/Server/ShowPrivateKey.php @@ -18,18 +18,11 @@ class ShowPrivateKey extends Component { try { $privateKey = PrivateKey::findOrFail($privateKeyId); - $this->server->update(['private_key_id' => $privateKeyId]); - $privateKey->storeInFileSystem(); - - $this->dispatch('notify', [ - 'type' => 'success', - 'message' => 'Private key updated and stored in the file system.', - ]); + $this->server->update(['private_key_id' => $privateKey->id]); + $this->server->refresh(); + $this->dispatch('success', 'Private key updated successfully.'); } catch (\Exception $e) { - $this->dispatch('notify', [ - 'type' => 'error', - 'message' => 'Failed to update private key: ' . $e->getMessage(), - ]); + $this->dispatch('error', 'Failed to update private key: ' . $e->getMessage()); } } diff --git a/resources/views/livewire/server/show-private-key.blade.php b/resources/views/livewire/server/show-private-key.blade.php index 62b1c4614..86bf2568e 100644 --- a/resources/views/livewire/server/show-private-key.blade.php +++ b/resources/views/livewire/server/show-private-key.blade.php @@ -26,7 +26,8 @@

Choose another Key

@forelse ($privateKeys as $private_key) -
+
{{ $private_key->name }}
{{ $private_key->description }}