Skip to content

Commit dd06013

Browse files
authored
Adhoc speedtest button on dashboard page (alexjustesen#55)
1 parent d2c9510 commit dd06013

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

app/Filament/Pages/Dashboard.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Filament\Pages;
4+
5+
use App\Jobs\ExecSpeedtest;
6+
use Filament\Notifications\Notification;
7+
use Filament\Pages\Actions\Action;
8+
use Filament\Pages\Dashboard as BasePage;
9+
10+
class Dashboard extends BasePage
11+
{
12+
protected static string $view = 'filament.pages.dashboard';
13+
14+
protected function getActions(): array
15+
{
16+
return [
17+
Action::make('speedtest')
18+
->label('Queue Speedtest')
19+
->action('queueSpeedtest'),
20+
];
21+
}
22+
23+
public function queueSpeedtest()
24+
{
25+
ExecSpeedtest::dispatch();
26+
27+
Notification::make()
28+
->title('Speedtest added to the queue')
29+
->success()
30+
->send();
31+
}
32+
}

config/filament.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
'namespace' => 'App\\Filament\\Pages',
106106
'path' => app_path('Filament/Pages'),
107107
'register' => [
108-
Pages\Dashboard::class,
108+
// Pages\Dashboard::class,
109109
],
110110
],
111111

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<x-filament::page>
2+
<p>
3+
👋 Welcome to Speedtest Tracker, here you can track your internet speed using Ookla's Speedtest service. Keep in mind that this is still work in progress so make sure to check out the documentation and follow along on GitHub for updates.
4+
</p>
5+
</x-filament::page>

0 commit comments

Comments
 (0)