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:
Gilles Depeyrot
2022-01-11 19:55:43 +01:00
committed by GitHub
parent 303b005faf
commit 7453ca65ae
+3 -2
View File
@@ -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'],