mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 21:04:44 +02:00
Update admin area navigation (#881)
This commit is contained in:
parent
6707d1ccf6
commit
af4ac1db92
@ -43,8 +43,6 @@ class Settings extends Page implements HasForms
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-settings';
|
protected static ?string $navigationIcon = 'tabler-settings';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Advanced';
|
|
||||||
|
|
||||||
protected static string $view = 'filament.pages.settings';
|
protected static string $view = 'filament.pages.settings';
|
||||||
|
|
||||||
public ?array $data = [];
|
public ?array $data = [];
|
||||||
|
@ -12,6 +12,8 @@ class EggResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-eggs';
|
protected static ?string $navigationIcon = 'tabler-eggs';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Server';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
public static function getNavigationBadge(): ?string
|
public static function getNavigationBadge(): ?string
|
||||||
|
@ -13,6 +13,8 @@ class NodeResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-server-2';
|
protected static ?string $navigationIcon = 'tabler-server-2';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Server';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
public static function getNavigationBadge(): ?string
|
public static function getNavigationBadge(): ?string
|
||||||
|
@ -24,7 +24,7 @@ class RoleResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-users-group';
|
protected static ?string $navigationIcon = 'tabler-users-group';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Advanced';
|
protected static ?string $navigationGroup = 'User';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ class ServerResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-brand-docker';
|
protected static ?string $navigationIcon = 'tabler-brand-docker';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Server';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
public static function getNavigationBadge(): ?string
|
public static function getNavigationBadge(): ?string
|
||||||
|
@ -13,6 +13,8 @@ class UserResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-users';
|
protected static ?string $navigationIcon = 'tabler-users';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'User';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'username';
|
protected static ?string $recordTitleAttribute = 'username';
|
||||||
|
|
||||||
public static function getNavigationBadge(): ?string
|
public static function getNavigationBadge(): ?string
|
||||||
|
@ -9,9 +9,9 @@ use Filament\Http\Middleware\Authenticate;
|
|||||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||||
use Filament\Navigation\MenuItem;
|
use Filament\Navigation\MenuItem;
|
||||||
|
use Filament\Navigation\NavigationGroup;
|
||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
use Filament\PanelProvider;
|
use Filament\PanelProvider;
|
||||||
use Filament\Support\Facades\FilamentAsset;
|
|
||||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
||||||
@ -22,28 +22,24 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|||||||
|
|
||||||
class AdminPanelProvider extends PanelProvider
|
class AdminPanelProvider extends PanelProvider
|
||||||
{
|
{
|
||||||
public function boot(): void
|
|
||||||
{
|
|
||||||
FilamentAsset::registerCssVariables([
|
|
||||||
'sidebar-width' => '16rem !important',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function panel(Panel $panel): Panel
|
public function panel(Panel $panel): Panel
|
||||||
{
|
{
|
||||||
return $panel
|
return $panel
|
||||||
->default()
|
->default()
|
||||||
->id('admin')
|
->id('admin')
|
||||||
->path('admin')
|
->path('admin')
|
||||||
->topNavigation(config('panel.filament.top-navigation', true))
|
|
||||||
->login(Login::class)
|
|
||||||
->breadcrumbs(false)
|
|
||||||
->homeUrl('/')
|
->homeUrl('/')
|
||||||
->favicon(config('app.favicon', '/pelican.ico'))
|
->spa()
|
||||||
|
->databaseNotifications()
|
||||||
|
->breadcrumbs(false)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
->brandLogo(config('app.logo'))
|
->brandLogo(config('app.logo'))
|
||||||
->brandLogoHeight('2rem')
|
->brandLogoHeight('2rem')
|
||||||
|
->favicon(config('app.favicon', '/pelican.ico'))
|
||||||
|
->topNavigation(config('panel.filament.top-navigation', true))
|
||||||
|
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
||||||
->profile(EditProfile::class, false)
|
->profile(EditProfile::class, false)
|
||||||
|
->login(Login::class)
|
||||||
->userMenuItems([
|
->userMenuItems([
|
||||||
MenuItem::make()
|
MenuItem::make()
|
||||||
->label('Exit Admin')
|
->label('Exit Admin')
|
||||||
@ -51,11 +47,16 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
->icon('tabler-arrow-back')
|
->icon('tabler-arrow-back')
|
||||||
->sort(24),
|
->sort(24),
|
||||||
])
|
])
|
||||||
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
->navigationGroups([
|
||||||
->spa()
|
NavigationGroup::make('Server')
|
||||||
|
->collapsible(false),
|
||||||
|
NavigationGroup::make('User')
|
||||||
|
->collapsible(false),
|
||||||
|
NavigationGroup::make('Advanced'),
|
||||||
|
])
|
||||||
|
->sidebarCollapsibleOnDesktop()
|
||||||
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
|
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
|
||||||
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
|
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
|
||||||
->databaseNotifications()
|
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
|
@ -26,6 +26,7 @@ class AppPanelProvider extends PanelProvider
|
|||||||
return $panel
|
return $panel
|
||||||
->id('app')
|
->id('app')
|
||||||
->spa()
|
->spa()
|
||||||
|
->databaseNotifications()
|
||||||
->breadcrumbs(false)
|
->breadcrumbs(false)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
->brandLogo(config('app.logo'))
|
->brandLogo(config('app.logo'))
|
||||||
@ -45,7 +46,6 @@ class AppPanelProvider extends PanelProvider
|
|||||||
->visible(fn (): bool => auth()->user()->canAccessPanel(Filament::getPanel('admin'))),
|
->visible(fn (): bool => auth()->user()->canAccessPanel(Filament::getPanel('admin'))),
|
||||||
])
|
])
|
||||||
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
|
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
|
||||||
->databaseNotifications()
|
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
|
@ -33,6 +33,7 @@ class ServerPanelProvider extends PanelProvider
|
|||||||
->path('app/server')
|
->path('app/server')
|
||||||
->homeUrl('/')
|
->homeUrl('/')
|
||||||
->spa()
|
->spa()
|
||||||
|
->databaseNotifications()
|
||||||
->tenant(Server::class)
|
->tenant(Server::class)
|
||||||
->brandName(config('app.name', 'Pelican'))
|
->brandName(config('app.name', 'Pelican'))
|
||||||
->brandLogo(config('app.logo'))
|
->brandLogo(config('app.logo'))
|
||||||
@ -65,7 +66,6 @@ class ServerPanelProvider extends PanelProvider
|
|||||||
->discoverResources(in: app_path('Filament/Server/Resources'), for: 'App\\Filament\\Server\\Resources')
|
->discoverResources(in: app_path('Filament/Server/Resources'), for: 'App\\Filament\\Server\\Resources')
|
||||||
->discoverPages(in: app_path('Filament/Server/Pages'), for: 'App\\Filament\\Server\\Pages')
|
->discoverPages(in: app_path('Filament/Server/Pages'), for: 'App\\Filament\\Server\\Pages')
|
||||||
->discoverWidgets(in: app_path('Filament/Server/Widgets'), for: 'App\\Filament\\Server\\Widgets')
|
->discoverWidgets(in: app_path('Filament/Server/Widgets'), for: 'App\\Filament\\Server\\Widgets')
|
||||||
->databaseNotifications()
|
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user