mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-08 09:38:37 +02:00
cleanup user menu items
This commit is contained in:
parent
3fb0785866
commit
fae5e3ae2c
@ -18,12 +18,10 @@ class AdminPanelProvider extends PanelProvider
|
||||
->breadcrumbs(false)
|
||||
->sidebarCollapsibleOnDesktop()
|
||||
->userMenuItems([
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username),
|
||||
Action::make('exitAdmin')
|
||||
Action::make('exit_admin')
|
||||
->label(fn () => trans('profile.exit_admin'))
|
||||
->url(fn () => Filament::getPanel('app')->getUrl())
|
||||
->icon('tabler-arrow-back')
|
||||
->sort(24),
|
||||
->icon('tabler-arrow-back'),
|
||||
])
|
||||
->navigationGroups([
|
||||
NavigationGroup::make(fn () => trans('admin/dashboard.server'))
|
||||
|
@ -16,12 +16,10 @@ class AppPanelProvider extends PanelProvider
|
||||
->breadcrumbs(false)
|
||||
->navigation(false)
|
||||
->userMenuItems([
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username),
|
||||
Action::make('toAdmin')
|
||||
Action::make('to_admin')
|
||||
->label(trans('profile.admin'))
|
||||
->url(fn () => Filament::getPanel('admin')->getUrl())
|
||||
->icon('tabler-arrow-forward')
|
||||
->sort(5)
|
||||
->visible(fn () => auth()->user()->canAccessPanel(Filament::getPanel('admin'))),
|
||||
])
|
||||
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources');
|
||||
|
@ -5,6 +5,7 @@ namespace App\Providers\Filament;
|
||||
use App\Filament\Pages\Auth\Login;
|
||||
use App\Filament\Pages\Auth\EditProfile;
|
||||
use App\Http\Middleware\LanguageMiddleware;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Auth\MultiFactor\App\AppAuthentication;
|
||||
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
|
||||
use Filament\Http\Middleware\Authenticate;
|
||||
@ -34,6 +35,10 @@ abstract class PanelProvider extends BasePanelProvider
|
||||
->topNavigation(fn () => auth()->user()->getCustomization()['top_navigation'] ?? false)
|
||||
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
||||
->profile(EditProfile::class, false)
|
||||
->userMenuItems([
|
||||
'profile' => fn (Action $action) => $action
|
||||
->url(fn () => EditProfile::getUrl(panel: 'app')),
|
||||
])
|
||||
->login(Login::class)
|
||||
->passwordReset()
|
||||
->multiFactorAuthentication([
|
||||
|
@ -4,7 +4,6 @@ namespace App\Providers\Filament;
|
||||
|
||||
use App\Filament\App\Resources\Servers\Pages\ListServers;
|
||||
use App\Filament\Admin\Resources\Servers\Pages\EditServer;
|
||||
use App\Filament\Pages\Auth\EditProfile;
|
||||
use App\Http\Middleware\Activity\ServerSubject;
|
||||
use App\Models\Server;
|
||||
use Filament\Actions\Action;
|
||||
@ -19,20 +18,17 @@ class ServerPanelProvider extends PanelProvider
|
||||
return parent::panel($panel)
|
||||
->id('server')
|
||||
->path('server')
|
||||
->homeUrl('/')
|
||||
->homeUrl(fn () => Filament::getPanel('app')->getUrl())
|
||||
->tenant(Server::class)
|
||||
->userMenuItems([
|
||||
'profile' => fn (Action $action) => $action->label(auth()->user()->username)->url(fn () => EditProfile::getUrl(panel: 'app')),
|
||||
Action::make('toServerList')
|
||||
->label('Server List')
|
||||
Action::make('to_serverList')
|
||||
->label(trans('profile.server_list'))
|
||||
->icon('tabler-brand-docker')
|
||||
->url(fn () => ListServers::getUrl(panel: 'app'))
|
||||
->sort(6),
|
||||
Action::make('toAdmin')
|
||||
->url(fn () => ListServers::getUrl(panel: 'app')),
|
||||
Action::make('to_admin')
|
||||
->label(trans('profile.admin'))
|
||||
->icon('tabler-arrow-forward')
|
||||
->url(fn () => Filament::getPanel('admin')->getUrl())
|
||||
->sort(5)
|
||||
->visible(fn () => auth()->user()->canAccessPanel(Filament::getPanel('admin'))),
|
||||
])
|
||||
->navigationItems([
|
||||
|
@ -14,6 +14,7 @@ return [
|
||||
'username' => 'Username',
|
||||
'admin' => 'Admin',
|
||||
'exit_admin' => 'Exit Admin',
|
||||
'server_list' => 'Server List',
|
||||
'email' => 'Email',
|
||||
'password' => 'Password',
|
||||
'current_password' => 'Current Password',
|
||||
|
Loading…
x
Reference in New Issue
Block a user