mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-02 12:25:44 -05:00
Added a configurable panel company/brand logo.
## Extra Details:
- New logo is used for:
- Login page
- Navigation bar
- Page Favicon
- Panel Falls back to the default Ptero logo when no custom one is set.
- Supported File Formats: PNG, JPEG, WebP, AVIF, ICO, and safe SVG
files.
---
## Preview:
<img width="912" height="151"
alt="{67E9647B-AD26-41F8-8272-8B7F4D1CDFB7}"
src="https://github.com/user-attachments/assets/1af9c52b-ad4a-4f82-bb67-14a2b662beb2"
/>
<img width="916" height="256"
alt="{F49323AE-974C-4C16-B129-D60D3494BA0F}"
src="https://github.com/user-attachments/assets/3e35d7f1-c95b-4007-bf1f-69e2ce9891a2"
/>
<img width="1749" height="940"
alt="{252E88D0-BA45-43C8-99E2-5B31E81B739E}"
src="https://github.com/user-attachments/assets/2e807035-bbd0-48ca-823a-4510a9be696e"
/>
<img width="996" height="452" alt="image"
src="https://github.com/user-attachments/assets/c0bef229-285c-4cda-9291-7295e70b2189"
/>
38 lines
1.5 KiB
PHP
38 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Admin\Settings;
|
|
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Response;
|
|
use Knuckles\Scribe\Attributes\Endpoint;
|
|
use Knuckles\Scribe\Attributes\Group;
|
|
use Knuckles\Scribe\Attributes\Response as ScribeResponse;
|
|
use Knuckles\Scribe\Attributes\Subgroup;
|
|
use Pterodactyl\Http\Controllers\Api\Admin\AdminApiController;
|
|
use Pterodactyl\Http\Requests\Api\Admin\Settings\ClearLogoRequest;
|
|
use Pterodactyl\Http\Requests\Api\Admin\Settings\UploadLogoRequest;
|
|
use Pterodactyl\Services\Helpers\BrandingLogoService;
|
|
|
|
#[Group('Admin API', 'Root administrator endpoints for managing panel configuration and resources.')]
|
|
#[Subgroup('Settings', 'View and update global panel settings.')]
|
|
class LogoController extends AdminApiController
|
|
{
|
|
#[Endpoint('Upload branding logo', 'Stores a validated logo for the favicon, login page, and navigation bar.')]
|
|
#[ScribeResponse(['logo' => '/extension-files/branding/example.png'], description: 'Logo uploaded.')]
|
|
public function store(UploadLogoRequest $request, BrandingLogoService $logo): JsonResponse
|
|
{
|
|
return new JsonResponse(['logo' => $logo->replace($request->upload())]);
|
|
}
|
|
|
|
#[Endpoint('Remove branding logo', 'Removes the configured branding logo and restores the default branding.')]
|
|
#[ScribeResponse(status: 204, description: 'Logo removed.')]
|
|
public function destroy(ClearLogoRequest $request, BrandingLogoService $logo): Response
|
|
{
|
|
$logo->clear();
|
|
|
|
return $this->returnNoContent();
|
|
}
|
|
}
|