feat: Update Proxmox extension with various improvements and bug fixes
- Change listStates method to accept nullable integer for limit parameter. - Modify TechnitiumDns class to return structured error messages on failure. - Enhance VNC and xterm popup routes with user authorization checks. - Update backups view to improve loading states and add unique keys for dynamic elements. - Refactor cloud-init view to ensure proper data binding and improve user experience. - Add wire:key attributes to various elements in views for better Livewire performance. - Improve error handling and user feedback in the firewall view. - Update server overview and statistics views to handle potential null values gracefully. - Add new migration files to extend database schema with user-set icons and notes for Proxmox nodes.
This commit is contained in:
@@ -51,7 +51,7 @@ class Overview extends Component
|
||||
// Load notes from Proxmox VM description
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'];
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$this->notes = $config['description'] ?? '';
|
||||
} catch (\Exception $e) {
|
||||
$this->notes = '';
|
||||
@@ -60,9 +60,9 @@ class Overview extends Component
|
||||
|
||||
public function checkStatus()
|
||||
{
|
||||
$currentStatus = $this->status->status;
|
||||
$currentStatus = $this->status?->status;
|
||||
$this->loadVmStatus();
|
||||
if ($this->status->status != $currentStatus) {
|
||||
if ($this->status?->status != $currentStatus) {
|
||||
$this->fastPolling = false;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class Overview extends Component
|
||||
'cf' => $aggregation === 'maximum' ? 'MAX' : 'AVERAGE',
|
||||
]);
|
||||
|
||||
return $stats->json()['data'];
|
||||
return $stats->json()['data'] ?? [];
|
||||
});
|
||||
|
||||
$this->dispatch('proxmox:stats:' . $this->server->id . ':' . $graphType, $data);
|
||||
@@ -371,7 +371,7 @@ class Overview extends Component
|
||||
$this->hostnameError = '';
|
||||
|
||||
// Refresh status to get updated name
|
||||
$this->status = (object) $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/status/current')->json()['data'];
|
||||
$this->status = (object) ($proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/status/current')->json()['data'] ?? []);
|
||||
} catch (\Exception $e) {
|
||||
$this->hostnameError = 'Failed to apply hostname: ' . $e->getMessage();
|
||||
$this->notify('Failed to apply hostname to Proxmox', 'error');
|
||||
@@ -495,7 +495,7 @@ class Overview extends Component
|
||||
// Reload notes from Proxmox
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'];
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$this->notes = $config['description'] ?? '';
|
||||
} catch (\Exception $e) {
|
||||
$this->notes = '';
|
||||
|
||||
Reference in New Issue
Block a user