wip
This commit is contained in:
1 parent
dd51d927dc
commit
bb6986d6e5
6 files changed
+69
-7
No files matched your search
+13
-1
@@ -4,6 +4,7 @@ namespace App\Filament\Clusters\StaticData\Resources\StatisticFixtures\Pages;
|
|||||||
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\StatisticFixtures\StatisticFixturesResource;
|
use App\Filament\Clusters\StaticData\Resources\StatisticFixtures\StatisticFixturesResource;
|
||||||
use App\Models\StatisticFixtures;
|
use App\Models\StatisticFixtures;
|
||||||
|
use DateTime;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
@@ -14,15 +15,26 @@ class ListStatisticFixtures extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Action::make('starttime')
|
||||||
|
->color('gray')
|
||||||
|
->tooltip('Find events with wrong starttime')
|
||||||
|
->icon('phosphor-magnifying-glass')
|
||||||
|
->modalSubmitAction(false)
|
||||||
|
->modalContent(function () {
|
||||||
|
$events = StatisticFixtures::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
|
||||||
|
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
|
||||||
|
}),
|
||||||
Action::make('truncate')
|
Action::make('truncate')
|
||||||
->icon('phosphor-trash')
|
->icon('phosphor-trash')
|
||||||
|
->tooltip('Delete all events')
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->color('danger')
|
->color('danger')
|
||||||
->action(function () {
|
->action(function () {
|
||||||
StatisticFixtures::truncate();
|
StatisticFixtures::truncate();
|
||||||
}),
|
}),
|
||||||
Action::make('delete_old')
|
Action::make('delete')
|
||||||
->icon('phosphor-trash')
|
->icon('phosphor-trash')
|
||||||
|
->tooltip('Delete events already started')
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->color('danger')
|
->color('danger')
|
||||||
->action(function () {
|
->action(function () {
|
||||||
|
|||||||
+10
-4
@@ -4,9 +4,9 @@ namespace App\Filament\Clusters\StaticData\Resources\StatistikoEvents\Pages;
|
|||||||
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
|
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
|
use DateTime;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Actions\CreateAction;
|
use Filament\Actions\CreateAction;
|
||||||
// use Filament\Actions\ImportAction;
|
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
class ListStatistikoEvents extends ListRecords
|
class ListStatistikoEvents extends ListRecords
|
||||||
@@ -16,9 +16,15 @@ class ListStatistikoEvents extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
// Action::make('download')
|
Action::make('starttime')
|
||||||
// ->icon('phosphor-download')
|
->color('gray')
|
||||||
// ->color('gray'),
|
->tooltip('Find events with wrong starttime')
|
||||||
|
->icon('phosphor-magnifying-glass')
|
||||||
|
->modalSubmitAction(false)
|
||||||
|
->modalContent(function () {
|
||||||
|
$events = StatistikoEvent::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
|
||||||
|
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
|
||||||
|
}),
|
||||||
Action::make('truncate')
|
Action::make('truncate')
|
||||||
->icon('phosphor-trash')
|
->icon('phosphor-trash')
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
|
|||||||
+12
-2
@@ -4,11 +4,10 @@ namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
|
|||||||
|
|
||||||
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
|
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
|
use DateTime;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Actions\CreateAction;
|
use Filament\Actions\CreateAction;
|
||||||
use Filament\Infolists\Components\TextEntry;
|
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
use Illuminate\Contracts\View\View;
|
|
||||||
|
|
||||||
class ListStatistikoPlayers extends ListRecords
|
class ListStatistikoPlayers extends ListRecords
|
||||||
{
|
{
|
||||||
@@ -17,8 +16,18 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Action::make('starttime')
|
||||||
|
->color('gray')
|
||||||
|
->tooltip('Find events with wrong starttime')
|
||||||
|
->icon('phosphor-magnifying-glass')
|
||||||
|
->modalSubmitAction(false)
|
||||||
|
->modalContent(function () {
|
||||||
|
$players = StatistikoPlayer::where('starttime', '<', new DateTime('-10 years'))->get();
|
||||||
|
return view('filament.pages.list-player-starttime', ['players' => $players]);
|
||||||
|
}),
|
||||||
Action::make('missing')
|
Action::make('missing')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
|
->modalSubmitAction(false)
|
||||||
->modalHeading('Missing Player')
|
->modalHeading('Missing Player')
|
||||||
->tooltip('Element in player but missing in details')
|
->tooltip('Element in player but missing in details')
|
||||||
->icon('phosphor-magnifying-glass')
|
->icon('phosphor-magnifying-glass')
|
||||||
@@ -27,6 +36,7 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
return view('filament.pages.list-missing-player', ['players' => $players]);
|
return view('filament.pages.list-missing-player', ['players' => $players]);
|
||||||
}),
|
}),
|
||||||
Action::make('double')
|
Action::make('double')
|
||||||
|
->modalSubmitAction(false)
|
||||||
->icon('phosphor-magnifying-glass')
|
->icon('phosphor-magnifying-glass')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->modalContent(function () {
|
->modalContent(function () {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class StatisticFixtures extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function sport()
|
public function sport()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Sport::class)->where('is_active', 1);
|
return $this->belongsTo(Sport::class)->where('is_active', 1);
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<div>
|
||||||
|
<x-filament::fieldset>
|
||||||
|
<x-slot name="label">
|
||||||
|
Events with wrong starttime: {{ $events->count() }}
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-5 gap-4">
|
||||||
|
@foreach ($events as $event)
|
||||||
|
<div>{{ $event->match_id }}</div>
|
||||||
|
<div>{{ $event->starttime }}</div>
|
||||||
|
<div>{{ $event->league->name }}</div>
|
||||||
|
<div>{{ $event->home->ss_team_name }}</div>
|
||||||
|
<div>{{ $event->away->ss_team_name }}</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</x-filament::fieldset>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<div>
|
||||||
|
{{-- <div class="p-2 border text-md">Player missing {{ \count($players)}}</div> --}}
|
||||||
|
<x-filament::section>
|
||||||
|
<x-slot name="heading">
|
||||||
|
{{ \count($players)}} players with wrong starttime
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class= "flex flex-wrap gap-2">
|
||||||
|
@foreach ($players as $player)
|
||||||
|
|
||||||
|
<div>{{ $player->ss_player_id }}</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</x-filament::section>
|
||||||
|
</div>
|
||||||
Reference in new issue
Block a user