$plugin = $this->Request->contains('plugin') && $misc->isValidAlphaNumeric($this->Request['plugin']) ? $this->Request['plugin'] : '';
$os = $this->Request->contains('os') && $misc->isValidNameExt($this->Request['os']) ? $this->Request['os'] : '';
$version = $this->Request->contains('version') && $misc->isValidColumn($this->Request['version']) ? $this->Request['version'] : '';
+ $type = $this->Request->contains('type') && $misc->isValidName($this->Request['type']) ? $this->Request['type'] : null;
$mode = $this->Request->contains('overview') && $misc->isValidBooleanTrue($this->Request['overview']) ? ClientManager::CLIENT_RESULT_MODE_OVERVIEW : ClientManager::CLIENT_RESULT_MODE_NORMAL;
$order_by = $this->Request->contains('order_by') && $misc->isValidColumn($this->Request['order_by']) ? $this->Request['order_by']: null;
$order_direction = $this->Request->contains('order_direction') && $misc->isValidOrderDirection($this->Request['order_direction']) ? $this->Request['order_direction']: null;
'vals' => ''
];
$clients_reached = $this->getModule('client')->getClients(
- $limit,
- $offset,
+ (is_null($type) || $type === ClientManager::CLIENT_TYPE_REACHABLE ? $limit : 0),
+ (is_null($type) || $type === ClientManager::CLIENT_TYPE_REACHABLE ? $offset : 0),
$sort,
$params,
$jobs,
'vals' => ''
];
$clients_unreached = $this->getModule('client')->getClients(
- $limit,
- $offset,
+ (is_null($type) || $type === ClientManager::CLIENT_TYPE_UNREACHABLE ? $limit : 0),
+ (is_null($type) || $type === ClientManager::CLIENT_TYPE_UNREACHABLE ? $offset : 0),
$sort,
$params,
$jobs,
{
"$ref": "#/components/parameters/Offset"
},
+ {
+ "name": "type",
+ "in": "query",
+ "required": false,
+ "description": "Client type (reachable/unreachable). It determines for wich type will be applied offset and limit. This option has meaning only for overview mode (overview=1). For other modes it is ignored. Please note, providing one type does not cause that other types will not be listed, but only offset and limit criteria will be applied for selected type.",
+ "schema": {
+ "type": "string",
+ "enum": ["reachable", "unreachable"]
+ }
+ },
{
"name": "name",
"in": "query",