Skip to content

Commit df87ea0

Browse files
committed
This breaks literally the entire panel.
1 parent 344c1a9 commit df87ea0

File tree

88 files changed

+1207
-994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1207
-994
lines changed

app/Contracts/Repository/ServiceOptionRepositoryInterface.php renamed to app/Contracts/Repository/EggRepositoryInterface.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@
99

1010
namespace Pterodactyl\Contracts\Repository;
1111

12-
use Pterodactyl\Models\ServiceOption;
12+
use Pterodactyl\Models\Egg;
1313
use Illuminate\Database\Eloquent\Collection;
1414

15-
interface ServiceOptionRepositoryInterface extends RepositoryInterface
15+
interface EggRepositoryInterface extends RepositoryInterface
1616
{
1717
/**
18-
* Return a service option with the variables relation attached.
18+
* Return an egg with the variables relation attached.
1919
*
2020
* @param int $id
21-
* @return \Pterodactyl\Models\ServiceOption
21+
* @return \Pterodactyl\Models\Egg
2222
*
2323
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
2424
*/
25-
public function getWithVariables(int $id): ServiceOption;
25+
public function getWithVariables(int $id): Egg;
2626

2727
/**
28-
* Return all of the service options and their relations to be used in the daemon API.
28+
* Return all eggs and their relations to be used in the daemon API.
2929
*
3030
* @return \Illuminate\Database\Eloquent\Collection
3131
*/
3232
public function getAllWithCopyAttributes(): Collection;
3333

3434
/**
35-
* Return a service option with the scriptFrom and configFrom relations loaded onto the model.
35+
* Return an egg with the scriptFrom and configFrom relations loaded onto the model.
3636
*
3737
* @param int|string $value
3838
* @param string $column
39-
* @return \Pterodactyl\Models\ServiceOption
39+
* @return \Pterodactyl\Models\Egg
4040
*/
41-
public function getWithCopyAttributes($value, string $column = 'id'): ServiceOption;
41+
public function getWithCopyAttributes($value, string $column = 'id'): Egg;
4242

4343
/**
4444
* Return all of the data needed to export a service.
4545
*
4646
* @param int $id
47-
* @return \Pterodactyl\Models\ServiceOption
47+
* @return \Pterodactyl\Models\Egg
4848
*
4949
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
5050
*/
51-
public function getWithExportAttributes(int $id): ServiceOption;
51+
public function getWithExportAttributes(int $id): Egg;
5252

5353
/**
54-
* Confirm a copy script belongs to the same service as the item trying to use it.
54+
* Confirm a copy script belongs to the same nest as the item trying to use it.
5555
*
5656
* @param int $copyFromId
5757
* @param int $service

app/Contracts/Repository/OptionVariableRepositoryInterface.php renamed to app/Contracts/Repository/EggVariableRepositoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
namespace Pterodactyl\Contracts\Repository;
1111

12-
interface OptionVariableRepositoryInterface extends RepositoryInterface
12+
interface EggVariableRepositoryInterface extends RepositoryInterface
1313
{
1414
}

app/Contracts/Repository/ServiceRepositoryInterface.php renamed to app/Contracts/Repository/NestRepositoryInterface.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@
99

1010
namespace Pterodactyl\Contracts\Repository;
1111

12-
use Pterodactyl\Models\Service;
12+
use Pterodactyl\Models\Nest;
1313

14-
interface ServiceRepositoryInterface extends RepositoryInterface
14+
interface NestRepositoryInterface extends RepositoryInterface
1515
{
1616
/**
17-
* Return a service or all services with their associated options, variables, and packs.
17+
* Return a nest or all nests with their associated eggs, variables, and packs.
1818
*
1919
* @param int $id
20-
* @return \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\Service
20+
* @return \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\Nest
2121
*
2222
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
2323
*/
24-
public function getWithOptions(int $id = null);
24+
public function getWithEggs(int $id = null);
2525

2626
/**
27-
* Return a service or all services and the count of options, packs, and servers for that service.
27+
* Return a nest or all nests and the count of eggs, packs, and servers for that nest.
2828
*
2929
* @param int|null $id
30-
* @return \Pterodactyl\Models\Service|\Illuminate\Database\Eloquent\Collection
30+
* @return \Pterodactyl\Models\Nest|\Illuminate\Database\Eloquent\Collection
3131
*
3232
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
3333
*/
3434
public function getWithCounts(int $id = null);
3535

3636
/**
37-
* Return a service along with its associated options and the servers relation on those options.
37+
* Return a nest along with its associated eggs and the servers relation on those eggs.
3838
*
3939
* @param int $id
40-
* @return \Pterodactyl\Models\Service
40+
* @return \Pterodactyl\Models\Nest
4141
*
4242
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
4343
*/
44-
public function getWithOptionServers(int $id): Service;
44+
public function getWithEggServers(int $id): Nest;
4545
}

