From 0beb12569b1b1757b79d43a517e9dce353dc9312 Mon Sep 17 00:00:00 2001 From: boban Date: Mon, 27 Apr 2026 06:11:41 +0200 Subject: [PATCH] =?UTF-8?q?Feat:=20Quarant=C3=A4ne-Verlauf=20leeren=20Butt?= =?UTF-8?q?on=20(RSpamd=20historyreset)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Ui/Nx/Mail/QuarantineList.php | 22 +++++++++++++++++++ .../ui/nx/mail/quarantine-list.blade.php | 10 +++++++++ 2 files changed, 32 insertions(+) diff --git a/app/Livewire/Ui/Nx/Mail/QuarantineList.php b/app/Livewire/Ui/Nx/Mail/QuarantineList.php index f827bfe..21c4fd3 100644 --- a/app/Livewire/Ui/Nx/Mail/QuarantineList.php +++ b/app/Livewire/Ui/Nx/Mail/QuarantineList.php @@ -29,6 +29,28 @@ class QuarantineList extends Component #[On('quarantine:updated')] public function refresh(): void {} + public function clearHistory(): void + { + $password = env('RSPAMD_PASSWORD', ''); + $opts = [ + 'http' => [ + 'method' => 'POST', + 'timeout' => 5, + 'ignore_errors' => true, + 'content' => '', + 'header' => "Content-Type: application/json\r\n" . + ($password !== '' ? "Password: {$password}\r\n" : ''), + ], + ]; + $ctx = stream_context_create($opts); + @file_get_contents('http://127.0.0.1:11334/historyreset', false, $ctx); + + $this->dispatch('toast', type: 'done', badge: 'Quarantäne', + title: 'Verlauf geleert', + text: 'RSpamd-History wurde zurückgesetzt.', + duration: 3000); + } + public function updatedFilter(): void { $this->resetPage(); } public function updatedSearch(): void { $this->resetPage(); } public function updatedPerPage(): void { $this->resetPage(); } diff --git a/resources/views/livewire/ui/nx/mail/quarantine-list.blade.php b/resources/views/livewire/ui/nx/mail/quarantine-list.blade.php index 076f595..a4afa65 100644 --- a/resources/views/livewire/ui/nx/mail/quarantine-list.blade.php +++ b/resources/views/livewire/ui/nx/mail/quarantine-list.blade.php @@ -20,6 +20,16 @@ + @if($counts['all'] > 0) + + @endif