22
33namespace App \Filament \Pages ;
44
5- use App \Filament \Widgets \RecentDownloadChartWidget ;
6- use App \Filament \Widgets \RecentDownloadLatencyChartWidget ;
7- use App \Filament \Widgets \RecentJitterChartWidget ;
8- use App \Filament \Widgets \RecentPingChartWidget ;
9- use App \Filament \Widgets \RecentUploadChartWidget ;
10- use App \Filament \Widgets \RecentUploadLatencyChartWidget ;
11- use App \Filament \Widgets \StatsOverviewWidget ;
12- use Carbon \Carbon ;
13- use Cron \CronExpression ;
145use Filament \Pages \Dashboard as BasePage ;
156
167class Dashboard extends BasePage
178{
18- protected static string |\BackedEnum |null $ navigationIcon = 'heroicon-o-chart-bar ' ;
9+ protected static string |\BackedEnum |null $ navigationIcon = 'tabler-layout-dashboard ' ;
1910
2011 protected string $ view = 'filament.pages.dashboard ' ;
2112
@@ -28,32 +19,4 @@ public static function getNavigationLabel(): string
2819 {
2920 return __ ('dashboard.title ' );
3021 }
31-
32- public function getSubheading (): ?string
33- {
34- $ schedule = config ('speedtest.schedule ' );
35-
36- if (blank ($ schedule ) || $ schedule === false ) {
37- return __ ('dashboard.no_speedtests_scheduled ' );
38- }
39-
40- $ cronExpression = new CronExpression ($ schedule );
41-
42- $ nextRunDate = Carbon::parse ($ cronExpression ->getNextRunDate (timeZone: config ('app.display_timezone ' )))->format (config ('app.datetime_format ' ));
43-
44- return __ ('dashboard.next_speedtest_at ' ).': ' .$ nextRunDate ;
45- }
46-
47- protected function getHeaderWidgets (): array
48- {
49- return [
50- StatsOverviewWidget::make (),
51- RecentDownloadChartWidget::make (),
52- RecentUploadChartWidget::make (),
53- RecentPingChartWidget::make (),
54- RecentJitterChartWidget::make (),
55- RecentDownloadLatencyChartWidget::make (),
56- RecentUploadLatencyChartWidget::make (),
57- ];
58- }
5922}
0 commit comments