app/Contracts/Repository/PackRepositoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
interface PackRepositoryInterface extends RepositoryInterface, SearchableInterface
1515
{
1616
/**
17-
* Return a paginated listing of packs with their associated option and server count.
17+
* Return a paginated listing of packs with their associated egg and server count.
1818
*
1919
* @param int $paginate
2020
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
2121
*/
22-
public function paginateWithOptionAndServerCount($paginate = 50);
22+
public function paginateWithEggAndServerCount($paginate = 50);
2323

2424
/**
2525
* Return a pack with the associated server models attached to it.

app/Contracts/Repository/ServiceVariableRepositoryInterface.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/Exceptions/Service/ServiceOption/DuplicateOptionTagException.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/Http/Controllers/API/Admin/ServiceController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Fractal;
1313
use Illuminate\Http\Request;
14-
use Pterodactyl\Models\Service;
14+
use Pterodactyl\Models\Nest;
1515
use Pterodactyl\Http\Controllers\Controller;
1616
use Pterodactyl\Transformers\Admin\ServiceTransformer;
1717

@@ -28,7 +28,7 @@ public function index(Request $request)
2828
$this->authorize('service-list', $request->apiKey());
2929

3030
return Fractal::create()
31-
->collection(Service::all())
31+
->collection(Nest::all())
3232
->transformWith(new ServiceTransformer($request))
3333
->withResourceName('service')
3434
->toArray();
@@ -45,7 +45,7 @@ public function view(Request $request, $id)
4545
{
4646
$this->authorize('service-view', $request->apiKey());
4747

48-
$service = Service::findOrFail($id);
48+
$service = Nest::findOrFail($id);
4949
$fractal = Fractal::create()->item($service);
5050

5151
if ($request->input('include')) {

app/Http/Controllers/API/Remote/OptionRetrievalController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Illuminate\Http\JsonResponse;
1313
use Pterodactyl\Http\Controllers\Controller;
14-
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
14+
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
1515
use Pterodactyl\Services\Services\Options\OptionConfigurationFileService;
1616

1717
class OptionRetrievalController extends Controller
@@ -22,18 +22,18 @@ class OptionRetrievalController extends Controller
2222
protected $configurationFileService;
2323

2424
/**
25-
* @var \Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface
25+
* @var \Pterodactyl\Contracts\Repository\EggRepositoryInterface
2626
*/
2727
protected $repository;
2828

2929
/**
3030
* OptionUpdateController constructor.
3131
*
32-
* @param \Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface $repository
32+
* @param \Pterodactyl\Contracts\Repository\EggRepositoryInterface $repository
3333
* @param \Pterodactyl\Services\Services\Options\OptionConfigurationFileService $configurationFileService
3434
*/
3535
public function __construct(
36-
ServiceOptionRepositoryInterface $repository,
36+
EggRepositoryInterface $repository,
3737
OptionConfigurationFileService $configurationFileService
3838
) {
3939
$this->configurationFileService = $configurationFileService;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* This software is licensed under the terms of the MIT license.
7+
* https://opensource.org/licenses/MIT
8+
*/
9+
10+
namespace Pterodactyl\Http\Controllers\Admin\Nests;
11+
12+
use Illuminate\View\View;
13+
use Pterodactyl\Models\Egg;
14+
use Pterodactyl\Http\Controllers\Controller;
15+
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
16+
17+
class EggController extends Controller
18+
{
19+
protected $repository;
20+
21+
public function __construct(EggRepositoryInterface $repository)
22+
{
23+
$this->repository = $repository;
24+
}
25+
26+
public function view(Egg $egg): View
27+
{
28+
return view('admin.eggs.view', [
29+
'egg' => $egg,
30+
]);
31+
}
32+
}

app/Http/Controllers/Admin/Services/Options/OptionShareController.php renamed to app/Http/Controllers/Admin/Nests/EggShareController.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,54 @@
77
* https://opensource.org/licenses/MIT
88
*/
99

10-
namespace Pterodactyl\Http\Controllers\Admin\Services\Options;
10+
namespace Pterodactyl\Http\Controllers\Admin\Nests;
1111

12+
use Pterodactyl\Models\Egg;
1213
use Illuminate\Http\RedirectResponse;
13-
use Pterodactyl\Models\ServiceOption;
1414
use Pterodactyl\Http\Controllers\Controller;
1515
use Symfony\Component\HttpFoundation\Response;
16+
use Pterodactyl\Services\Eggs\Sharing\EggExporterService;
17+
use Pterodactyl\Services\Services\Sharing\EggImporterService;
1618
use Pterodactyl\Http\Requests\Admin\Service\OptionImportFormRequest;
17-
use Pterodactyl\Services\Services\Sharing\ServiceOptionExporterService;
18-
use Pterodactyl\Services\Services\Sharing\ServiceOptionImporterService;
1919

20-
class OptionShareController extends Controller
20+
class EggShareController extends Controller
2121
{
2222
/**
23-
* @var \Pterodactyl\Services\Services\Sharing\ServiceOptionExporterService
23+
* @var \Pterodactyl\Services\Eggs\Sharing\EggExporterService
2424
*/
2525
protected $exporterService;
2626

2727
/**
28-
* @var \Pterodactyl\Services\Services\Sharing\ServiceOptionImporterService
28+
* @var \Pterodactyl\Services\Services\Sharing\EggImporterService
2929
*/
3030
protected $importerService;
3131

3232
/**
3333
* OptionShareController constructor.
3434
*
35-
* @param \Pterodactyl\Services\Services\Sharing\ServiceOptionExporterService $exporterService
36-
* @param \Pterodactyl\Services\Services\Sharing\ServiceOptionImporterService $importerService
35+
* @param \Pterodactyl\Services\Eggs\Sharing\EggExporterService $exporterService
36+
* @param \Pterodactyl\Services\Services\Sharing\EggImporterService $importerService
3737
*/
3838
public function __construct(
39-
ServiceOptionExporterService $exporterService,
40-
ServiceOptionImporterService $importerService
39+
EggExporterService $exporterService,
40+
EggImporterService $importerService
4141
) {
4242
$this->exporterService = $exporterService;
4343
$this->importerService = $importerService;
4444
}
4545

4646
/**
47-
* @param \Pterodactyl\Models\ServiceOption $option
47+
* @param \Pterodactyl\Models\Egg $egg
4848
* @return \Symfony\Component\HttpFoundation\Response
4949
*
5050
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
5151
*/
52-
public function export(ServiceOption $option): Response
52+
public function export(Egg $egg): Response
5353
{
54-
return response($this->exporterService->handle($option->id), 200, [
54+
return response($this->exporterService->handle($egg->id), 200, [
5555
'Content-Transfer-Encoding' => 'binary',
5656
'Content-Description' => 'File Transfer',
57-
'Content-Disposition' => 'attachment; filename=' . kebab_case($option->name) . '.json',
57+
'Content-Disposition' => 'attachment; filename=egg-' . kebab_case($egg->name) . '.json',
5858
'Content-Type' => 'application/json',
5959
]);
6060
}
@@ -71,8 +71,8 @@ public function export(ServiceOption $option): Response
7171
*/
7272
public function import(OptionImportFormRequest $request): RedirectResponse
7373
{
74-
$option = $this->importerService->handle($request->file('import_file'), $request->input('import_to_service'));
74+
$egg = $this->importerService->handle($request->file('import_file'), $request->input('import_to_nest'));
7575

76-
return redirect()->route('admin.services.option.view', ['option' => $option->id]);
76+
return redirect()->route('admin.nests.egg.view', ['egg' => $egg->id]);
7777
}
7878
}

0 commit comments

Comments
 (0)