This commit is contained in:
salam committed 2026-05-25 16:19:11 +02:00
1 parent 39d78e661a
commit 3409a1453b
1 file changed
+62 -59
+62 -59
View File
@@ -16,6 +16,7 @@ use BackedEnum;
use Filament\Actions\Action; use Filament\Actions\Action;
use Filament\Forms\Components\DatePicker; use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Forms\Components\Slider;
use Filament\Pages\Dashboard as BaseDashboard; use Filament\Pages\Dashboard as BaseDashboard;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm; use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Filament\Schemas\Components\Grid; use Filament\Schemas\Components\Grid;
@@ -55,7 +56,7 @@ class Statistic extends BaseDashboard
'md' => 3, 'md' => 3,
'lg' => 4, 'lg' => 4,
])->extraAttributes([ ])->extraAttributes([
'class' => 'bg-gray-100 dark:bg-slate-900 rounded-lg p-5 border border-gray-400 dark:border-blue-950', 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800',
]) ])
->schema([ ->schema([
Select::make('league_id') Select::make('league_id')
@@ -106,26 +107,48 @@ class Statistic extends BaseDashboard
'home' => 'Home', 'home' => 'Home',
'away' => 'Away', 'away' => 'Away',
]), ]),
DatePicker::make('start_date')
->native(false) Select::make('similar_past_matches')
->prefixIcon('phosphor-calendar') ->prefixIcon('phosphor-align-center-horizontal')
->live()
->suffixAction( ->suffixAction(
Action::make('clear_start') Action::make('iconInfo')
->icon('phosphor-x')
->color('gray') ->color('gray')
->action(fn (Set $set) => $set('start_date', null)) ->icon('phosphor-question')
), ->tooltip(fn () => $this->tooltip_similar_past_matches())
DatePicker::make('end_date') )
->native(false) ->default('none')
->prefixIcon('phosphor-calendar')
->live() ->live()
->suffixAction( ->selectablePlaceholder(false)
Action::make('clear_end') ->options([
->icon('phosphor-x') 'none' => 'None',
->color('gray') 'league' => 'League',
->action(fn (Set $set) => $set('end_date', null)) 'all' => 'All Database',
), ]),
Slider::make('accuracy')
->disabled(fn (Get $get) => $get('similar_past_matches') == 'none')
->fillTrack()
->default(5)
->step(0.1)
->decimalPlaces(1)
->tooltips()
->range(minValue: 0, maxValue: 1)
->pips(),
// Select::make('accuracy')
// ->disabled(fn (Get $get) => $get('similar_past_matches') == 'none')
// ->default(0.5)
// ->options([
// '0.1' => '0.1',
// '0.2' => '0.2',
// '0.3' => '0.3',
// '0.4' => '0.4',
// '0.5' => '0.5',
// '0.6' => '0.6',
// '0.7' => '0.7',
// '0.8' => '0.8',
// '0.9' => '0.9',
// '1' => '1.0',
// ])
// ->native(false),
])->columns(6) ])->columns(6)
->columnSpanFull(), ->columnSpanFull(),
Grid::make([ Grid::make([
@@ -134,7 +157,7 @@ class Statistic extends BaseDashboard
'md' => 3, 'md' => 3,
'lg' => 4, 'lg' => 4,
])->extraAttributes([ ])->extraAttributes([
'class' => 'bg-gray-100 dark:bg-slate-900 rounded-lg p-5 border border-gray-400 dark:border-blue-950', 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800',
]) ])
->schema([ ->schema([
Select::make('tm_player_id') Select::make('tm_player_id')
@@ -180,47 +203,27 @@ class Statistic extends BaseDashboard
'snt' => 'Shot on target', 'snt' => 'Shot on target',
'tsh' => 'Total shots', 'tsh' => 'Total shots',
]), ]),
Select::make('similar_past_matches')
->prefixIcon('phosphor-align-center-horizontal') DatePicker::make('start_date')
->suffixAction( ->native(false)
Action::make('iconInfo') ->prefixIcon('phosphor-calendar')
->color('gray')
->icon('phosphor-question')
->tooltip(fn () => $this->tooltip_similar_past_matches())
)
->default('none')
->live() ->live()
->selectablePlaceholder(false) ->suffixAction(
->options([ Action::make('clear_start')
'none' => 'None', ->icon('phosphor-x')
'league' => 'League', ->color('gray')
'all' => 'All Database', ->action(fn (Set $set) => $set('start_date', null))
]), ),
Select::make('accuracy') DatePicker::make('end_date')
->disabled(fn (Get $get) => $get('similar_past_matches') == 'none') ->native(false)
->default(0.5) ->prefixIcon('phosphor-calendar')
->options([ ->live()
'0.1' => '0.1', ->suffixAction(
'0.2' => '0.2', Action::make('clear_end')
'0.3' => '0.3', ->icon('phosphor-x')
'0.4' => '0.4', ->color('gray')
'0.5' => '0.5', ->action(fn (Set $set) => $set('end_date', null))
'0.6' => '0.6', ),
'0.7' => '0.7',
'0.8' => '0.8',
'0.9' => '0.9',
'1' => '1.0',
])
->native(false),
// Slider::make('accuracy')
// ->disabled(fn (Get $get) => $get('similar_past_matches') == 'none')
// ->fillTrack()
// ->default(5)
// ->step(0.1)
// ->decimalPlaces(1)
// ->tooltips()
// ->range(minValue: 0, maxValue: 1)
// ->pips(),
])->columns(5) ])->columns(5)
->columnSpanFull(), ->columnSpanFull(),