Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

class Dashboard extends BasePage
{
public bool $publicDashboard = false;

protected static ?string $pollingInterval = null;

protected static ?string $navigationIcon = 'heroicon-o-chart-bar';
Expand All @@ -22,11 +24,24 @@ class Dashboard extends BasePage

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

public function mount()
{
$settings = new GeneralSettings();

$this->publicDashboard = $settings->public_dashboard_enabled;
}

protected function getHeaderActions(): array
{
return [
Action::make('home')
->label('Public Dashboard')
->color('gray')
->hidden(! $this->publicDashboard)
->url('/'),
Action::make('speedtest')
->label('Queue Speedtest')
->color('primary')
->action('queueSpeedtest')
->hidden(fn (): bool => ! auth()->user()->is_admin && ! auth()->user()->is_user),
];
Expand Down
4 changes: 0 additions & 4 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ public function panel(Panel $panel): Panel
->collapsible(false),
])
->navigationItems([
NavigationItem::make('Home')
->url('/')
->icon('heroicon-o-home')
->sort(0),
NavigationItem::make('Documentation')
->url('https://docs.speedtest-tracker.dev/', shouldOpenInNewTab: true)
->icon('heroicon-o-book-open')
Expand Down
5 changes: 2 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
->middleware('x-frame-allow')
->name('home');

Route::get('/login', function () {
return redirect('/admin/login');
})->name('login');
Route::redirect('/login', '/admin/login')
->name('login');

require __DIR__.'/debug.php';

Expand Down