From bdc4deb4355c5a81f7bbd6fe2e35e02fe72978f8 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 1 Jun 2015 23:27:41 +0100 Subject: [PATCH 1/8] Updated to use mac address data --- html/includes/print-map.inc.php | 66 ++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index c8fcf1249..6902db4b1 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -36,13 +36,66 @@ foreach (dbFetchRows("SELECT DISTINCT least(`devices`.`device_id`, `remote_devic array_push($tmp_ids,$link_devices['remote_device_id']); } -$tmp_ids = implode(',',$tmp_ids); - -$nodes = json_encode($tmp_devices); +$tmp_exp_ids = implode(',',$tmp_ids); + +$port_ids = array(); +foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL", array()) as $macs) { + if (!in_array($macs['local_port_id'], $port_ids) && port_permitted($macs['local_port_id'])) { + $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($macs['local_port_id'])); + $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['local_port_id'])); + if (!in_array($port_dev['device_id'],$tmp_ids)) { + $mac_devices[] = array('id'=>$port_dev['device_id'], 'label'=>$port_dev['hostname'], 'title'=>generate_device_link($port_dev,'',array(),'','','',0),'group'=>$port_dev['location'], 'shape'=>'box'); + array_push($port_ids, $port_dev['device_id']); + $port_data = $port_det; + $from = $port_dev['device_id']; + $port = shorten_interface_type($port_det['ifName']); + $speed = $port_det['ifSpeed']/1000/1000; + if ($speed == 100) { + $width = 3; + } elseif ($speed == 1000) { + $width = 5; + } elseif ($speed == 10000) { + $width = 10; + } elseif ($speed == 40000) { + $width = 15; + } elseif ($speed == 100000) { + $width = 20; + } else { + $width = 1; + } + $link_in_used = ($port_det['ifInOctets_rate'] * 8) / $port_det['ifSpeed'] * 100; + $link_out_used = ($port_det['ifOutOctets_rate'] * 8) / $port_det['ifSpeed'] * 100; + if ($link_in_used > $link_out_used) { + $link_used = $link_in_used; + } else { + $link_used = $link_out_used; + } + $link_used = round($link_used, -1); + if ($link_used > 100) { + $link_used = 100; + } + $link_color = $config['map_legend'][$link_used]; + } + } + if (!in_array($macs['remote_port_id'], $port_ids) && port_permitted($macs['remote_port_id'])) { + $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($macs['remote_port_id'])); + $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['remote_port_id'])); + if (!in_array($port_dev['device_id'],$tmp_ids)) { + $mac_devices[] = array('id'=>$port_dev['device_id'], 'label'=>$port_dev['hostname'], 'title'=>generate_device_link($port_dev,'',array(),'','','',0),'group'=>$port_dev['location'], 'shape'=>'box'); + array_push($port_ids, $port_dev['device_id']); + $to = $port_dev['device_id']; + $port .= ' > ' . shorten_interface_type($port_det['ifName']); + } + } + $tmp_links[] = array('from'=>$from,'to'=>$to,'label'=>$port,'title'=>generate_port_link($port_data, "",'',0,1),'width'=>$width,'color'=>$link_color); +} + +$node_devices = array_merge($tmp_devices,$mac_devices); +$nodes = json_encode($node_devices); if (is_array($tmp_devices[0])) { $tmp_links = array(); - foreach (dbFetchRows("SELECT local_device_id, remote_device_id, `remote_hostname`,`ports`.*, `remote_port` FROM `links` LEFT JOIN `ports` ON `local_port_id`=`ports`.`port_id` LEFT JOIN `devices` ON `ports`.`device_id`=`devices`.`device_id` WHERE (`local_device_id` IN ($tmp_ids) AND `remote_device_id` IN ($tmp_ids))") as $link_devices) { + foreach (dbFetchRows("SELECT local_device_id, remote_device_id, `remote_hostname`,`ports`.*, `remote_port` FROM `links` LEFT JOIN `ports` ON `local_port_id`=`ports`.`port_id` LEFT JOIN `devices` ON `ports`.`device_id`=`devices`.`device_id` WHERE (`local_device_id` IN ($tmp_exp_ids) AND `remote_device_id` IN ($tmp_exp_ids))") as $link_devices) { foreach ($tmp_devices as $k=>$v) { if ($v['id'] == $link_devices['local_device_id']) { $from = $v['id']; @@ -85,6 +138,8 @@ if (is_array($tmp_devices[0])) { } $edges = json_encode($tmp_links); +} + ?> @@ -147,7 +202,6 @@ network.redraw(); From 988cb3b2407ed533d8f30f890aafb256e6da1994 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 2 Jun 2015 00:03:06 +0100 Subject: [PATCH 2/8] Last update to get map working for mac addresses --- html/includes/print-map.inc.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index 6902db4b1..fb1d16f70 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -16,6 +16,8 @@ $tmp_devices = array(); if (!empty($device['hostname'])) { $sql = ' WHERE `devices`.`hostname`=?'; $sql_array = array($device['hostname']); + $mac_sql = ' AND `D`.`hostname` = ?'; + $mac_array = array($device['hostname']); } else { $sql = ' WHERE 1'; } @@ -39,13 +41,15 @@ foreach (dbFetchRows("SELECT DISTINCT least(`devices`.`device_id`, `remote_devic $tmp_exp_ids = implode(',',$tmp_ids); $port_ids = array(); -foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL", array()) as $macs) { +$port_devices = array(); +foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` LEFT JOIN `devices` AS `D` ON `P`.`device_id`=`D`.`device_id` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL $mac_sql", $mac_array) as $macs) { if (!in_array($macs['local_port_id'], $port_ids) && port_permitted($macs['local_port_id'])) { - $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($macs['local_port_id'])); $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['local_port_id'])); - if (!in_array($port_dev['device_id'],$tmp_ids)) { + $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($port_det['device_id'])); + if (!in_array($port_dev['device_id'],$tmp_ids) && !in_array($port_dev['device_id'],$port_devices)) { $mac_devices[] = array('id'=>$port_dev['device_id'], 'label'=>$port_dev['hostname'], 'title'=>generate_device_link($port_dev,'',array(),'','','',0),'group'=>$port_dev['location'], 'shape'=>'box'); - array_push($port_ids, $port_dev['device_id']); + array_push($port_ids, $port_det['port_id']); + array_push($port_devices, $port_dev['device_id']); $port_data = $port_det; $from = $port_dev['device_id']; $port = shorten_interface_type($port_det['ifName']); @@ -78,11 +82,12 @@ foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `re } } if (!in_array($macs['remote_port_id'], $port_ids) && port_permitted($macs['remote_port_id'])) { - $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($macs['remote_port_id'])); $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['remote_port_id'])); - if (!in_array($port_dev['device_id'],$tmp_ids)) { + $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($port_det['device_id'])); + if (!in_array($port_dev['device_id'],$tmp_ids) && !in_array($port_dev['device_id'],$port_devices)) { $mac_devices[] = array('id'=>$port_dev['device_id'], 'label'=>$port_dev['hostname'], 'title'=>generate_device_link($port_dev,'',array(),'','','',0),'group'=>$port_dev['location'], 'shape'=>'box'); - array_push($port_ids, $port_dev['device_id']); + array_push($port_ids, $port_det['port_id']); + array_push($port_devices, $port_dev['device_id']); $to = $port_dev['device_id']; $port .= ' > ' . shorten_interface_type($port_det['ifName']); } @@ -94,7 +99,6 @@ $node_devices = array_merge($tmp_devices,$mac_devices); $nodes = json_encode($node_devices); if (is_array($tmp_devices[0])) { - $tmp_links = array(); foreach (dbFetchRows("SELECT local_device_id, remote_device_id, `remote_hostname`,`ports`.*, `remote_port` FROM `links` LEFT JOIN `ports` ON `local_port_id`=`ports`.`port_id` LEFT JOIN `devices` ON `ports`.`device_id`=`devices`.`device_id` WHERE (`local_device_id` IN ($tmp_exp_ids) AND `remote_device_id` IN ($tmp_exp_ids))") as $link_devices) { foreach ($tmp_devices as $k=>$v) { if ($v['id'] == $link_devices['local_device_id']) { @@ -136,10 +140,9 @@ if (is_array($tmp_devices[0])) { $tmp_links[] = array('from'=>$from,'to'=>$to,'label'=>$port,'title'=>generate_port_link($port_data, "",'',0,1),'width'=>$width,'color'=>$link_color); } - - $edges = json_encode($tmp_links); } +$edges = json_encode($tmp_links); ?> From f0395e453eb4cfcabc431a9a4005d2e47a0cb9cc Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 2 Jun 2015 00:37:34 +0100 Subject: [PATCH 3/8] Final final updates to get better map support --- html/includes/print-map.inc.php | 10 +++++++++- html/includes/print-menubar.php | 8 -------- html/pages/device.inc.php | 4 ---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index fb1d16f70..bfadc788d 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -42,7 +42,7 @@ $tmp_exp_ids = implode(',',$tmp_ids); $port_ids = array(); $port_devices = array(); -foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` LEFT JOIN `devices` AS `D` ON `P`.`device_id`=`D`.`device_id` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL $mac_sql", $mac_array) as $macs) { +foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` LEFT JOIN `devices` AS `D` ON `P`.`device_id`=`D`.`device_id` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL AND `M`.`port_id` != 0 AND `P`.`port_id` != 0 $mac_sql", $mac_array) as $macs) { if (!in_array($macs['local_port_id'], $port_ids) && port_permitted($macs['local_port_id'])) { $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['local_port_id'])); $port_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id`=?", array($port_det['device_id'])); @@ -143,6 +143,8 @@ if (is_array($tmp_devices[0])) { } $edges = json_encode($tmp_links); + +if (count($node_devices) > 1 && count($tmp_links) > 0) { ?> @@ -205,6 +207,12 @@ network.redraw(); diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index ca30ad6c3..ab43b2a9e 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -147,17 +147,9 @@ if ($config['show_locations'])
  • Delete Device
  • '); } -if ($links['count'] > 0) { - ?>
  • Network Map Network Map
  • - - diff --git a/html/pages/device.inc.php b/html/pages/device.inc.php index c72daf9bf..245c29dd3 100644 --- a/html/pages/device.inc.php +++ b/html/pages/device.inc.php @@ -256,15 +256,11 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) '); } - if ($_SESSION['userlevel'] >= "5" && dbFetchCell("SELECT COUNT(*) FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.port_id = L.local_port_id")) - { - $discovery_links = TRUE; echo('
  • Map
  • '); - } if (@dbFetchCell("SELECT COUNT(*) FROM `packages` WHERE device_id = '".$device['device_id']."'") > '0') { From 841cb803b3fc8f9e244e46973e9c142ff8f47e50 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 2 Jun 2015 00:50:09 +0100 Subject: [PATCH 4/8] Some tidying up of variables/array --- html/includes/print-map.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index bfadc788d..1e4311351 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -42,6 +42,7 @@ $tmp_exp_ids = implode(',',$tmp_ids); $port_ids = array(); $port_devices = array(); +$tmp_links = array(); foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `remote_port_id`, GREATEST(`P`.`port_id`,`M`.`port_id`) AS `local_port_id` FROM `ipv4_mac` AS `M` LEFT JOIN `ports` AS `P` ON `M`.`mac_address` = `P`.`ifPhysAddress` LEFT JOIN `devices` AS `D` ON `P`.`device_id`=`D`.`device_id` WHERE `P`.`port_id` IS NOT NULL AND `M`.`port_id` IS NOT NULL AND `M`.`port_id` != 0 AND `P`.`port_id` != 0 $mac_sql", $mac_array) as $macs) { if (!in_array($macs['local_port_id'], $port_ids) && port_permitted($macs['local_port_id'])) { $port_det = dbFetchRow("SELECT * FROM `ports` WHERE `port_id`=?", array($macs['local_port_id'])); @@ -93,6 +94,7 @@ foreach (dbFetchRows("SELECT DISTINCT LEAST(`M`.`port_id`, `P`.`port_id`) AS `re } } $tmp_links[] = array('from'=>$from,'to'=>$to,'label'=>$port,'title'=>generate_port_link($port_data, "",'',0,1),'width'=>$width,'color'=>$link_color); + unset($port); } $node_devices = array_merge($tmp_devices,$mac_devices); From 69c2b3521227f568d4f2d20938ceb1072afefbee Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 14 Jul 2015 12:13:17 +0100 Subject: [PATCH 5/8] Added restriction for device_id --- html/includes/print-map.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index a973f27e7..c9fc541d1 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -61,7 +61,7 @@ foreach (dbFetchRows("SELECT LEFT JOIN `ports` AS `P2` ON `P2`.`port_id`=`links`.`remote_port_id` WHERE `active`=1 - AND `remote_device_id`!=0 + $sql ",$sql_array) as $items) { $local_device = array('device_id'=>$items['local_device_id'], 'os'=>$items['local_os'], 'hostname'=>$items['local_hostname']); $remote_device = array('device_id'=>$items['remote_device_id'], 'os'=>$items['remote_os'], 'hostname'=>$items['remote_hostname']); From dfcf5c912a8a0f68d53358c06926dcf4bd024897 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 14 Jul 2015 12:15:05 +0100 Subject: [PATCH 6/8] Updated where queries --- html/includes/print-map.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index c9fc541d1..6fc83465b 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -17,12 +17,12 @@ $row_colour="#ffffff"; $sql_array= array(); if (!empty($device['hostname'])) { - $sql = ' WHERE `devices`.`hostname`=?'; + $sql = ' `devices`.`hostname`=?'; $sql_array = array($device['hostname']); $mac_sql = ' AND `D`.`hostname` = ?'; $mac_array = array($device['hostname']); } else { - $sql = ' WHERE 1'; + $sql = ' '; } $sql .= ' AND `local_device_id` != 0 AND `remote_device_id` != 0 '; From 746f918a8a395ee3ff23a4a6fffe29f78a1f65a2 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 14 Jul 2015 13:11:54 +0100 Subject: [PATCH 7/8] More map updates --- html/includes/print-map.inc.php | 84 ++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index 6fc83465b..45a814e25 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -17,21 +17,62 @@ $row_colour="#ffffff"; $sql_array= array(); if (!empty($device['hostname'])) { - $sql = ' `devices`.`hostname`=?'; - $sql_array = array($device['hostname']); + $sql = ' AND (`D1`.`hostname`=? OR `D2`.`hostname`=?)'; + $sql_array = array($device['hostname'], $device['hostname']); $mac_sql = ' AND `D`.`hostname` = ?'; $mac_array = array($device['hostname']); } else { $sql = ' '; } -$sql .= ' AND `local_device_id` != 0 AND `remote_device_id` != 0 '; -$sql .= ' AND `local_device_id` IS NOT NULL AND `remote_device_id` IS NOT NULL '; +if (is_admin() === false && is_read() === false) { + $join_sql .= ' LEFT JOIN `devices_perms` AS `DP` ON `D1`.`device_id` = `DP`.`device_id`'; + $sql .= ' AND `DP`.`user_id`=?'; + $sql_array[] = $_SESSION['user_id']; +} $tmp_devices = array(); $tmp_ids = array(); $tmp_links = array(); -foreach (dbFetchRows("SELECT + + +$ports = dbFetchRows("SELECT + `D1`.`device_id` AS `local_device_id`, + `D1`.`os` AS `local_os`, + `D1`.`hostname` AS `local_hostname`, + `D2`.`device_id` AS `remote_device_id`, + `D2`.`os` AS `remote_os`, + `D2`.`hostname` AS `remote_hostname`, + `P1`.`port_id` AS `local_port_id`, + `P1`.`device_id` AS `local_port_device_id`, + `P1`.`ifName` AS `local_ifname`, + `P1`.`ifSpeed` AS `local_ifspeed`, + `P1`.`ifOperStatus` AS `local_ifoperstatus`, + `P1`.`ifAdminStatus` AS `local_ifadminstatus`, + `P1`.`ifInOctets_rate` AS `local_ifinoctets_rate`, + `P1`.`ifOutOctets_rate` AS `local_ifoutoctets_rate`, + `P2`.`port_id` AS `remote_port_id`, + `P2`.`device_id` AS `remote_port_device_id`, + `P2`.`ifName` AS `remote_ifname`, + `P2`.`ifSpeed` AS `remote_ifspeed`, + `P2`.`ifOperStatus` AS `remote_ifoperstatus`, + `P2`.`ifAdminStatus` AS `remote_ifadminstatus`, + `P2`.`ifInOctets_rate` AS `remote_ifinoctets_rate`, + `P2`.`ifOutOctets_rate` AS `remote_ifoutoctets_rate` + FROM `ipv4_mac` AS `M` + LEFT JOIN `ports` AS `P1` ON `P1`.`port_id`=`M`.`port_id` + LEFT JOIN `ports` AS `P2` ON `P2`.`ifPhysAddress`=`M`.`mac_address` + LEFT JOIN `devices` AS `D1` ON `P1`.`device_id`=`D1`.`device_id` + LEFT JOIN `devices` AS `D2` ON `P2`.`device_id`=`D2`.`device_id` + $join_sql + WHERE + `P1`.`port_id` IS NOT NULL AND + `P2`.`port_id` IS NOT NULL AND + `D1`.`device_id` != `D2`.`device_id` + $sql + ", $sql_array); + +$devices = dbFetchRows("SELECT `D1`.`device_id` AS `local_device_id`, `D1`.`os` AS `local_os`, `D1`.`hostname` AS `local_hostname`, @@ -59,10 +100,19 @@ foreach (dbFetchRows("SELECT LEFT JOIN `devices` AS `D2` ON `D2`.`device_id`=`links`.`remote_device_id` LEFT JOIN `ports` AS `P1` ON `P1`.`port_id`=`links`.`local_port_id` LEFT JOIN `ports` AS `P2` ON `P2`.`port_id`=`links`.`remote_port_id` + $join_sql WHERE - `active`=1 + `active`=1 AND + `local_device_id` != 0 AND + `remote_device_id` != 0 AND + `local_device_id` IS NOT NULL AND + `remote_device_id` IS NOT NULL $sql - ",$sql_array) as $items) { + ", $sql_array); + +$list = array_merge($ports,$devices); + +foreach ($list as $items) { $local_device = array('device_id'=>$items['local_device_id'], 'os'=>$items['local_os'], 'hostname'=>$items['local_hostname']); $remote_device = array('device_id'=>$items['remote_device_id'], 'os'=>$items['remote_os'], 'hostname'=>$items['remote_hostname']); @@ -77,7 +127,7 @@ foreach (dbFetchRows("SELECT } array_push($tmp_ids,$items['local_device_id']); array_push($tmp_ids,$items['remote_device_id']); - $speed = $items['ifSpeed']/1000/1000; + $speed = $items['local_ifspeed']/1000/1000; if ($speed == 100) { $width = 3; } elseif ($speed == 1000) { @@ -117,7 +167,8 @@ if (count($node_devices) > 1 && count($tmp_links) > 0) {
    - Date: Tue, 14 Jul 2015 13:15:37 +0100 Subject: [PATCH 8/8] set width 100% for network map --- html/css/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/css/styles.css b/html/css/styles.css index 94697ff52..69ae991a8 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1588,7 +1588,7 @@ tr.search:nth-child(odd) { } #visualization { - width: 90%; + width: 100%; min-height: 600px; }