Fix: Update-Modal öffnet immer nach Update + optimize nach Post-Actions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main v1.1.355
boban 2026-04-26 22:41:37 +02:00
parent fcbe944e32
commit fd8d81fecb
1 changed files with 7 additions and 5 deletions

View File

@ -49,7 +49,8 @@ class UpdateCard extends Component
$this->recompute(); $this->recompute();
$this->progressLine = ''; $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->state = 'running';
$this->dispatch('openModal', component: 'ui.system.modal.update-modal'); $this->dispatch('openModal', component: 'ui.system.modal.update-modal');
} }
@ -128,18 +129,19 @@ class UpdateCard extends Component
if ($this->rc === 0 && !$this->postActionsDone) { 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: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 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 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 spamav:collect >/dev/null 2>&1 &');
@shell_exec('nohup php /var/www/mailwolt/artisan rbl:probe --force >/dev/null 2>&1 &'); @shell_exec('nohup php /var/www/mailwolt/artisan rbl:probe --force >/dev/null 2>&1 &');
$this->postActionsDone = true; $this->postActionsDone = true;
@file_put_contents('/var/lib/mailwolt/update/state', 'complete');
$ver = $this->displayCurrent ?? 'aktuelle Version'; $ver = $this->displayCurrent ?? 'aktuelle Version';
$this->progressLine = 'Update abgeschlossen: ' . $ver; $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) { } elseif ($this->rc !== null && $this->rc !== 0 && !$this->postActionsDone) {
$this->postActionsDone = true; $this->postActionsDone = true;
@file_put_contents('/var/lib/mailwolt/update/state', 'complete');
$this->errorLine = "Update fehlgeschlagen (rc={$this->rc})."; $this->errorLine = "Update fehlgeschlagen (rc={$this->rc}).";
$this->dispatch('toast', type:'error', title:'Update fehlgeschlagen', $this->dispatch('toast', type:'error', title:'Update fehlgeschlagen',
text:$this->progressLine ?: 'Bitte Logs prüfen: /var/log/mailwolt-update.log', 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'); $this->running = ($this->lowState === 'running');
// rc erst freigeben wenn wirklich 'done' — verhindert Lesen von alten rc-Dateien // rc freigeben wenn 'done' (Post-Actions ausstehend) oder 'complete' (bereits gelaufen)
$this->rc = ($this->lowState === 'done' && is_numeric($rcRaw)) ? (int)$rcRaw : null; $this->rc = (in_array($this->lowState, ['done', 'complete']) && is_numeric($rcRaw)) ? (int)$rcRaw : null;
$this->progressLine = $this->tailUpdateLog(); $this->progressLine = $this->tailUpdateLog();
} }