Fix: ClamAV enable mit --no-block + kein Queue-Job nötig
systemctl start --no-block kehrt sofort zurück, systemd startet ClamAV
im Hintergrund. runCmd('enable') direkt aufrufen statt Queue-Job.
wire:poll.keep-alive verhindert payload-Fehler in der Browser-Console.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
v1.1.338
parent
3f6f787fd3
commit
5f627dcb0e
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace App\Livewire\Ui\Security;
|
namespace App\Livewire\Ui\Security;
|
||||||
|
|
||||||
use App\Jobs\ClamavEnable;
|
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Attributes\Title;
|
use Livewire\Attributes\Title;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
@ -77,8 +76,12 @@ class ClamavManager extends Component
|
||||||
{
|
{
|
||||||
$this->lastError = '';
|
$this->lastError = '';
|
||||||
$this->lastSuccess = '';
|
$this->lastSuccess = '';
|
||||||
|
[$ok, $msg] = $this->runCmd('enable');
|
||||||
|
if (!$ok) {
|
||||||
|
$this->lastError = $msg;
|
||||||
|
return;
|
||||||
|
}
|
||||||
file_put_contents(self::STARTING_FLAG, time());
|
file_put_contents(self::STARTING_FLAG, time());
|
||||||
ClamavEnable::dispatch();
|
|
||||||
$this->enabled = true;
|
$this->enabled = true;
|
||||||
$this->starting = true;
|
$this->starting = true;
|
||||||
$this->startSecs = 0;
|
$this->startSecs = 0;
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
<div style="display:flex;gap:8px;align-items:center">
|
<div style="display:flex;gap:8px;align-items:center">
|
||||||
@if($starting)
|
@if($starting)
|
||||||
<div wire:poll.3s="pollStatus" style="display:flex;align-items:center;gap:8px;padding:6px 12px;background:rgba(167,139,250,.08);border:1px solid rgba(167,139,250,.25);border-radius:8px">
|
<div wire:poll.3s.keep-alive="pollStatus" style="display:flex;align-items:center;gap:8px;padding:6px 12px;background:rgba(167,139,250,.08);border:1px solid rgba(167,139,250,.25);border-radius:8px">
|
||||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" style="color:#a78bfa;animation:spin 1s linear infinite;flex-shrink:0"><path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
|
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" style="color:#a78bfa;animation:spin 1s linear infinite;flex-shrink:0"><path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
|
||||||
<span style="font-size:12px;color:#c4b5fd;font-weight:500">Wird gestartet…</span>
|
<span style="font-size:12px;color:#c4b5fd;font-weight:500">Wird gestartet…</span>
|
||||||
<span style="font-size:11px;color:rgba(196,181,253,.5)">{{ $startSecs }}s</span>
|
<span style="font-size:11px;color:rgba(196,181,253,.5)">{{ $startSecs }}s</span>
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ case "$CMD" in
|
||||||
;;
|
;;
|
||||||
enable)
|
enable)
|
||||||
systemctl enable clamav-daemon
|
systemctl enable clamav-daemon
|
||||||
systemctl start clamav-daemon
|
systemctl start --no-block clamav-daemon
|
||||||
echo "ClamAV aktiviert und gestartet."
|
echo "ClamAV aktiviert, Startvorgang eingeleitet."
|
||||||
;;
|
;;
|
||||||
disable)
|
disable)
|
||||||
systemctl stop clamav-daemon || true
|
systemctl stop clamav-daemon || true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue