Skip to content

Commit e4dd0b5

Browse files
committed
[feature] Set a default range filter for charts CHART_DEFAULT_FILTER
1 parent 5ff5489 commit e4dd0b5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/Filament/Widgets/RecentChartWidget.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ abstract class RecentChartWidget extends ChartWidget
1414

1515
public ?string $filter = '24h';
1616

17+
public function mount(): void
18+
{
19+
$this->filter = config('app.chart_default_filter');
20+
}
21+
1722
protected function getPollingInterval(): ?string
1823
{
1924
return config('speedtest.dashboard_polling');

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
'chart_datetime_format' => env('CHART_DATETIME_FORMAT', 'M. j - G:i'),
1212

13+
'chart_default_filter' => env('CHART_DEFAULT_FILTER', '24h'),
14+
1315
'datetime_format' => env('DATETIME_FORMAT', 'M. jS, Y g:ia'),
1416

1517
'display_timezone' => env('DISPLAY_TIMEZONE', 'UTC'),

0 commit comments

Comments
 (0)