2011-08-17 Dario Rodriguez <dario.rodriguez@artica.es>

* include/functions_networkmap.php: Fixed a bug with topology map



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2011-08-17 15:16:54 +00:00
parent 544c2ad120
commit 2cf5d35f17
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-08-17 Dario Rodriguez <dario.rodriguez@artica.es>
* include/functions_networkmap.php: Fixed a bug with topology map
2011-08-17 Javier Lanz <javier.lanz@artica.es>
* operation/snmpconsole/snmp_view.php: Fixed an style icon small bug

View File

@ -73,10 +73,20 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
$nodes = array ();
$node_count = 1;
// Add node
$node_ref = array();
foreach ($agents as $agent) {
// Add node
$node_ref[$agent['id_agente']] = $node_count;
$node_count++;
}
$node_count = 1;
foreach ($agents as $agent) {
// Save node parent information to define edges later
if ($agent['id_parent'] != "0") {
$parents[$node_count] = $agent['id_parent'];
$parents[$node_count] = $node_ref[$agent['id_parent']];
} else {
$orphans[$node_count] = 1;
}