From 02e4527b84f4f7a5a96bbc67959a2d89a132bf1c Mon Sep 17 00:00:00 2001 From: Boy132 Date: Thu, 28 May 2026 09:18:20 +0200 Subject: [PATCH] Replace hardcoded `pelican` with config value (#2362) --- app/Filament/Admin/Pages/Dashboard.php | 2 +- app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php | 4 +++- app/Providers/Filament/FilamentServiceProvider.php | 8 +++++++- lang/en/admin/dashboard.php | 4 ++-- .../views/filament/components/server-console.blade.php | 4 +++- resources/views/filament/layouts/footer.blade.php | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/Filament/Admin/Pages/Dashboard.php b/app/Filament/Admin/Pages/Dashboard.php index 48798d416..b696b3a5f 100644 --- a/app/Filament/Admin/Pages/Dashboard.php +++ b/app/Filament/Admin/Pages/Dashboard.php @@ -25,7 +25,7 @@ class Dashboard extends BaseDashboard public function getHeading(): string { - return trans('admin/dashboard.heading'); + return trans('admin/dashboard.heading', ['app' => config('app.name')]); } public function getSubheading(): string diff --git a/app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php b/app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php index f9b60ed19..a587328f3 100644 --- a/app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php +++ b/app/Filament/Admin/Resources/Eggs/Pages/ListEggs.php @@ -38,7 +38,9 @@ class ListEggs extends ListRecords */ public function table(Table $table): Table { - $defaultEggIcon = 'data:image/svg+xml;base64,' . base64_encode(file_get_contents(public_path('pelican.svg'))); + $defaultEggIcon = config('app.logo'); + $defaultEggIcon = empty($defaultEggIcon) || !is_file(public_path($defaultEggIcon)) ? 'pelican.svg' : $defaultEggIcon; + $defaultEggIcon = 'data:image/svg+xml;base64,' . base64_encode(file_get_contents(public_path($defaultEggIcon))); return $table ->searchable(true) diff --git a/app/Providers/Filament/FilamentServiceProvider.php b/app/Providers/Filament/FilamentServiceProvider.php index 96ad7a332..23279dc82 100644 --- a/app/Providers/Filament/FilamentServiceProvider.php +++ b/app/Providers/Filament/FilamentServiceProvider.php @@ -59,9 +59,15 @@ class FilamentServiceProvider extends ServiceProvider fn () => Blade::render('@livewire(\App\Livewire\AlertBannerContainer::class)'), ); + $appName = config('app.name', 'Pelican'); + + if (strtolower($appName) !== 'pelican') { + $appName = "{$appName} - Powered by Pelican"; + } + FilamentView::registerRenderHook( PanelsRenderHook::FOOTER, - fn () => Blade::render('filament.layouts.footer'), + fn () => Blade::render('filament.layouts.footer', ['appName' => $appName]), ); FilamentView::registerRenderHook( diff --git a/lang/en/admin/dashboard.php b/lang/en/admin/dashboard.php index 410175e9c..1edae215e 100644 --- a/lang/en/admin/dashboard.php +++ b/lang/en/admin/dashboard.php @@ -1,7 +1,7 @@ 'Welcome to Pelican!', + 'heading' => 'Welcome to :app!', 'version' => 'Version: :version', 'advanced' => 'Advanced', 'server' => 'Server', @@ -27,7 +27,7 @@ return [ 'heading' => 'No Nodes Detected', 'content' => "It looks like you don't have any Nodes set up yet, but don't worry because you click the action button to create your first one!", 'extra_note' => 'If you run into any issues, please report them on GitHub.', - 'button_label' => 'Create first Node in Pelican', + 'button_label' => 'Create first Node', ], 'intro-support' => [ 'heading' => 'Support Pelican', diff --git a/resources/views/filament/components/server-console.blade.php b/resources/views/filament/components/server-console.blade.php index 9a238f169..159d8b257 100644 --- a/resources/views/filament/components/server-console.blade.php +++ b/resources/views/filament/components/server-console.blade.php @@ -4,6 +4,8 @@ $userFont = (string) user()?->getCustomization(\App\Enums\CustomizationKey::ConsoleFont); $userFontSize = (int) user()?->getCustomization(\App\Enums\CustomizationKey::ConsoleFontSize); $userRows = (int) user()?->getCustomization(\App\Enums\CustomizationKey::ConsoleRows); + + $terminalPrelude = str(config('app.name'))->slug()->lower()->toString(); @endphp @if($userFont !== "monospace") @@ -116,7 +118,7 @@ return true; }); - const TERMINAL_PRELUDE = '\u001b[1m\u001b[33mpelican@' + '{{ \Filament\Facades\Filament::getTenant()->name }}' + ' ~ \u001b[0m'; + const TERMINAL_PRELUDE = '\u001b[1m\u001b[33m{{ $terminalPrelude }}@' + '{{ \Filament\Facades\Filament::getTenant()->name }}' + ' ~ \u001b[0m'; const handleConsoleOutput = (line, prelude = false) => terminal.writeln((prelude ? TERMINAL_PRELUDE : '') + line.replace(/(?:\r\n|\r|\n)$/im, '') + '\u001b[0m'); diff --git a/resources/views/filament/layouts/footer.blade.php b/resources/views/filament/layouts/footer.blade.php index a047c4847..2f67989f2 100644 --- a/resources/views/filament/layouts/footer.blade.php +++ b/resources/views/filament/layouts/footer.blade.php @@ -2,7 +2,7 @@ {{ \Filament\Support\Facades\FilamentView::renderHook(\App\Enums\CustomRenderHooks::FooterStart->value) }} - © {{ date('Y') }} Pelican + © {{ date('Y') }} {{ $appName }} @if(config('app.debug'))