From 43e5fea9e5bc835042e9e30dccc32f969ca21581 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 14 Aug 2010 20:20:35 +0000 Subject: [PATCH] unflatten map when flat map is ugly (>10 links?) git-svn-id: http://www.observium.org/svn/observer/trunk@1685 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/map.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/html/map.php b/html/map.php index 50891cca1d..5c49d1ea66 100755 --- a/html/map.php +++ b/html/map.php @@ -2,6 +2,8 @@ ### FIXME : remove link when port/host is not in the database (things /seen/ but not *discovered*) +$links = 1; + include("../includes/defaults.inc.php"); include("../config.php"); include("../includes/functions.php"); @@ -66,6 +68,8 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) { $linkdone[] = "$local_interface_id $remote_interface_id"; + $links++; + if($link['ifSpeed'] >= "10000000000") { $info = "color=red3 style=\"setlinewidth(6)\""; @@ -138,8 +142,12 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) $_GET['format'] = 'png'; } - #$maptool = 'unflatten -f -l 5 |dot'; - $maptool = 'dot'; + if($links > 10) ### Unflatten if there are more than 10 links. beyond that it gets messy + { + $maptool = 'unflatten -f -l 5 |dot'; + } else { + $maptool = 'dot'; + } if ($where == '') { $maptool = 'neato -Gpack'; }