mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Added sysNames to pulldowns and the main page (#8137)
* Add dependency info for api * webui: made dev dependency list more like devices page. Also added sysNames to pulldowns and the manin page * Create common function for sysname display * A better function name
This commit is contained in:
committed by
Neil Lathwood
parent
2018c9f804
commit
5880f06780
@ -1696,3 +1696,23 @@ function get_zfs_pools($device_id)
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sysname of a device with a html line break prepended.
|
||||
* if the device has an empty sysname it will return device's hostname instead
|
||||
* And finally if the device has no hostname it will return an empty string
|
||||
* @param device array
|
||||
* @return string
|
||||
*/
|
||||
function get_device_name($device)
|
||||
{
|
||||
$ret_str = '';
|
||||
|
||||
if (format_hostname($device) !== $device['sysName']) {
|
||||
$ret_str = $device['sysName'];
|
||||
} elseif ($device['hostname'] !== $device['ip']) {
|
||||
$ret_str = $device['hostname'];
|
||||
}
|
||||
|
||||
return $ret_str;
|
||||
}
|
||||
|
Reference in New Issue
Block a user