Skip to content

Commit bef6d3e

Browse files
authored
[Chore] Removed polling config (alexjustesen#2038)
1 parent 4785c6f commit bef6d3e

File tree

11 files changed

+16
-52
lines changed

11 files changed

+16
-52
lines changed

app/Filament/Resources/ResultResource.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ public static function table(Table $table): Table
436436
->hidden(fn (): bool => ! Auth::user()->is_admin),
437437
])->dropdownPlacement('bottom-end'),
438438
])
439-
->defaultSort('created_at', 'desc')
440-
->paginated([5, 15, 25, 50, 100])
441-
->defaultPaginationPageOption(15);
439+
->defaultSort('id', 'desc')
440+
->deferLoading()
441+
->poll('60s');
442442
}
443443

444444
public static function getPages(): array

app/Filament/Resources/ResultResource/Pages/ListResults.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ class ListResults extends ListRecords
99
{
1010
protected static string $resource = ResultResource::class;
1111

12-
protected function getTablePollingInterval(): ?string
13-
{
14-
return config('speedtest.results_polling');
15-
}
16-
1712
protected function getHeaderWidgets(): array
1813
{
1914
return ResultResource::getWidgets();

app/Filament/Widgets/RecentDownloadChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ class RecentDownloadChartWidget extends ChartWidget
1616

1717
protected static ?string $maxHeight = '250px';
1818

19-
public ?string $filter = '24h';
19+
protected static ?string $pollingInterval = '60s';
2020

21-
protected function getPollingInterval(): ?string
22-
{
23-
return config('speedtest.dashboard_polling');
24-
}
21+
public ?string $filter = '24h';
2522

2623
protected function getFilters(): ?array
2724
{

app/Filament/Widgets/RecentDownloadLatencyChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ class RecentDownloadLatencyChartWidget extends ChartWidget
1414

1515
protected static ?string $maxHeight = '250px';
1616

17-
public ?string $filter = '24h';
17+
protected static ?string $pollingInterval = '60s';
1818

19-
protected function getPollingInterval(): ?string
20-
{
21-
return config('speedtest.dashboard_polling');
22-
}
19+
public ?string $filter = '24h';
2320

2421
protected function getFilters(): ?array
2522
{

app/Filament/Widgets/RecentJitterChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ class RecentJitterChartWidget extends ChartWidget
1414

1515
protected static ?string $maxHeight = '250px';
1616

17-
public ?string $filter = '24h';
17+
protected static ?string $pollingInterval = '60s';
1818

19-
protected function getPollingInterval(): ?string
20-
{
21-
return config('speedtest.dashboard_polling');
22-
}
19+
public ?string $filter = '24h';
2320

2421
protected function getFilters(): ?array
2522
{

app/Filament/Widgets/RecentPingChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ class RecentPingChartWidget extends ChartWidget
1515

1616
protected static ?string $maxHeight = '250px';
1717

18-
public ?string $filter = '24h';
18+
protected static ?string $pollingInterval = '60s';
1919

20-
protected function getPollingInterval(): ?string
21-
{
22-
return config('speedtest.dashboard_polling');
23-
}
20+
public ?string $filter = '24h';
2421

2522
protected function getFilters(): ?array
2623
{

app/Filament/Widgets/RecentUploadChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ class RecentUploadChartWidget extends ChartWidget
1616

1717
protected static ?string $maxHeight = '250px';
1818

19-
public ?string $filter = '24h';
19+
protected static ?string $pollingInterval = '60s';
2020

21-
protected function getPollingInterval(): ?string
22-
{
23-
return config('speedtest.dashboard_polling');
24-
}
21+
public ?string $filter = '24h';
2522

2623
protected function getFilters(): ?array
2724
{

app/Filament/Widgets/RecentUploadLatencyChartWidget.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ class RecentUploadLatencyChartWidget extends ChartWidget
1414

1515
protected static ?string $maxHeight = '250px';
1616

17-
public ?string $filter = '24h';
17+
protected static ?string $pollingInterval = '60s';
1818

19-
protected function getPollingInterval(): ?string
20-
{
21-
return config('speedtest.dashboard_polling');
22-
}
19+
public ?string $filter = '24h';
2320

2421
protected function getFilters(): ?array
2522
{

app/Filament/Widgets/StatsOverviewWidget.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ class StatsOverviewWidget extends BaseWidget
1212
{
1313
public ?Result $result = null;
1414

15-
protected function getPollingInterval(): ?string
16-
{
17-
return config('speedtest.dashboard_polling');
18-
}
15+
protected static ?string $pollingInterval = '60s';
1916

2017
protected function getCards(): array
2118
{

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function panel(Panel $panel): Panel
5454
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
5555
->widgets([])
5656
->databaseNotifications()
57-
->databaseNotificationsPolling(config('speedtest.notification_polling'))
5857
->maxContentWidth(config('speedtest.content_width'))
5958
->spa()
6059
->middleware([

0 commit comments

Comments
 (0)