mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00
Backwards compatibility
This commit is contained in:
parent
5c33c7495a
commit
b579f14f3f
@ -27,7 +27,7 @@ class NodeDeploymentController extends ApplicationApiController
|
||||
$data['disk'] ?? 0,
|
||||
$data['memory'] ?? 0,
|
||||
$data['cpu'] ?? 0,
|
||||
$data['location_ids'] ?? $data['tags'] ?? [],
|
||||
$data['tags'] ?? $data['location_ids'] ?? [],
|
||||
);
|
||||
|
||||
return $this->fractal->collection($nodes)
|
||||
|
@ -10,6 +10,8 @@ class GetDeployableNodesRequest extends GetNodesRequest
|
||||
'page' => 'integer',
|
||||
'memory' => 'required|integer|min:0',
|
||||
'disk' => 'required|integer|min:0',
|
||||
'location_ids' => 'array',
|
||||
'tags' => 'array',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,15 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||
return !$input->deploy;
|
||||
});
|
||||
|
||||
/** @deprecated use tags instead */
|
||||
$validator->sometimes('deploy.locations', 'present', function ($input) {
|
||||
return $input->deploy;
|
||||
});
|
||||
|
||||
$validator->sometimes('deploy.tags', 'present', function ($input) {
|
||||
return $input->deploy;
|
||||
});
|
||||
|
||||
$validator->sometimes('deploy.port_range', 'present', function ($input) {
|
||||
return $input->deploy;
|
||||
});
|
||||
@ -139,6 +148,7 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||
|
||||
$object = new DeploymentObject();
|
||||
$object->setDedicated($this->input('deploy.dedicated_ip', false));
|
||||
$object->setTags($this->input('deploy.tags', $this->input('deploy.locations', [])));
|
||||
$object->setPorts($this->input('deploy.port_range', []));
|
||||
|
||||
return $object;
|
||||
|
@ -6,6 +6,8 @@ class DeploymentObject
|
||||
{
|
||||
private bool $dedicated = false;
|
||||
|
||||
private array $tags = [];
|
||||
|
||||
private array $ports = [];
|
||||
|
||||
public function isDedicated(): bool
|
||||
@ -31,4 +33,17 @@ class DeploymentObject
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTags(): array
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
public function setTags(array $tags): self
|
||||
{
|
||||
$this->tags = $tags;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user