You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -89,7 +89,9 @@ class BanResource extends Resource
|
||||
->label(__('filament::resources.columns.reason'))
|
||||
->tooltip(function (TextColumn $column): ?string {
|
||||
$state = $column->getState();
|
||||
|
||||
if (! is_string($state)) {
|
||||
return null;
|
||||
}
|
||||
if (strlen($state) <= $column->getCharacterLimit()) {
|
||||
return null;
|
||||
}
|
||||
@@ -107,12 +109,14 @@ class BanResource extends Resource
|
||||
'ip' => __('filament::resources.common.IP'),
|
||||
'machine' => __('filament::resources.common.Machine'),
|
||||
'super' => __('filament::resources.common.Super'),
|
||||
default => __('filament::resources.common.Unknown'),
|
||||
})
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
'account' => 'primary',
|
||||
'ip' => 'success',
|
||||
'machine' => 'primary',
|
||||
'super' => 'danger',
|
||||
default => 'warning',
|
||||
}),
|
||||
|
||||
TextColumn::make('timestamp')
|
||||
@@ -121,7 +125,10 @@ class BanResource extends Resource
|
||||
|
||||
TextColumn::make('ban_expire')
|
||||
->label(__('filament::resources.columns.expires_at'))
|
||||
->formatStateUsing(fn (string $state): string => $state == 0 ? __('filament::resources.common.Never') : date('Y-m-d H:i', $state)),
|
||||
->formatStateUsing(function (string $state): string {
|
||||
$ts = is_numeric($state) ? (int) $state : 0;
|
||||
return $ts === 0 ? __('filament::resources.common.Never') : date('Y-m-d H:i', $ts);
|
||||
}),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user