2023-04-05 15:29:58 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
use Illuminate\View\View;
|
|
|
|
use Illuminate\View\Factory as ViewFactory;
|
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
|
|
|
use Pterodactyl\Services\Helpers\SoftwareVersionService;
|
2023-09-07 10:17:04 -04:00
|
|
|
use Pterodactyl\BlueprintFramework\Services\VariableService\BlueprintVariableService;
|
|
|
|
use Pterodactyl\BlueprintFramework\Services\PlaceholderService\BlueprintPlaceholderService;
|
2023-09-07 15:12:33 -04:00
|
|
|
use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Admin\BlueprintAdminLibrary as BlueprintExtensionLibrary;
|
2023-04-05 15:29:58 -04:00
|
|
|
|
|
|
|
class ExtensionsController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* ExtensionsController constructor.
|
|
|
|
*/
|
2023-07-25 16:42:32 -04:00
|
|
|
public function __construct(
|
|
|
|
private SoftwareVersionService $version,
|
|
|
|
private ViewFactory $view,
|
|
|
|
private BlueprintVariableService $bp,
|
2023-09-07 15:12:33 -04:00
|
|
|
private BlueprintExtensionLibrary $blueprint,
|
2023-07-25 16:42:32 -04:00
|
|
|
private BlueprintPlaceholderService $placeholder)
|
2023-04-05 15:29:58 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the admin index view.
|
|
|
|
*/
|
|
|
|
public function index(): View
|
|
|
|
{
|
2023-04-23 11:34:21 -04:00
|
|
|
// Onboarding check.
|
2023-09-07 15:12:33 -04:00
|
|
|
if($this->blueprint->fileRead("{$this->placeholder->folder()}/.blueprint/data/internal/db/onboarding") == "*blueprint*") {
|
2023-04-23 11:34:21 -04:00
|
|
|
$onboarding = true;
|
2023-04-23 12:37:28 -04:00
|
|
|
} else {
|
|
|
|
$onboarding = false;
|
2023-04-23 11:34:21 -04:00
|
|
|
}
|
|
|
|
return $this->view->make('admin.extensions', [
|
|
|
|
'version' => $this->version,
|
|
|
|
'bp' => $this->bp,
|
2023-09-07 16:11:58 -04:00
|
|
|
'blueprint' => $this->blueprint,
|
2023-04-23 11:34:21 -04:00
|
|
|
'root' => "/admin/extensions",
|
|
|
|
|
|
|
|
'onboarding' => $onboarding
|
|
|
|
]);
|
2023-04-05 15:29:58 -04:00
|
|
|
}
|
|
|
|
}
|