import wip
This commit is contained in:
1 parent
de961122ab
commit
8ece71b548
15 files changed
+195
-184
No files matched your search
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoImports\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class StatistikoImportsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
->label('Sport')
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->tooltip(fn ($record) => $record->id)
|
||||
->visibleFrom('lg'),
|
||||
SelectColumn::make('data_type')
|
||||
->native(false)
|
||||
->width('2rem')
|
||||
->allowOptionsHtml()
|
||||
->options([
|
||||
'player' => '<span class="text-blue-500">Player</span>',
|
||||
'events' => '<span class="text-green-500">Events</span>',
|
||||
'events_player' => '<span class="text-amber-500">Events & Player</span>',
|
||||
]),
|
||||
// TextColumn::make('data_type'),
|
||||
TextColumn::make('file_name_original')->searchable()->color('primary')->label('Name'),
|
||||
ToggleColumn::make('run_import')
|
||||
->tooltip('Import will run in the background, on compleation a message will be send.')
|
||||
->onColor(fn ($state) => $state ? 'success' : 'gray')
|
||||
->beforeStateUpdated(function ($record, $state) {
|
||||
if ($state) {
|
||||
$record->is_running = 1;
|
||||
}
|
||||
}),
|
||||
IconColumn::make('is_running')->boolean()->falseColor('gray'),
|
||||
IconColumn::make('has_run')->boolean()->falseColor('gray'),
|
||||
TextColumn::make('created_at')->dateTime(),
|
||||
|
||||
])
|
||||
->recordActions([
|
||||
DeleteAction::make()->iconButton(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user