mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow filter by display name in device list (#13665)
* Corrected filtering of devices under maintenance * Fix display of device sysname in alert history stats widget * Merge LibreNMS master * Enable searching for devices using display name * Enable searching for devices using display name
This commit is contained in:
@@ -33,10 +33,11 @@ if (! Auth::user()->hasGlobalRead()) {
|
||||
}
|
||||
|
||||
if (! empty($_REQUEST['search'])) {
|
||||
$where[] = '(`hostname` LIKE ? OR `sysName` LIKE ?)';
|
||||
$where[] = '(`hostname` LIKE ? OR `sysName` LIKE ? OR `display` LIKE ?)';
|
||||
$search = '%' . $_REQUEST['search'] . '%';
|
||||
$params[] = $search;
|
||||
$params[] = $search;
|
||||
$params[] = $search;
|
||||
}
|
||||
|
||||
if (! empty($where)) {
|
||||
@@ -57,7 +58,7 @@ if (! empty($_REQUEST['limit'])) {
|
||||
$offset = 0;
|
||||
}
|
||||
|
||||
$sql = "SELECT `device_id`, `hostname`, `sysName` FROM `devices` $query";
|
||||
$sql = "SELECT `device_id`, `hostname`, `sysName`, `display` FROM `devices` $query";
|
||||
$devices = array_map(function ($device) {
|
||||
return [
|
||||
'id' => $device['device_id'],
|
||||
|
||||
Reference in New Issue
Block a user