From fd8d81fecb263a61cb226e1f9e1455f3904519c1 Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 26 Apr 2026 22:41:37 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Update-Modal=20=C3=B6ffnet=20immer=20nac?= =?UTF-8?q?h=20Update=20+=20optimize=20nach=20Post-Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Ui/System/UpdateCard.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Livewire/Ui/System/UpdateCard.php b/app/Livewire/Ui/System/UpdateCard.php index ba479ea..7951932 100644 --- a/app/Livewire/Ui/System/UpdateCard.php +++ b/app/Livewire/Ui/System/UpdateCard.php @@ -49,7 +49,8 @@ class UpdateCard extends Component $this->recompute(); $this->progressLine = ''; - if ($this->running) { + if ($this->running || $this->lowState === 'done') { + // Update läuft oder abgeschlossen aber Post-Actions noch nicht ausgeführt $this->state = 'running'; $this->dispatch('openModal', component: 'ui.system.modal.update-modal'); } @@ -128,18 +129,19 @@ class UpdateCard extends Component if ($this->rc === 0 && !$this->postActionsDone) { @shell_exec('nohup php /var/www/mailwolt/artisan optimize:clear >/dev/null 2>&1 &'); + @shell_exec('nohup php /var/www/mailwolt/artisan optimize >/dev/null 2>&1 &'); @shell_exec('nohup php /var/www/mailwolt/artisan health:collect >/dev/null 2>&1 &'); @shell_exec('nohup php /var/www/mailwolt/artisan settings:sync >/dev/null 2>&1 &'); @shell_exec('nohup php /var/www/mailwolt/artisan spamav:collect >/dev/null 2>&1 &'); @shell_exec('nohup php /var/www/mailwolt/artisan rbl:probe --force >/dev/null 2>&1 &'); $this->postActionsDone = true; + @file_put_contents('/var/lib/mailwolt/update/state', 'complete'); $ver = $this->displayCurrent ?? 'aktuelle Version'; $this->progressLine = 'Update abgeschlossen: ' . $ver; - // Optional: NICHT sofort reloaden – Nutzer entscheidet - // $this->dispatch('reload-page', delay: 6000); } elseif ($this->rc !== null && $this->rc !== 0 && !$this->postActionsDone) { $this->postActionsDone = true; + @file_put_contents('/var/lib/mailwolt/update/state', 'complete'); $this->errorLine = "Update fehlgeschlagen (rc={$this->rc})."; $this->dispatch('toast', type:'error', title:'Update fehlgeschlagen', text:$this->progressLine ?: 'Bitte Logs prüfen: /var/log/mailwolt-update.log', @@ -324,8 +326,8 @@ class UpdateCard extends Component $this->running = ($this->lowState === 'running'); - // rc erst freigeben wenn wirklich 'done' — verhindert Lesen von alten rc-Dateien - $this->rc = ($this->lowState === 'done' && is_numeric($rcRaw)) ? (int)$rcRaw : null; + // rc freigeben wenn 'done' (Post-Actions ausstehend) oder 'complete' (bereits gelaufen) + $this->rc = (in_array($this->lowState, ['done', 'complete']) && is_numeric($rcRaw)) ? (int)$rcRaw : null; $this->progressLine = $this->tailUpdateLog(); }