diff --git a/app/Http/Controllers/Admin/PackController.php b/app/Http/Controllers/Admin/PackController.php index e25e3d3b9..742f1ed0a 100644 --- a/app/Http/Controllers/Admin/PackController.php +++ b/app/Http/Controllers/Admin/PackController.php @@ -114,7 +114,7 @@ class PackController extends Controller public function index(Request $request) { return view('admin.packs.index', [ - 'packs' => $this->repository->search($request->input('query'))->paginateWithOptionAndServerCount( + 'packs' => $this->repository->search($request->input('query'))->paginateWithEggAndServerCount( $this->config->get('pterodactyl.paginate.admin.packs') ), ]); @@ -124,11 +124,13 @@ class PackController extends Controller * Display new pack creation form. * * @return \Illuminate\View\View + * + * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function create() { return view('admin.packs.new', [ - 'services' => $this->serviceRepository->getWithOptions(), + 'nests' => $this->serviceRepository->getWithEggs(), ]); } @@ -136,11 +138,13 @@ class PackController extends Controller * Display new pack creation modal for use with template upload. * * @return \Illuminate\View\View + * + * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function newTemplate() { return view('admin.packs.modal', [ - 'services' => $this->serviceRepository->getWithOptions(), + 'nests' => $this->serviceRepository->getWithEggs(), ]); } @@ -160,7 +164,7 @@ class PackController extends Controller public function store(PackFormRequest $request) { if ($request->has('from_template')) { - $pack = $this->templateUploadService->handle($request->input('option_id'), $request->file('file_upload')); + $pack = $this->templateUploadService->handle($request->input('egg_id'), $request->file('file_upload')); } else { $pack = $this->creationService->handle($request->normalize(), $request->file('file_upload')); } @@ -175,12 +179,13 @@ class PackController extends Controller * * @param int $pack * @return \Illuminate\View\View + * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function view($pack) { return view('admin.packs.view', [ 'pack' => $this->repository->getWithServers($pack), - 'services' => $this->serviceRepository->getWithOptions(), + 'nests' => $this->serviceRepository->getWithEggs(), ]); } diff --git a/app/Http/Requests/Admin/ServerFormRequest.php b/app/Http/Requests/Admin/ServerFormRequest.php index 21f0519db..f448a953c 100644 --- a/app/Http/Requests/Admin/ServerFormRequest.php +++ b/app/Http/Requests/Admin/ServerFormRequest.php @@ -63,7 +63,7 @@ class ServerFormRequest extends AdminFormRequest $validator->sometimes('pack_id', [ Rule::exists('packs', 'id')->where(function ($query) { $query->where('selectable', 1); - $query->where('option_id', $this->input('option_id')); + $query->where('egg_id', $this->input('egg_id')); }), ], function ($input) { return $input->pack_id !== 0 && $input->pack_id !== null; diff --git a/app/Models/Pack.php b/app/Models/Pack.php index 960199680..a029b3614 100644 --- a/app/Models/Pack.php +++ b/app/Models/Pack.php @@ -34,7 +34,7 @@ class Pack extends Model implements CleansAttributes, ValidableContract * @var array */ protected $fillable = [ - 'option_id', 'uuid', 'name', 'version', 'description', 'selectable', 'visible', 'locked', + 'egg_id', 'uuid', 'name', 'version', 'description', 'selectable', 'visible', 'locked', ]; /** diff --git a/app/Services/Packs/PackUpdateService.php b/app/Services/Packs/PackUpdateService.php index 6d5555ce5..bb84f7b98 100644 --- a/app/Services/Packs/PackUpdateService.php +++ b/app/Services/Packs/PackUpdateService.php @@ -54,10 +54,10 @@ class PackUpdateService public function handle($pack, array $data) { if (! $pack instanceof Pack) { - $pack = $this->repository->withColumns(['id', 'option_id'])->find($pack); + $pack = $this->repository->withColumns(['id', 'egg_id'])->find($pack); } - if ((int) array_get($data, 'option_id', $pack->option_id) !== $pack->option_id) { + if ((int) array_get($data, 'egg_id', $pack->egg_id) !== $pack->egg_id) { $count = $this->serverRepository->findCountWhere([['pack_id', '=', $pack->id]]); if ($count !== 0) { diff --git a/app/Services/Packs/TemplateUploadService.php b/app/Services/Packs/TemplateUploadService.php index 7007f3bb4..045bfec48 100644 --- a/app/Services/Packs/TemplateUploadService.php +++ b/app/Services/Packs/TemplateUploadService.php @@ -52,7 +52,7 @@ class TemplateUploadService /** * Process an uploaded file to create a new pack from a JSON or ZIP format. * - * @param int $option + * @param int $egg * @param \Illuminate\Http\UploadedFile $file * @return \Pterodactyl\Models\Pack * @@ -63,7 +63,7 @@ class TemplateUploadService * @throws \Pterodactyl\Exceptions\Service\Pack\UnreadableZipArchiveException * @throws \Pterodactyl\Exceptions\Service\Pack\InvalidPackArchiveFormatException */ - public function handle($option, UploadedFile $file) + public function handle($egg, UploadedFile $file) { if (! $file->isValid()) { throw new InvalidFileUploadException(trans('exceptions.packs.invalid_upload')); @@ -76,10 +76,10 @@ class TemplateUploadService } if ($file->getMimeType() === 'application/zip') { - return $this->handleArchive($option, $file); + return $this->handleArchive($egg, $file); } else { $json = json_decode($file->openFile()->fread($file->getSize()), true); - $json['option_id'] = $option; + $json['egg_id'] = $egg; return $this->creationService->handle($json); } @@ -88,7 +88,7 @@ class TemplateUploadService /** * Process a ZIP file to create a pack and stored archive. * - * @param int $option + * @param int $egg * @param \Illuminate\Http\UploadedFile $file * @return \Pterodactyl\Models\Pack * @@ -99,7 +99,7 @@ class TemplateUploadService * @throws \Pterodactyl\Exceptions\Service\Pack\UnreadableZipArchiveException * @throws \Pterodactyl\Exceptions\Service\Pack\InvalidPackArchiveFormatException */ - protected function handleArchive($option, $file) + protected function handleArchive($egg, $file) { if (! $this->archive->open($file->getRealPath())) { throw new UnreadableZipArchiveException(trans('exceptions.packs.unreadable')); @@ -110,7 +110,7 @@ class TemplateUploadService } $json = json_decode($this->archive->getFromName('import.json'), true); - $json['option_id'] = $option; + $json['egg_id'] = $egg; $pack = $this->creationService->handle($json); if (! $this->archive->extractTo(storage_path('app/packs/' . $pack->uuid), 'archive.tar.gz')) { diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index 7760a8edc..0994abe55 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -124,7 +124,7 @@ class ServerCreationService public function create(array $data) { // @todo auto-deployment - $validator = $this->validatorService->isAdmin()->setFields($data['environment'])->validate($data['option_id']); + $validator = $this->validatorService->isAdmin()->setFields($data['environment'])->validate($data['egg_id']); $uniqueShort = str_random(8); $this->connection->beginTransaction(); diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 2570d5ab4..f3e4f4093 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -133,7 +133,7 @@ $factory->state(Pterodactyl\Models\EggVariable::class, 'editable', function () { $factory->define(Pterodactyl\Models\Pack::class, function (Faker\Generator $faker) { return [ 'id' => $faker->unique()->randomNumber(), - 'option_id' => $faker->randomNumber(), + 'egg_id' => $faker->randomNumber(), 'uuid' => $faker->uuid, 'name' => $faker->word, 'description' => null, diff --git a/resources/themes/pterodactyl/admin/nodes/view/servers.blade.php b/resources/themes/pterodactyl/admin/nodes/view/servers.blade.php index ad1944f9a..b648c760c 100644 --- a/resources/themes/pterodactyl/admin/nodes/view/servers.blade.php +++ b/resources/themes/pterodactyl/admin/nodes/view/servers.blade.php @@ -56,7 +56,7 @@
{{ $server->uuidShort }}
{{ $pack->version }}
The version of this package, or the version of the files contained within the package.
{{ $server->uuidShort }}
{{ $server->uuidShort }}