Fixed first painted map
Former-commit-id: 8f1098e312b4524568501a25642a533615e899f9
This commit is contained in:
parent
0920328e0a
commit
9db8078e72
pandora_console/include
|
@ -769,14 +769,13 @@ function networkmap_links_to_js_links($relations, $nodes_graph)
|
||||||
|
|
||||||
$agent = 0;
|
$agent = 0;
|
||||||
$agent2 = 0;
|
$agent2 = 0;
|
||||||
|
$control1 = false;
|
||||||
|
$control2 = false;
|
||||||
|
|
||||||
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
|
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
|
||||||
$mod1_status = db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $relation['id_parent_source_data']]);
|
if (($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) || ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD)) {
|
||||||
$mod2_status = db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $relation['id_child_source_data']]);
|
|
||||||
|
|
||||||
if (($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) || ($mod2_status == AGENT_MODULE_STATUS_CRITICAL_BAD)) {
|
|
||||||
$item['link_color'] = '#FC4444';
|
$item['link_color'] = '#FC4444';
|
||||||
} else if (($mod1_status == AGENT_MODULE_STATUS_WARNING) || ($mod2_status == AGENT_MODULE_STATUS_WARNING)) {
|
} else if (($item['status_start'] == AGENT_MODULE_STATUS_WARNING) || ($item['status_end'] == AGENT_MODULE_STATUS_WARNING)) {
|
||||||
$item['link_color'] = '#FAD403';
|
$item['link_color'] = '#FAD403';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,17 +785,23 @@ function networkmap_links_to_js_links($relations, $nodes_graph)
|
||||||
if (isset($node['id_agent'])) {
|
if (isset($node['id_agent'])) {
|
||||||
if ($node['id_agent'] == $agent) {
|
if ($node['id_agent'] == $agent) {
|
||||||
$agent = $node['id_db'];
|
$agent = $node['id_db'];
|
||||||
} else if ($node['id_agent'] == $agent2) {
|
$control1 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($node['id_agent'] == $agent2) {
|
||||||
$agent2 = $node['id_db'];
|
$agent2 = $node['id_db'];
|
||||||
|
$control2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($control1 && $control2) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($relation['child_type'] == 1) {
|
} else if ($relation['child_type'] == 1) {
|
||||||
$mod1_status = db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $relation['id_child_source_data']]);
|
if ($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
||||||
|
|
||||||
if ($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
|
||||||
$item['link_color'] = '#FC4444';
|
$item['link_color'] = '#FC4444';
|
||||||
} else if ($mod1_status == AGENT_MODULE_STATUS_WARNING) {
|
} else if ($item['status_start'] == AGENT_MODULE_STATUS_WARNING) {
|
||||||
$item['link_color'] = '#FAD403';
|
$item['link_color'] = '#FAD403';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,28 +810,41 @@ function networkmap_links_to_js_links($relations, $nodes_graph)
|
||||||
if (isset($node['id_agent'])) {
|
if (isset($node['id_agent'])) {
|
||||||
if ($node['id_agent'] == $relation['id_parent_source_data']) {
|
if ($node['id_agent'] == $relation['id_parent_source_data']) {
|
||||||
$agent = $node['id_db'];
|
$agent = $node['id_db'];
|
||||||
} else if ($node['id_agent'] == $agent2) {
|
$control1 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($node['id_agent'] == $agent2) {
|
||||||
$agent2 = $node['id_db'];
|
$agent2 = $node['id_db'];
|
||||||
|
$control2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($control1 && $control2) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($relation['parent_type'] == 1) {
|
} else if ($relation['parent_type'] == 1) {
|
||||||
$mod1_status = db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $relation['id_parent_source_data']]);
|
if ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
||||||
|
|
||||||
if ($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
|
||||||
$item['link_color'] = '#FC4444';
|
$item['link_color'] = '#FC4444';
|
||||||
} else if ($mod1_status == AGENT_MODULE_STATUS_WARNING) {
|
} else if ($item['status_end'] == AGENT_MODULE_STATUS_WARNING) {
|
||||||
$item['link_color'] = '#FAD403';
|
$item['link_color'] = '#FAD403';
|
||||||
}
|
}
|
||||||
|
|
||||||
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
||||||
|
|
||||||
foreach ($nodes_graph as $key2 => $node) {
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
if (isset($node['id_agent'])) {
|
if (isset($node['id_agent'])) {
|
||||||
if ($node['id_agent'] == $agent) {
|
if ($node['id_agent'] == $agent) {
|
||||||
$agent = $node['id_db'];
|
$agent = $node['id_db'];
|
||||||
} else if ($node['id_agent'] == $relation['id_child_source_data']) {
|
$control1 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($node['id_agent'] == $relation['id_child_source_data']) {
|
||||||
$agent2 = $node['id_db'];
|
$agent2 = $node['id_db'];
|
||||||
|
$control2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($control1 && $control2) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue