mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Network map sql update + fix for duplicate links
This commit is contained in:
		@@ -35,7 +35,7 @@ if (is_admin() === false && is_read() === false) {
 | 
			
		||||
$tmp_devices = array();
 | 
			
		||||
$tmp_ids = array();
 | 
			
		||||
$tmp_links = array();
 | 
			
		||||
 | 
			
		||||
$tmp_link_ids = array();
 | 
			
		||||
 | 
			
		||||
$ports = dbFetchRows("SELECT
 | 
			
		||||
                             `D1`.`device_id` AS `local_device_id`,
 | 
			
		||||
@@ -161,6 +161,10 @@ foreach ($list as $items) {
 | 
			
		||||
    }
 | 
			
		||||
    $link_color = $config['map_legend'][$link_used];
 | 
			
		||||
    $tmp_links[] = array('from'=>$items['local_device_id'],'to'=>$items['remote_device_id'],'label'=>shorten_interface_type($items['local_ifname']) . ' > ' . shorten_interface_type($items['remote_ifname']),'title'=>generate_port_link($local_port, "<img src='graph.php?type=port_bits&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
 | 
			
		||||
    if (!in_array($items['remote_port_id'],$tmp_link_ids)) {
 | 
			
		||||
        $tmp_links[] = array('from'=>$items['local_device_id'],'to'=>$items['remote_device_id'],'label'=>shorten_interface_type($items['local_ifname']) . ' > ' . shorten_interface_type($items['remote_ifname']),'title'=>generate_port_link($local_port, "<img src='graph.php?type=port_bits&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
 | 
			
		||||
    }
 | 
			
		||||
    array_push($tmp_link_ids,$items['local_port_id']);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$node_devices = $tmp_devices;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user