diff --git a/extensions/Servers/Proxmox/Livewire/Overview.php b/extensions/Servers/Proxmox/Livewire/Overview.php index a31faf9ab..8460a938a 100644 --- a/extensions/Servers/Proxmox/Livewire/Overview.php +++ b/extensions/Servers/Proxmox/Livewire/Overview.php @@ -43,7 +43,11 @@ class Overview extends Component parent::mount($server); if (is_null($this->status)) { - $this->loadVmStatus(); + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: Failed to load VM status', ['error' => $e->getMessage()]); + } } $this->hostname = $server->hostname ?? ($this->status->name ?? ''); @@ -60,9 +64,24 @@ class Overview extends Component public function checkStatus() { - $currentStatus = $this->status->status; - $this->loadVmStatus(); - if ($this->status->status != $currentStatus) { + if (!$this->status) { + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: checkStatus failed', ['error' => $e->getMessage()]); + } + return; + } + + $currentStatus = $this->status->status ?? null; + try { + $this->loadVmStatus(); + } catch (\Throwable $e) { + \Log::error('Overview: checkStatus loadVmStatus failed', ['error' => $e->getMessage()]); + return; + } + + if ($this->status && ($this->status->status ?? null) != $currentStatus) { $this->fastPolling = false; } } diff --git a/extensions/Servers/Proxmox/views/overview.blade.php b/extensions/Servers/Proxmox/views/overview.blade.php index c88f31bff..75f2fda26 100644 --- a/extensions/Servers/Proxmox/views/overview.blade.php +++ b/extensions/Servers/Proxmox/views/overview.blade.php @@ -5,6 +5,25 @@ :status-polling="true" :status-polling-interval="'2s'" > + @if(!$status) + {{-- Error state when status cannot be loaded --}} +
We couldn't retrieve the current status from the hypervisor. This may be due to:
+