diff --git a/app/Filament/Resources/ResultResource/Pages/ListResults.php b/app/Filament/Resources/ResultResource/Pages/ListResults.php index fd954e20a..b14ae44a0 100644 --- a/app/Filament/Resources/ResultResource/Pages/ListResults.php +++ b/app/Filament/Resources/ResultResource/Pages/ListResults.php @@ -12,7 +12,7 @@ class ListResults extends ListRecords protected function getTablePollingInterval(): ?string { - return '5s'; + return config('speedtest.results_polling'); } protected function getMaxContentWidth(): string diff --git a/app/Filament/Widgets/RecentJitterChart.php b/app/Filament/Widgets/RecentJitterChart.php index bd5b2dc6b..e843f437b 100644 --- a/app/Filament/Widgets/RecentJitterChart.php +++ b/app/Filament/Widgets/RecentJitterChart.php @@ -14,6 +14,11 @@ class RecentJitterChart extends LineChartWidget public ?string $filter = '24h'; + protected function getPollingInterval(): ?string + { + return config('speedtest.dashboard_polling'); + } + protected function getHeading(): string { return 'Jitter'; diff --git a/app/Filament/Widgets/RecentPingChart.php b/app/Filament/Widgets/RecentPingChart.php index 72b107cbf..36874af7a 100644 --- a/app/Filament/Widgets/RecentPingChart.php +++ b/app/Filament/Widgets/RecentPingChart.php @@ -14,6 +14,11 @@ class RecentPingChart extends LineChartWidget public ?string $filter = '24h'; + protected function getPollingInterval(): ?string + { + return config('speedtest.dashboard_polling'); + } + protected function getHeading(): string { return 'Ping (ms)'; diff --git a/app/Filament/Widgets/RecentSpeedChart.php b/app/Filament/Widgets/RecentSpeedChart.php index 3974ede10..bc011eb62 100644 --- a/app/Filament/Widgets/RecentSpeedChart.php +++ b/app/Filament/Widgets/RecentSpeedChart.php @@ -14,6 +14,11 @@ class RecentSpeedChart extends LineChartWidget public ?string $filter = '24h'; + protected function getPollingInterval(): ?string + { + return config('speedtest.dashboard_polling'); + } + protected function getHeading(): string { return 'Download / Upload'; diff --git a/app/Filament/Widgets/StatsOverview.php b/app/Filament/Widgets/StatsOverview.php index 2843e4330..8d469c4d9 100644 --- a/app/Filament/Widgets/StatsOverview.php +++ b/app/Filament/Widgets/StatsOverview.php @@ -9,6 +9,11 @@ class StatsOverview extends BaseWidget { + protected function getPollingInterval(): ?string + { + return config('speedtest.dashboard_polling'); + } + protected function getCards(): array { $result = Result::latest()->first(); diff --git a/config/speedtest.php b/config/speedtest.php index 80b18fdcf..d2d4a4644 100644 --- a/config/speedtest.php +++ b/config/speedtest.php @@ -9,4 +9,11 @@ 'build_date' => Carbon::parse('2023-05-12'), 'build_version' => '0.11.16', + + /** + * Polling + */ + 'dashboard_polling' => env('DASHBOARD_POLLING', '5s'), + + 'results_polling' => env('RESULTS_POLLING', '5s'), ];