From 4ebc2b1f337f770389e2fd9b9e43f27ec0241a97 Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Wed, 3 Feb 2016 06:41:20 +1000 Subject: [PATCH] - Modified code to use graph generation functions instead of calling overlib directly. The graph generation functions check for the status of 'web_mouseover'. --- html/pages/device/routing/bgp.inc.php | 17 +++++++++++--- html/pages/routing/bgp.inc.php | 32 +++++++++++++++++++-------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/html/pages/device/routing/bgp.inc.php b/html/pages/device/routing/bgp.inc.php index 17f0629a0..e99431343 100644 --- a/html/pages/device/routing/bgp.inc.php +++ b/html/pages/device/routing/bgp.inc.php @@ -200,10 +200,21 @@ foreach (dbFetchRows('SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b $peer['bgpPeerIdentifier'] = Net_IPv6::compress($peer['bgpPeerIdentifier']); } + // display overlib graphs + $graph_array = array(); + $graph_array['type'] = 'bgp_updates'; + $graph_array['id'] = $peer['bgpPeer_id']; + $graph_array['to'] = $config['time']['now']; + $graph_array['from'] = $config['time']['day']; + $graph_array['height'] = '110'; + $graph_array['width'] = $width; - $graph_type = 'bgp_updates'; - $peer_daily_url = 'graph.php?id='.$peer['bgpPeer_id'].'&type='.$graph_type.'&from='.$config['time']['day'].'&to='.$config['time']['now'].'&width=500&height=150'; - $peeraddresslink = "', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer['bgpPeerIdentifier'].''; + // Peer Address + $graph_array_zoom = $graph_array; + $graph_array_zoom['height'] = '150'; + $graph_array_zoom['width'] = '500'; + $overlib_link = "device/device=".$peer['device_id']."/tab=routing/proto=bgp/"; + $peeraddresslink = "".overlib_link(NULL, $peer['bgpPeerIdentifier'], generate_graph_tag($graph_array_zoom), NULL).""; echo ' '; diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index d70555c03..e7450aac9 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -256,20 +256,12 @@ else { unset($peername); } - // display overlib graphs - $graph_type = 'bgp_updates'; - $local_daily_url = 'graph.php?id='.$peer['bgpPeer_id'].'&type='.$graph_type.'&from='.$config['time']['day'].'&to='.$config['time']['now'].'&width=500&height=150&&afi=ipv4&safi=unicast'; if (filter_var($peer['bgpLocalAddr'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) { $peer_ip = Net_IPv6::compress($peer['bgpLocalAddr']); } else { $peer_ip = $peer['bgpLocalAddr']; } - - $localaddresslink = "', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ip.''; - - $graph_type = 'bgp_updates'; - $peer_daily_url = 'graph.php?id='.$peer['bgpPeer_id'].'&type='.$graph_type.'&from='.$config['time']['day'].'&to='.$config['time']['now'].'&width=500&height=150'; if (filter_var($peer['bgpPeerIdentifier'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) { $peer_ident = Net_IPv6::compress($peer['bgpPeerIdentifier']); } @@ -277,7 +269,29 @@ else { $peer_ident = $peer['bgpPeerIdentifier']; } - $peeraddresslink = "', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ident.''; + // display overlib graphs + $graph_array = array(); + $graph_array['type'] = 'bgp_updates'; + $graph_array['id'] = $peer['bgpPeer_id']; + $graph_array['to'] = $config['time']['now']; + $graph_array['from'] = $config['time']['day']; + $graph_array['height'] = '110'; + $graph_array['width'] = $width; + + // Peer Address + $graph_array_zoom = $graph_array; + $graph_array_zoom['height'] = '150'; + $graph_array_zoom['width'] = '500'; + $overlib_link = "device/device=".$peer['device_id']."/tab=routing/proto=bgp/"; + $peeraddresslink = "".overlib_link($overlib_link, $peer_ident, generate_graph_tag($graph_array_zoom), NULL).""; + + // Local Address + $graph_array['afi'] = 'ipv4'; + $graph_array['safi'] = 'unicast'; + $graph_array_zoom['afi'] = 'ipv4'; + $graph_array_zoom['safi'] = 'unicast'; + $overlib_link = "device/device=".$peer['device_id']."/tab=routing/proto=bgp/"; + $localaddresslink = "".overlib_link($overlib_link, $peer_ip, generate_graph_tag($graph_array_zoom), NULL).""; echo '';