wip import
This commit is contained in:
1 parent
2ead682763
commit
baa1117f61
22 files changed
+315
-261
No files matched your search
+31
-14
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoImports\Tables;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
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\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class StatistikoImportsTable
|
||||
@@ -31,23 +33,38 @@ class StatistikoImportsTable
|
||||
'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('file_name_original')
|
||||
->searchable()
|
||||
->color('primary')
|
||||
->label('Name'),
|
||||
IconColumn::make('has_run')
|
||||
->label('Import')
|
||||
->alignCenter()
|
||||
->boolean()
|
||||
->falseColor('gray'),
|
||||
TextColumn::make('created_at')->dateTime(),
|
||||
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('data_type')
|
||||
->options([
|
||||
'player' => 'Player',
|
||||
'events' => 'Events',
|
||||
'events_player' => 'Events & Player',
|
||||
]),
|
||||
])
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
DeleteAction::make()->iconButton(),
|
||||
ActionGroup::make([
|
||||
Action::make('Import')
|
||||
->label('Just Import (very fast)')
|
||||
->icon('phosphor-database'),
|
||||
Action::make('Update')
|
||||
->label('Import and Update (slow)')
|
||||
->icon('phosphor-database'),
|
||||
DeleteAction::make()
|
||||
->label('Delete file'),
|
||||
]),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
Reference in new issue
Block a user