From 7453ca65ae350e1e0b19d3ff545151e1eb0b1970 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Tue, 11 Jan 2022 19:55:43 +0100 Subject: [PATCH] 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 --- includes/html/list/devices.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/html/list/devices.inc.php b/includes/html/list/devices.inc.php index c2434e83d2..73976e6181 100644 --- a/includes/html/list/devices.inc.php +++ b/includes/html/list/devices.inc.php @@ -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'],