Compare commits
2 Commits
c8290498c7
...
ef601d0a88
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef601d0a88 | ||
|
|
4eed9f2b5c |
@@ -9,6 +9,7 @@ use App\Services\Agent\AgentClient;
|
||||
use BackedEnum;
|
||||
use Exception;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Repeater\TableColumn as RepeaterTableColumn;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
@@ -127,6 +128,13 @@ class Waf extends Page implements HasForms, HasTable
|
||||
->schema([
|
||||
Repeater::make('whitelist_rules')
|
||||
->label(__('Whitelist Entries'))
|
||||
->table([
|
||||
RepeaterTableColumn::make(__('Name'))->width('18%'),
|
||||
RepeaterTableColumn::make(__('Match Type'))->width('16%'),
|
||||
RepeaterTableColumn::make(__('Match Value'))->width('28%'),
|
||||
RepeaterTableColumn::make(__('Rule IDs'))->width('26%'),
|
||||
RepeaterTableColumn::make(__('Enabled'))->width('12%')->alignCenter(),
|
||||
])
|
||||
->schema([
|
||||
TextInput::make('label')
|
||||
->label(__('Name'))
|
||||
@@ -510,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');
|
||||
}
|
||||
@@ -543,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')
|
||||
|
||||
Reference in New Issue
Block a user