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\Forms\Components\DatePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Slider;
use Filament\Pages\Dashboard as BaseDashboard;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Filament\Schemas\Components\Grid;
@@ -55,7 +56,7 @@ class Statistic extends BaseDashboard
'md' => 3,
'lg' => 4,
])->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([
Select::make('league_id')
@@ -106,26 +107,48 @@ class Statistic extends BaseDashboard
'home' => 'Home',
'away' => 'Away',
]),
DatePicker::make('start_date')
->native(false)
->prefixIcon('phosphor-calendar')
->live()
Select::make('similar_past_matches')
->prefixIcon('phosphor-align-center-horizontal')
->suffixAction(
Action::make('clear_start')
->icon('phosphor-x')
Action::make('iconInfo')
->color('gray')
->action(fn (Set $set) => $set('start_date', null))
),
DatePicker::make('end_date')
->native(false)
->prefixIcon('phosphor-calendar')
->icon('phosphor-question')
->tooltip(fn () => $this->tooltip_similar_past_matches())
)
->default('none')
->live()
->suffixAction(
Action::make('clear_end')
->icon('phosphor-x')
->color('gray')
->action(fn (Set $set) => $set('end_date', null))
),
->selectablePlaceholder(false)
->options([
'none' => 'None',
'league' => 'League',
'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)
->columnSpanFull(),
Grid::make([
@@ -134,7 +157,7 @@ class Statistic extends BaseDashboard
'md' => 3,
'lg' => 4,
])->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([
Select::make('tm_player_id')
@@ -180,47 +203,27 @@ class Statistic extends BaseDashboard
'snt' => 'Shot on target',
'tsh' => 'Total shots',
]),
Select::make('similar_past_matches')
->prefixIcon('phosphor-align-center-horizontal')
->suffixAction(
Action::make('iconInfo')
->color('gray')
->icon('phosphor-question')
->tooltip(fn () => $this->tooltip_similar_past_matches())
)
->default('none')
DatePicker::make('start_date')
->native(false)
->prefixIcon('phosphor-calendar')
->live()
->selectablePlaceholder(false)
->options([
'none' => 'None',
'league' => 'League',
'all' => 'All Database',
]),
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),
// 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(),
->suffixAction(
Action::make('clear_start')
->icon('phosphor-x')
->color('gray')
->action(fn (Set $set) => $set('start_date', null))
),
DatePicker::make('end_date')
->native(false)
->prefixIcon('phosphor-calendar')
->live()
->suffixAction(
Action::make('clear_end')
->icon('phosphor-x')
->color('gray')
->action(fn (Set $set) => $set('end_date', null))
),
])->columns(5)
->columnSpanFull(),