#9880 Fixed network usage map

This commit is contained in:
Daniel Maya 2022-11-29 15:41:10 +01:00
parent ab2a00b248
commit c0e5706d85
3 changed files with 17 additions and 7 deletions

View File

@ -2215,7 +2215,9 @@ class NetworkMap
// Store relationships.
$this->relations = array_merge($edges, $orphans);
} else {
$this->relations = $edges;
if (empty($this->relations) === true && empty($this->$edges) === false) {
$this->relations = $edges;
}
}
// Close dot file.
@ -2409,6 +2411,13 @@ class NetworkMap
);
}
if (isset($this->mapOptions['map_filter']['node_separation']) === true) {
foreach ($graph['nodes'] as $key => $value) {
$graph['nodes'][$key]['x'] *= $this->mapOptions['map_filter']['node_separation'];
$graph['nodes'][$key]['y'] *= $this->mapOptions['map_filter']['node_separation'];
}
}
unlink($filename_plain);
/*

View File

@ -4367,7 +4367,6 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$status = modules_get_agentmodule_status($key);
switch ($status) {
case 0:
case 4:
case 300:
$status = 'normal';
break;
@ -4386,6 +4385,7 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$status = 'unknown';
break;
case 4:
case 5:
$status = 'notinit';
break;

View File

@ -124,8 +124,9 @@ function network_general_map_configuration($nodes, $relations)
'map_options' => [
'generation_method' => LAYOUT_SPRING1,
'map_filter' => [
'node_radius' => 40,
'node_sep' => 7,
'node_radius' => 40,
'node_sep' => 7,
'node_separation' => 5,
],
],
];
@ -171,8 +172,8 @@ function network_init_node_map($name)
return [
'name' => $name,
'type' => NODE_GENERIC,
'width' => 20,
'height' => 20,
'status' => '#82B92E',
'width' => 40,
'height' => 40,
'status' => 0,
];
}