Fix WAF type column and improve URI display
This commit is contained in:
@@ -518,7 +518,7 @@ class Waf extends Page implements HasForms, HasTable
|
|||||||
TextColumn::make('event_type')
|
TextColumn::make('event_type')
|
||||||
->label(__('Type'))
|
->label(__('Type'))
|
||||||
->badge()
|
->badge()
|
||||||
->formatStateUsing(function (array $record): string {
|
->getStateUsing(function (array $record): string {
|
||||||
if (!empty($record['blocked'])) {
|
if (!empty($record['blocked'])) {
|
||||||
return __('Blocked');
|
return __('Blocked');
|
||||||
}
|
}
|
||||||
@@ -551,6 +551,32 @@ class Waf extends Page implements HasForms, HasTable
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('uri')
|
TextColumn::make('uri')
|
||||||
->label(__('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()
|
->wrap()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('remote_ip')
|
TextColumn::make('remote_ip')
|
||||||
|
|||||||
Reference in New Issue
Block a user