mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Fixed the open networkmap topology.
This commit is contained in:
parent
74805b0862
commit
21adfa79b8
pandora_console/include/class
@ -170,18 +170,8 @@ abstract class Map {
|
||||
<div class="home_zoom">H</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($this->width == 0) {
|
||||
$width = "100%";
|
||||
}
|
||||
else {
|
||||
$width = $this->width . "px";
|
||||
}
|
||||
if ($this->height == 0) {
|
||||
$height = "500px";
|
||||
}
|
||||
else {
|
||||
$height = $this->height . "px";
|
||||
}
|
||||
$width = "100%";
|
||||
$height = "500px";
|
||||
|
||||
|
||||
?>
|
||||
|
@ -189,13 +189,37 @@ class Networkmap extends Map {
|
||||
|
||||
foreach ($nodes as $i => $node) {
|
||||
if ($node['graph_id'] == $graphviz_id) {
|
||||
$nodes[$i]['x'] = $items[2] * 100; //200 is for show more big
|
||||
$nodes[$i]['y'] = $items[3] * 100;
|
||||
$nodes[$i]['x'] = $items[2];
|
||||
$nodes[$i]['y'] = $items[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (($this->width > 0) && ($this->height > 0)) {
|
||||
|
||||
$max_x = 0;
|
||||
$max_y = 0;
|
||||
|
||||
foreach ($nodes as $node) {
|
||||
if ($max_x < $node['x']) {
|
||||
$max_x = $node['x'];
|
||||
}
|
||||
|
||||
if ($max_y < $node['y']) {
|
||||
$max_y = $node['y'];
|
||||
}
|
||||
}
|
||||
|
||||
$sep_x = $this->width / $max_x;
|
||||
$sep_y = $this->height / $max_y;
|
||||
|
||||
foreach ($nodes as $i => $node) {
|
||||
$nodes[$i]['x'] *= $sep_x;
|
||||
$nodes[$i]['y'] *= $sep_y;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($edges as $i => $edge) {
|
||||
$graph_id = ++$last_graph_id;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user