2018-01-13 14:08:19 -06:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2018-01-19 19:58:57 -06:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Nodes;
|
2018-01-13 14:08:19 -06:00
|
|
|
|
2026-10-09 06:26:45 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2026-10-11 06:48:21 -04:00
|
|
|
use Pterodactyl\Actions\Nodes\CreateNode;
|
2018-01-19 21:47:06 -06:00
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
2026-10-09 06:26:45 +01:00
|
|
|
use Pterodactyl\Http\Requests\Concerns\ValidatesExtensionFields;
|
|
|
|
|
use Pterodactyl\Models\Node;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
2018-01-13 14:08:19 -06:00
|
|
|
|
2018-01-19 21:47:06 -06:00
|
|
|
class StoreNodeRequest extends ApplicationApiRequest
|
2018-01-13 14:08:19 -06:00
|
|
|
{
|
2026-10-09 06:26:45 +01:00
|
|
|
use ValidatesExtensionFields;
|
|
|
|
|
|
2022-10-14 10:59:20 -06:00
|
|
|
protected ?string $resource = AdminAcl::RESOURCE_NODES;
|
2018-01-13 14:08:19 -06:00
|
|
|
|
2022-10-14 10:59:20 -06:00
|
|
|
protected int $permission = AdminAcl::WRITE;
|
2018-01-13 14:08:19 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validation rules to apply to this request.
|
2026-10-05 18:10:18 -04:00
|
|
|
*
|
|
|
|
|
* @return ValidationRules
|
2018-01-13 14:08:19 -06:00
|
|
|
*/
|
2026-10-11 06:48:21 -04:00
|
|
|
public function rules(): array
|
2018-01-13 14:08:19 -06:00
|
|
|
{
|
2026-10-11 06:48:21 -04:00
|
|
|
return CreateNode::rules();
|
2018-01-13 14:08:19 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fields to rename for clarity in the API response.
|
|
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
public function attributes(): array
|
2018-01-13 14:08:19 -06:00
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'daemon_base' => 'Daemon Base Path',
|
|
|
|
|
'upload_size' => 'File Upload Size Limit',
|
|
|
|
|
'location_id' => 'Location',
|
|
|
|
|
'public' => 'Node Visibility',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-09 06:26:45 +01:00
|
|
|
/**
|
|
|
|
|
* {@inheritdoc}
|
|
|
|
|
*/
|
|
|
|
|
protected function extensionFieldsModel(): Model|string
|
|
|
|
|
{
|
|
|
|
|
return Node::class;
|
|
|
|
|
}
|
2018-01-13 14:08:19 -06:00
|
|
|
}
|