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
This commit is contained in:
Adam Amstrong
2010-08-14 20:20:35 +00:00
parent 79db0b9823
commit 43e5fea9e5

View File

@@ -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'; }