Fix: Updates-Seite — Prüfung synchron, Log-Abstände, Checkbox-Stil

- checkForUpdates() läuft jetzt synchron (nicht im Hintergrund), damit
  das Ergebnis sofort angezeigt wird ohne Seite neu laden zu müssen
- Log-Viewer: white-space:pre-wrap + <br> entfernt durch display:block
  pro Span — kein doppelter Zeilenabstand mehr
- Auto-Scroll Checkbox nutzt jetzt mw-modal-check Klassen (passend zum Design)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main v1.1.140
boban 2026-04-23 01:55:41 +02:00
parent 2049057f7f
commit 291f13c034
2 changed files with 18 additions and 17 deletions

View File

@ -61,16 +61,21 @@ class UpdatePage extends Component
public function checkForUpdates(): void public function checkForUpdates(): void
{ {
@shell_exec('nohup php /var/www/mailwolt/artisan mailwolt:check-updates >/dev/null 2>&1 &'); @shell_exec('php ' . base_path('artisan') . ' mailwolt:check-updates 2>&1');
// Give the process a tiny head-start, then reload versions
usleep(500_000);
$this->reloadVersionsAndStatus(); $this->reloadVersionsAndStatus();
$this->recompute(); $this->recompute();
$this->dispatch('toast', type: 'done', badge: 'Updates', if ($this->hasUpdate) {
title: 'Prüfung gestartet', $this->dispatch('toast', type: 'done', badge: 'Updates',
text: 'Update-Prüfung läuft im Hintergrund. Bitte in einigen Sekunden neu laden.', title: 'Update verfügbar',
duration: 4000); 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 public function runUpdate(): void

View File

@ -162,9 +162,9 @@
<span class="mbx-badge-mute">Update-Log</span> <span class="mbx-badge-mute">Update-Log</span>
</div> </div>
<div style="display:flex;align-items:center;gap:8px"> <div style="display:flex;align-items:center;gap:8px">
<label style="display:flex;align-items:center;gap:5px;font-size:11.5px;color:var(--mw-t4);cursor:pointer"> <label class="mw-modal-check" style="font-size:11.5px">
<input type="checkbox" x-model="autoScroll" style="accent-color:var(--mw-v2)"> <input type="checkbox" x-model="autoScroll">
Auto-Scroll <span class="mw-modal-check-label" style="font-size:11.5px;color:var(--mw-t4)">Auto-Scroll</span>
</label> </label>
<button wire:click="clearLog" <button wire:click="clearLog"
wire:loading.attr="disabled" wire:loading.attr="disabled"
@ -178,12 +178,11 @@
</div> </div>
<div style="padding:12px 14px"> <div style="padding:12px 14px">
<div x-ref="logBox" <div x-ref="logBox"
style="background:var(--mw-bg3);border:1px solid var(--mw-b2);border-radius:7px;padding:12px 14px;max-height:400px;overflow-y:auto;font-family:monospace;font-size:11.5px;color:var(--mw-t3);line-height:1.6;white-space:pre-wrap;word-break:break-all"> style="background:var(--mw-bg3);border:1px solid var(--mw-b2);border-radius:7px;padding:12px 14px;max-height:400px;overflow-y:auto;font-family:monospace;font-size:11.5px;color:var(--mw-t3);line-height:1.55">
@if(count($logLines) === 0) @if(count($logLines) === 0)
<span style="color:var(--mw-t5);font-style:italic">Keine Log-Einträge vorhanden.</span> <span style="color:var(--mw-t5);font-style:italic">Keine Log-Einträge vorhanden.</span>
@else @else
@foreach($logLines as $line) @foreach($logLines as $line)@php
@php
$color = 'inherit'; $color = 'inherit';
if (str_contains($line, '[!]') || str_contains($line, 'error') || str_contains($line, 'Error') || str_contains($line, 'fehlgeschlagen')) { if (str_contains($line, '[!]') || str_contains($line, 'error') || str_contains($line, 'Error') || str_contains($line, 'fehlgeschlagen')) {
$color = '#f87171'; $color = '#f87171';
@ -194,10 +193,7 @@
} elseif (str_contains($line, '=====')) { } elseif (str_contains($line, '=====')) {
$color = 'rgba(14,165,233,.8)'; $color = 'rgba(14,165,233,.8)';
} }
@endphp @endphp<span style="display:block;color:{{ $color }}">{{ $line }}</span>@endforeach
<span style="color:{{ $color }}">{{ $line }}</span>
<br>
@endforeach
@endif @endif
</div> </div>
<div style="margin-top:6px;font-size:11px;color:var(--mw-t5)"> <div style="margin-top:6px;font-size:11px;color:var(--mw-t5)">