From ef601d0a8820d6b513c88aeb61e9c6f6d01b26e7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 30 Jan 2026 23:38:13 +0200 Subject: [PATCH] Fix WAF type column and improve URI display --- app/Filament/Admin/Pages/Waf.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/app/Filament/Admin/Pages/Waf.php b/app/Filament/Admin/Pages/Waf.php index a740f9a..0c74c3f 100644 --- a/app/Filament/Admin/Pages/Waf.php +++ b/app/Filament/Admin/Pages/Waf.php @@ -518,7 +518,7 @@ class Waf extends Page implements HasForms, HasTable TextColumn::make('event_type') ->label(__('Type')) ->badge() - ->formatStateUsing(function (array $record): string { + ->getStateUsing(function (array $record): string { if (!empty($record['blocked'])) { return __('Blocked'); } @@ -551,6 +551,32 @@ class Waf extends Page implements HasForms, HasTable ->searchable(), TextColumn::make('uri') ->label(__('URI')) + ->getStateUsing(function (array $record): string { + $host = (string) ($record['host'] ?? ''); + $uri = (string) ($record['uri'] ?? ''); + if ($host !== '' && $uri !== '') { + return $host.$uri; + } + return $uri !== '' ? $uri : $host; + }) + ->tooltip(function (array $record): string { + $host = (string) ($record['host'] ?? ''); + $uri = (string) ($record['uri'] ?? ''); + if ($host !== '' && $uri !== '') { + return $host.$uri; + } + return $uri !== '' ? $uri : $host; + }) + ->limit(60) + ->copyable() + ->copyableState(function (array $record): string { + $host = (string) ($record['host'] ?? ''); + $uri = (string) ($record['uri'] ?? ''); + if ($host !== '' && $uri !== '') { + return $host.$uri; + } + return $uri !== '' ? $uri : $host; + }) ->wrap() ->searchable(), TextColumn::make('remote_ip')