diff --git a/app/Livewire/Ui/System/UpdatePage.php b/app/Livewire/Ui/System/UpdatePage.php index 3504957..c85b172 100644 --- a/app/Livewire/Ui/System/UpdatePage.php +++ b/app/Livewire/Ui/System/UpdatePage.php @@ -61,16 +61,21 @@ class UpdatePage extends Component public function checkForUpdates(): void { - @shell_exec('nohup php /var/www/mailwolt/artisan mailwolt:check-updates >/dev/null 2>&1 &'); - // Give the process a tiny head-start, then reload versions - usleep(500_000); + @shell_exec('php ' . base_path('artisan') . ' mailwolt:check-updates 2>&1'); $this->reloadVersionsAndStatus(); $this->recompute(); - $this->dispatch('toast', type: 'done', badge: 'Updates', - title: 'Prüfung gestartet', - text: 'Update-Prüfung läuft im Hintergrund. Bitte in einigen Sekunden neu laden.', - duration: 4000); + if ($this->hasUpdate) { + $this->dispatch('toast', type: 'done', badge: 'Updates', + title: 'Update verfügbar', + text: "Version {$this->displayLatest} ist verfügbar.", + duration: 4000); + } else { + $this->dispatch('toast', type: 'done', badge: 'Updates', + title: 'Alles aktuell', + text: 'Es sind keine Updates verfügbar.', + duration: 3000); + } } public function runUpdate(): void diff --git a/resources/views/livewire/ui/system/update-page.blade.php b/resources/views/livewire/ui/system/update-page.blade.php index 38acbe0..93c883d 100644 --- a/resources/views/livewire/ui/system/update-page.blade.php +++ b/resources/views/livewire/ui/system/update-page.blade.php @@ -162,9 +162,9 @@ Update-Log
-