Search: re-add object names, allow for addresses
It's now possible do search for IP (and IPv6) addresses. Object names are once again allowed fixes #9591 fixes #10163
This commit is contained in:
parent
209c084f51
commit
9ca81320ac
|
@ -235,7 +235,7 @@ class FilterEditor extends AbstractWidget
|
|||
$filter = $this->mergeRootExpression($filter, trim($k), '=', ltrim($v));
|
||||
} else {
|
||||
if ($this->searchColumns === null && $this->query instanceof FilterColumns) {
|
||||
$this->searchColumns = $this->query->getSearchColumns();
|
||||
$this->searchColumns = $this->query->getSearchColumns($search);
|
||||
}
|
||||
|
||||
if (! empty($this->searchColumns)) {
|
||||
|
|
|
@ -81,9 +81,15 @@ class HostStatus extends DataView
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSearchColumns()
|
||||
public function getSearchColumns($search = null)
|
||||
{
|
||||
return array('host_display_name');
|
||||
if ($search !== null
|
||||
&& (@inet_pton($search) !== false || preg_match('/^\d{1,3}\.\d{1,3}\./', $search))
|
||||
) {
|
||||
return array('host', 'host_address', 'host_address6');
|
||||
} else {
|
||||
return array('host', 'host_display_name');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -170,6 +170,6 @@ class ServiceStatus extends DataView
|
|||
*/
|
||||
public function getSearchColumns()
|
||||
{
|
||||
return array('host_display_name', 'service_display_name');
|
||||
return array('service', 'service_display_name');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue