Add WAF event type column
This commit is contained in:
@@ -507,6 +507,35 @@ class Waf extends Page implements HasForms, HasTable
|
|||||||
->fontFamily('mono')
|
->fontFamily('mono')
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
TextColumn::make('event_type')
|
||||||
|
->label(__('Type'))
|
||||||
|
->badge()
|
||||||
|
->formatStateUsing(function (array $record): string {
|
||||||
|
if (!empty($record['blocked'])) {
|
||||||
|
return __('Blocked');
|
||||||
|
}
|
||||||
|
|
||||||
|
$severity = (int) ($record['severity'] ?? 0);
|
||||||
|
if ($severity >= 4) {
|
||||||
|
return __('Error');
|
||||||
|
}
|
||||||
|
|
||||||
|
return __('Warning');
|
||||||
|
})
|
||||||
|
->color(function (array $record): string {
|
||||||
|
if (!empty($record['blocked'])) {
|
||||||
|
return 'danger';
|
||||||
|
}
|
||||||
|
|
||||||
|
$severity = (int) ($record['severity'] ?? 0);
|
||||||
|
if ($severity >= 4) {
|
||||||
|
return 'warning';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'gray';
|
||||||
|
})
|
||||||
|
->sortable()
|
||||||
|
->toggleable(),
|
||||||
TextColumn::make('message')
|
TextColumn::make('message')
|
||||||
->label(__('Message'))
|
->label(__('Message'))
|
||||||
->wrap()
|
->wrap()
|
||||||
|
|||||||
Reference in New Issue
Block a user