Skip to content

Commit 94d3ab4

Browse files
authored
Last run date polling (alexjustesen#252)
1 parent 1d351b0 commit 94d3ab4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

app/Filament/Pages/Dashboard.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Filament\Notifications\Notification;
1313
use Filament\Pages\Actions\Action;
1414
use Filament\Pages\Dashboard as BasePage;
15+
use Illuminate\Contracts\View\View;
1516

1617
class Dashboard extends BasePage
1718
{
@@ -21,7 +22,7 @@ class Dashboard extends BasePage
2122

2223
protected static string $view = 'filament.pages.dashboard';
2324

24-
public function mount()
25+
public function render(): View
2526
{
2627
$this->resultsCount = Result::count();
2728

@@ -36,6 +37,8 @@ public function mount()
3637
->format($settings->time_format);
3738
}
3839

40+
return view(static::$view, $this->getViewData())
41+
->layout(static::$layout, $this->getLayoutData());
3942
}
4043

4144
protected function getActions(): array
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<x-filament::page>
2-
3-
<div>
4-
<p class="text-center text-sm">Last speedtest run at: <strong>{{ $lastResult }}</strong></p>
5-
</div>
6-
2+
<div wire:poll.5000ms>
3+
<p class="text-center text-sm">Last speedtest run at: <strong>{{ $lastResult }}</strong></p>
4+
</div>
75
</x-filament::page>

0 commit comments

Comments
 (0)