diff --git a/extensions/Servers/Proxmox/Livewire/Component.php b/extensions/Servers/Proxmox/Livewire/Component.php index 366e14f45..32997a9c1 100644 --- a/extensions/Servers/Proxmox/Livewire/Component.php +++ b/extensions/Servers/Proxmox/Livewire/Component.php @@ -24,14 +24,6 @@ class Component extends BaseComponent */ public bool $fastPolling = false; - /** - * Server icon customization properties - */ - public bool $showIconModal = false; - public string $selectedIcon = ''; - public string $selectedIconColor = ''; - public string $iconSearchQuery = ''; // Legacy property for stale sessions - /** * Mount the component with the server. */ @@ -45,59 +37,6 @@ class Component extends BaseComponent $this->loadVmStatus(); } - /** - * Open the icon customization modal. - */ - public function openIconModal(): void - { - // Load current icon settings - $this->selectedIcon = $this->server->user_set_icon ?? ''; - $this->selectedIconColor = $this->server->user_set_icon_color ?? ''; - $this->showIconModal = true; - } - - /** - * Close the icon customization modal. - */ - public function closeIconModal(): void - { - $this->showIconModal = false; - } - - /** - * Save the selected icon and color. - */ - public function saveIcon(string $icon, string $color): void - { - $this->server->update([ - 'user_set_icon' => $icon ?: null, - 'user_set_icon_color' => $color ?: null, - ]); - - $this->selectedIcon = $icon; - $this->selectedIconColor = $color; - $this->showIconModal = false; - - $this->notify('Server icon updated successfully', 'success'); - } - - /** - * Reset the server icon to default. - */ - public function resetIcon(): void - { - $this->server->update([ - 'user_set_icon' => null, - 'user_set_icon_color' => null, - ]); - - $this->selectedIcon = ''; - $this->selectedIconColor = ''; - $this->showIconModal = false; - - $this->notify('Server icon reset to default', 'success'); - } - /** * Perform a VM lifecycle action (start/stop/etc). */ diff --git a/extensions/Servers/Proxmox/Livewire/Overview.php b/extensions/Servers/Proxmox/Livewire/Overview.php index a31faf9ab..ab6a3e9f0 100644 --- a/extensions/Servers/Proxmox/Livewire/Overview.php +++ b/extensions/Servers/Proxmox/Livewire/Overview.php @@ -22,6 +22,12 @@ class Overview extends Component public $isEditingPassword = false; public $passwordError = ''; + // Icon customization properties + public bool $showIconModal = false; + public string $selectedIcon = ''; + public string $selectedIconColor = '#3b82f6'; + public string $iconSearchQuery = ''; + public string $cpuTimeRange = 'hour'; public string $cpuAggregation = 'average'; @@ -521,6 +527,44 @@ class Overview extends Component } } + // Icon customization methods + public function openIconModal() + { + $this->selectedIcon = $this->server->user_set_icon ?? ''; + $this->selectedIconColor = $this->server->user_set_icon_color ?? '#3b82f6'; + $this->iconSearchQuery = ''; + $this->showIconModal = true; + } + + public function closeIconModal() + { + $this->showIconModal = false; + } + + public function saveIcon($icon = null, $color = null) + { + $this->server->update([ + 'user_set_icon' => $icon ?: null, + 'user_set_icon_color' => $color ?: null, + ]); + + $this->showIconModal = false; + $this->notify('Icon saved successfully', 'success'); + } + + public function resetIcon() + { + $this->server->update([ + 'user_set_icon' => null, + 'user_set_icon_color' => null, + ]); + + $this->selectedIcon = ''; + $this->selectedIconColor = '#3b82f6'; + $this->showIconModal = false; + $this->notify('Icon reset to default', 'success'); + } + public function render() { return view('proxmox::overview')->layoutData([ diff --git a/extensions/Servers/Proxmox/views/components/layout.blade.php b/extensions/Servers/Proxmox/views/components/layout.blade.php index 80816a954..17f92149f 100644 --- a/extensions/Servers/Proxmox/views/components/layout.blade.php +++ b/extensions/Servers/Proxmox/views/components/layout.blade.php @@ -48,6 +48,7 @@