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

This commit is contained in:
peaklabs-dev
2024-09-17 14:33:24 +02:00
parent 845d32c94c
commit bdc0fc87f0
2 changed files with 6 additions and 12 deletions

View File

@@ -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());
}
}