mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed BGP Remote peer link and graph in Routing Overview, or just static text when not a device in LibreNMS (#15535)
* Fixed BGP Remote peer link and graph in Routing Overview, or just static text when not a device in LibreNMS * Added extra space * Reverted back to overlibLink (due to BGP update graphs on hover) * Added extra space * Remove graph for remote peer, as it is falsely (showed earlier the Updates Graph for local peer) * Removed unnecessary/unused code * Remove graph for remote peer, as it is falsely (showed earlier the Updates Graph for local peer), replaced with just a DeviceLinks * Change Url::deviceLink to return $text if the device doesn't exist. Default to '' Import some of the things to improve readability. * update phpdoc --------- Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -39,8 +39,8 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
class Url
|
||||
{
|
||||
/**
|
||||
* @param Device $device
|
||||
* @param string $text
|
||||
* @param Device|null $device
|
||||
* @param string|null $text
|
||||
* @param array $vars
|
||||
* @param int $start
|
||||
* @param int $end
|
||||
@@ -48,10 +48,10 @@ class Url
|
||||
* @param int $overlib
|
||||
* @return string
|
||||
*/
|
||||
public static function deviceLink($device, $text = null, $vars = [], $start = 0, $end = 0, $escape_text = 1, $overlib = 1)
|
||||
public static function deviceLink($device, $text = '', $vars = [], $start = 0, $end = 0, $escape_text = 1, $overlib = 1)
|
||||
{
|
||||
if (! $device instanceof Device || ! $device->hostname) {
|
||||
return '';
|
||||
return (string) $text;
|
||||
}
|
||||
|
||||
if (! $device->canAccess(Auth::user())) {
|
||||
|
Reference in New Issue
Block a user