From 2331ef74f618df0117a1ede8925ae6d387366d8f Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 26 Apr 2026 21:08:46 +0200 Subject: [PATCH] =?UTF-8?q?Feat:=20ClamAV=20Aktivieren=20mit=20Spinner=20+?= =?UTF-8?q?=20Sekundentimer=20bis=20ClamAV=20l=C3=A4uft?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wire:poll.3s prüft serviceActive() nach Klick. Zeigt laufenden Spinner mit Sekundenanzeige (0s, 3s, 6s…) bis ClamAV aktiv ist, dann Erfolgsmeldung. Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Ui/Security/ClamavManager.php | 23 ++++++++++++++++--- .../ui/security/clamav-manager.blade.php | 12 +++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/app/Livewire/Ui/Security/ClamavManager.php b/app/Livewire/Ui/Security/ClamavManager.php index 0197880..9733148 100644 --- a/app/Livewire/Ui/Security/ClamavManager.php +++ b/app/Livewire/Ui/Security/ClamavManager.php @@ -20,6 +20,8 @@ class ClamavManager extends Component public string $lastError = ''; public string $lastSuccess = ''; public bool $installing = false; + public bool $starting = false; + public int $startSecs = 0; public function mount(): void { @@ -54,11 +56,26 @@ class ClamavManager extends Component public function enable(): void { - $this->lastError = ''; + $this->lastError = ''; $this->lastSuccess = ''; ClamavEnable::dispatch(); - $this->enabled = true; - $this->lastSuccess = 'ClamAV wird gestartet… Dies kann bis zu 60 Sekunden dauern. Klicken Sie danach auf „Aktualisieren".'; + $this->enabled = true; + $this->starting = true; + $this->startSecs = 0; + } + + public function pollStatus(): void + { + if (!$this->starting) return; + $this->startSecs += 3; + $this->running = $this->serviceActive(); + if ($this->running) { + $this->starting = false; + $this->startSecs = 0; + $this->enabled = $this->serviceEnabled(); + $this->ramMb = $this->readRamMb(); + $this->lastSuccess = 'ClamAV ist aktiv und läuft.'; + } } public function disable(): void diff --git a/resources/views/livewire/ui/security/clamav-manager.blade.php b/resources/views/livewire/ui/security/clamav-manager.blade.php index df465dd..9d06ec4 100644 --- a/resources/views/livewire/ui/security/clamav-manager.blade.php +++ b/resources/views/livewire/ui/security/clamav-manager.blade.php @@ -90,8 +90,14 @@ @endif -
- @if($running) +
+ @if($starting) +
+ + Wird gestartet… + {{ $startSecs }}s +
+ @elseif($running) @endif