Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix: UI bug, do not write ssh key to disk in server dialog

peaklabs-devbdc0fc87f0e5
diff --git a/app/Livewire/Server/ShowPrivateKey.php b/app/Livewire/Server/ShowPrivateKey.php
index d5e20702d0..8e9b591572 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 62b1c4614a..86bf2568eb 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 @@
<h3 class="pb-4">Choose another Key</h3>
<div class="grid grid-cols-3 gap-2">
@forelse ($privateKeys as $private_key)
- <div class="box group" wire:click='setPrivateKey({{ $private_key->id }})'>
+ <div class="box group cursor-pointer"
+ wire:click='setPrivateKey({{ $private_key->id }})'>
<div class="flex flex-col ">
<div class="box-title">{{ $private_key->name }}</div>
<div class="box-description">{{ $private_key->description }}</div>