Support functionality for per-egg features
This commit is contained in:
parent
7ec614ed2c
commit
7618f306bd
7 changed files with 70 additions and 20 deletions
|
@ -33,19 +33,15 @@ class EggUpdateService
|
|||
/**
|
||||
* Update a service option.
|
||||
*
|
||||
* @param int|\Pterodactyl\Models\Egg $egg
|
||||
* @param \Pterodactyl\Models\Egg $egg
|
||||
* @param array $data
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Pterodactyl\Exceptions\Service\Egg\NoParentConfigurationFoundException
|
||||
*/
|
||||
public function handle($egg, array $data)
|
||||
public function handle(Egg $egg, array $data)
|
||||
{
|
||||
if (! $egg instanceof Egg) {
|
||||
$egg = $this->repository->find($egg);
|
||||
}
|
||||
|
||||
if (! is_null(array_get($data, 'config_from'))) {
|
||||
$results = $this->repository->findCountWhere([
|
||||
['nest_id', '=', $egg->nest_id],
|
||||
|
|
|
@ -43,6 +43,7 @@ class EggExporterService
|
|||
'name' => $egg->name,
|
||||
'author' => $egg->author,
|
||||
'description' => $egg->description,
|
||||
'features' => $egg->features,
|
||||
'image' => $egg->docker_image,
|
||||
'startup' => $egg->startup,
|
||||
'config' => [
|
||||
|
|
|
@ -101,6 +101,7 @@ class EggImporterService
|
|||
'author' => object_get($parsed, 'author'),
|
||||
'name' => object_get($parsed, 'name'),
|
||||
'description' => object_get($parsed, 'description'),
|
||||
'features' => object_get($parsed, 'features'),
|
||||
'docker_image' => object_get($parsed, 'image'),
|
||||
'config_files' => object_get($parsed, 'config.files'),
|
||||
'config_startup' => object_get($parsed, 'config.startup'),
|
||||
|
|
|
@ -86,6 +86,7 @@ class EggUpdateImporterService
|
|||
'author' => object_get($parsed, 'author'),
|
||||
'name' => object_get($parsed, 'name'),
|
||||
'description' => object_get($parsed, 'description'),
|
||||
'features' => object_get($parsed, 'features'),
|
||||
'docker_image' => object_get($parsed, 'image'),
|
||||
'config_files' => object_get($parsed, 'config.files'),
|
||||
'config_startup' => object_get($parsed, 'config.startup'),
|
||||
|
|
Reference in a new issue