File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1414
1515class Dashboard extends BasePage
1616{
17+ public bool $ publicDashboard = false ;
18+
1719 protected static ?string $ pollingInterval = null ;
1820
1921 protected static ?string $ navigationIcon = 'heroicon-o-chart-bar ' ;
@@ -22,11 +24,24 @@ class Dashboard extends BasePage
2224
2325 protected static string $ view = 'filament.pages.dashboard ' ;
2426
27+ public function mount ()
28+ {
29+ $ settings = new GeneralSettings ();
30+
31+ $ this ->publicDashboard = $ settings ->public_dashboard_enabled ;
32+ }
33+
2534 protected function getHeaderActions (): array
2635 {
2736 return [
37+ Action::make ('home ' )
38+ ->label ('Public Dashboard ' )
39+ ->color ('gray ' )
40+ ->hidden (! $ this ->publicDashboard )
41+ ->url ('/ ' ),
2842 Action::make ('speedtest ' )
2943 ->label ('Queue Speedtest ' )
44+ ->color ('primary ' )
3045 ->action ('queueSpeedtest ' )
3146 ->hidden (fn (): bool => ! auth ()->user ()->is_admin && ! auth ()->user ()->is_user ),
3247 ];
Original file line number Diff line number Diff line change @@ -80,10 +80,6 @@ public function panel(Panel $panel): Panel
8080 ->collapsible (false ),
8181 ])
8282 ->navigationItems ([
83- NavigationItem::make ('Home ' )
84- ->url ('/ ' )
85- ->icon ('heroicon-o-home ' )
86- ->sort (0 ),
8783 NavigationItem::make ('Documentation ' )
8884 ->url ('https://docs.speedtest-tracker.dev/ ' , shouldOpenInNewTab: true )
8985 ->icon ('heroicon-o-book-open ' )
Original file line number Diff line number Diff line change 1818 ->middleware ('x-frame-allow ' )
1919 ->name ('home ' );
2020
21- Route::get ('/login ' , function () {
22- return redirect ('/admin/login ' );
23- })->name ('login ' );
21+ Route::redirect ('/login ' , '/admin/login ' )
22+ ->name ('login ' );
2423
2524require __DIR__ .'/debug.php ' ;
2625
You can’t perform that action at this time.
0 commit comments