71 lines
2.1 KiB
PHP
71 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\CoolifyActionLogs;
|
|
|
|
use App\Filament\Resources\CoolifyActionLogs\Pages\ManageCoolifyActionLogs;
|
|
use App\Models\CoolifyActionLog;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class CoolifyActionLogResource extends Resource
|
|
{
|
|
protected static ?string $model = CoolifyActionLog::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' => ManageCoolifyActionLogs::route('/'),
|
|
];
|
|
}
|
|
}
|