Replaced placeholder and added "global variables"

The replacement of the placeholder is just a work in progress. I've also discovered a few more things about PHP now, including how to do variables and stuff.
This commit is contained in:
purple 2023-02-19 19:30:47 +01:00
parent c7bc6f9680
commit 33d3403995
6 changed files with 50 additions and 20 deletions

View file

@ -6,13 +6,15 @@ use Illuminate\View\View;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Services\Helpers\SoftwareVersionService;
use Pterodactyl\Services\Helpers\BlueprintVariableService;
class BlueprintExtensionController extends Controller
{
/**
* ExtensionsController constructor.
* BlueprintExtensionController constructor.
*/
public function __construct(private SoftwareVersionService $version, private ViewFactory $view)
public function __construct(private SoftwareVersionService $version, private ViewFactory $view, private BlueprintVariableService $bp)
{
}
@ -21,6 +23,7 @@ class BlueprintExtensionController extends Controller
*/
public function index(): View
{
return $this->view->make('admin.extensions.blueprint.index', ['version' => $this->version]);
$rootPath = "/admin/extensions/blueprint";
return $this->view->make('admin.extensions.blueprint.index', ['version' => $this->version, 'bp' => $this->bp, 'root' => $rootPath]);
}
}

View file

@ -6,13 +6,14 @@ use Illuminate\View\View;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Services\Helpers\SoftwareVersionService;
use Pterodactyl\Services\Helpers\BlueprintVariableService;
class ExtensionsController extends Controller
{
/**
* ExtensionsController constructor.
*/
public function __construct(private SoftwareVersionService $version, private ViewFactory $view)
public function __construct(private SoftwareVersionService $version, private ViewFactory $view, private BlueprintVariableService $bp)
{
}
@ -21,6 +22,7 @@ class ExtensionsController extends Controller
*/
public function index(): View
{
return $this->view->make('admin.extensions', ['version' => $this->version]);
$rootPath = "/admin/extensions";
return $this->view->make('admin.extensions', ['version' => $this->version, 'bp' => $this->bp, 'root' => $rootPath]);
}
}

View file

@ -0,0 +1,13 @@
<?php
namespace Pterodactyl\Services\Helpers;
class BlueprintVariableService
{
// Construct BlueprintVariableService
public function __construct(){}
// $bp->licenseIsValid()
public function licenseIsValid(): bool{return true;}
}

View file

@ -20,3 +20,6 @@ tag[blue] {background-color:#288afb;}
.btn-gray {background-color:#33404d;color:#cad1d8;border-color:#606d7b;}
.btn-gray:hover {background-color:#29343e;color:#cad1d8;border-color:#606d7b;}
.btn-gray-alt {background-color:#4d5b69;color:#cad1d8;border-color:#4d5b69;}
.btn-gray-alt:hover {background-color:#3f4d5a;color:#cad1d8;border-color:#4d5b69;}

View file

@ -1,7 +1,7 @@
@extends('layouts.admin')
@section('title')
Administration
Extensions
@endsection
@section('content-header')

View file

@ -1,7 +1,7 @@
@extends('layouts.admin')
@section('title')
Administration
Blueprint
@endsection
@section('content-header')
@ -15,19 +15,28 @@
@endsection
@section('content')
<p>Blueprint is the framework that drives all Blueprint-compatible extensions and allows multiple extensions to be installed at the same time.</p>
<div class="row">
<div class="col-xs-6 col-sm-3 text-center">
<a href=""><button class="btn btn-gray" style="width:100%;"><i class='bx bx-link'></i> placeholder </button></a>
</div>
<div class="col-xs-6 col-sm-3 text-center">
<a href=""><button class="btn btn-gray" style="width:100%;"><i class='bx bx-link'></i> placeholder </button></a>
</div>
<div class="col-xs-6 col-sm-3 text-center">
<a href=""><button class="btn btn-gray" style="width:100%;"><i class='bx bx-link'></i> placeholder </button></a>
</div>
<div class="col-xs-6 col-sm-3 text-center">
<a href=""><button class="btn btn-gray" style="width:100%;"><i class='bx bx-link'></i> placeholder </button></a>
<div class="col-xs-3">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class='bx bxs-pen' style='margin-right:5px;'></i>License</h3>
</div>
<div class="box-body">
@if ($bp->licenseIsValid())
Your attached license key is valid. You can manage your license key below.
@else
You have not attached a (valid) license key. Blueprint is limited until you attach a valid license key.
@endif
</div>
<div class="box-footer">
@if ($bp->licenseIsValid())
<a href="{{ $root }}/license"><button class="btn btn-gray-alt btn-sm pull-right">Manage</button></a>
@else
<a href="{{ $root }}/license"><button class="btn btn-gray-alt btn-sm pull-right">Resolve</button></a>
@endif
</div>
</div>
</div>
</div>
<p>placeholder</p>
@endsection