Files
fotospiel-app/app/Filament/Resources/InfrastructureActionLogs/InfrastructureActionLogResource.php
2025-11-18 16:45:56 +01:00

71 lines
2.1 KiB
PHP

<?php
namespace App\Filament\Resources\InfrastructureActionLogs;
use App\Filament\Resources\InfrastructureActionLogs\Pages\ManageInfrastructureActionLogs;
use App\Models\InfrastructureActionLog;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Support\Icons\Heroicon;
use Filament\Tables;
use Filament\Tables\Table;
use UnitEnum;
class InfrastructureActionLogResource extends Resource
{
protected static ?string $model = InfrastructureActionLog::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
protected static string|UnitEnum|null $navigationGroup = 'Platform';
protected static ?int $navigationSort = 90;
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('created_at')
->label('Timestamp')
->sortable()
->dateTime(),
Tables\Columns\TextColumn::make('user.name')
->label('User')
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('service_id')
->label('Service')
->searchable()
->copyable()
->limit(30),
Tables\Columns\BadgeColumn::make('action')
->label('Action')
->colors([
'warning' => 'restart',
'info' => 'redeploy',
'gray' => 'logs',
])
->sortable(),
Tables\Columns\TextColumn::make('status_code')
->label('HTTP')
->sortable(),
])
->filters([
//
])
->recordActions([
Tables\Actions\ViewAction::make(),
])
->toolbarActions([
//
]);
}
public static function getPages(): array
{
return [
'index' => ManageInfrastructureActionLogs::route('/'),
];
}
}