mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix inventory page hostname/sysname and default generate_device_link behaviour (#11114)
* Fix inventory page hostname and default behaviour on generate_device_link * force test re-run * space * simplify Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,8 @@ use LibreNMS\Config;
|
|||||||
* Compare $t with the value of $vars[$v], if that exists
|
* Compare $t with the value of $vars[$v], if that exists
|
||||||
* @param string $v Name of the var to test
|
* @param string $v Name of the var to test
|
||||||
* @param string $t Value to compare $vars[$v] to
|
* @param string $t Value to compare $vars[$v] to
|
||||||
* @return boolean true, if values are the same, false if $vars[$v] is unset or values differ
|
* @return boolean true, if values are the same, false if $vars[$v]
|
||||||
|
* is unset or values differ
|
||||||
*/
|
*/
|
||||||
function var_eq($v, $t)
|
function var_eq($v, $t)
|
||||||
{
|
{
|
||||||
@@ -174,9 +175,6 @@ function generate_device_link($device, $text = null, $vars = array(), $start = 0
|
|||||||
}
|
}
|
||||||
|
|
||||||
$class = devclass($device);
|
$class = devclass($device);
|
||||||
if (!$text) {
|
|
||||||
$text = $device['hostname'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$text = format_hostname($device, $text);
|
$text = format_hostname($device, $text);
|
||||||
|
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ if ($rowCount != -1) {
|
|||||||
$sql .= " LIMIT $limit_low,$limit_high";
|
$sql .= " LIMIT $limit_low,$limit_high";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT `D`.`device_id` AS `device_id`, `D`.`hostname` AS `hostname`,`entPhysicalDescr` AS `description`, `entPhysicalName` AS `name`, `entPhysicalModelName` AS `model`, `entPhysicalSerialNum` AS `serial` $sql";
|
$sql = "SELECT `D`.`device_id` AS `device_id`, `D`.`hostname` AS `hostname`, `D`.`sysName` AS `sysName`,`entPhysicalDescr` AS `description`, `entPhysicalName` AS `name`, `entPhysicalModelName` AS `model`, `entPhysicalSerialNum` AS `serial` $sql";
|
||||||
|
|
||||||
foreach (dbFetchRows($sql, $param) as $invent) {
|
foreach (dbFetchRows($sql, $param) as $invent) {
|
||||||
$response[] = array(
|
$response[] = array(
|
||||||
'hostname' => generate_device_link($invent, shortHost($invent['hostname'])),
|
'hostname' => generate_device_link($invent),
|
||||||
'description' => $invent['description'],
|
'description' => $invent['description'],
|
||||||
'name' => $invent['name'],
|
'name' => $invent['name'],
|
||||||
'model' => $invent['model'],
|
'model' => $invent['model'],
|
||||||
|
|||||||
Reference in New Issue
Block a user