update import opetion by upload

This commit is contained in:
salam committed 2026-06-03 08:06:31 +02:00
1 parent 37d28eec21
commit 0221ace4d2
15 files changed
+194 -253

No files matched your search

@@ -17,10 +17,10 @@ class StatistikoImportForm
->required()
->allowHtml()
->options([
'details' => '<span class="text-blue-500">Details</span>',
'events' => '<span class="text-green-500">Events</span>',
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
'player' => '<span class="text-pink-600">Player</span>',
'details' => '<span class="text-blue-500">Player Details</span>',
'player' => '<span class="text-pink-600">Player History</span>',
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
'events' => '<span class="text-green-500">Events History</span>',
]),
FileUpload::make('file_name')
@@ -25,13 +25,12 @@ class StatistikoImportsTable
->columns([
SelectColumn::make('data_type')
->native(false)
->width('2rem')
->allowOptionsHtml()
->options([
'details' => '<span class="text-blue-500">Details</span>',
'events' => '<span class="text-green-500">Events</span>',
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
'player' => '<span class="text-pink-600">Player</span>',
'details' => '<span class="text-blue-500">Player Details</span>',
'player' => '<span class="text-pink-600">Player History</span>',
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
'events' => '<span class="text-green-500">Events History</span>',
]),
TextColumn::make('file_name_original')
->searchable()
@@ -58,15 +57,28 @@ class StatistikoImportsTable
->deferFilters(false)
->recordActions([
ActionGroup::make([
Action::make('Import')
->label('Import to DB')
Action::make('import')
->label('Import')
->color('success')
->tooltip('Import is much faster but does no check for doubles')
->icon('phosphor-database')
->action(fn ($record) => StatistikoImporter::run($record))
->action(fn ($record) => StatistikoImporter::run($record, 'import'))
->successNotification(
Notification::make()
->info()
->title('Import started')
),
Action::make('update')
->label('Update')
->color('info')
->tooltip('Compares ervery row in database and takes time')
->icon('phosphor-database')
->action(fn ($record) => StatistikoImporter::run($record, 'update'))
->successNotification(
Notification::make()
->info()
->title('Update started')
),
DeleteAction::make()
->successNotificationTitle('File deleted')
->label('Delete file'),