diff --git a/pandora_console/include/ajax/map.ajax.php b/pandora_console/include/ajax/map.ajax.php index 96995389c7..9a9e45fa0d 100644 --- a/pandora_console/include/ajax/map.ajax.php +++ b/pandora_console/include/ajax/map.ajax.php @@ -16,56 +16,94 @@ // Only accesible by ajax if (is_ajax ()) { global $config; - + // Login check check_login (); - - require_once($config['homedir'] . "/include/class/Node.class.php"); - + + require_once($config['homedir'] . "/include/functions_os.php"); + + $getNodeData = (bool)get_parameter('getNodeData', 0); - + if ($getNodeData) { $id_node_data = (int)get_parameter('id_node_data'); $type = (int)get_parameter('type'); $id_map = (int)get_parameter('id_map'); $data_graph_id = (int)get_parameter('data_graph_id'); $node_id = get_parameter('node_id'); - - $return_data = ''; - + + ob_start(); + ?> +
+
+ {title} + + + +
+
+ {body} +
+
+ '; - $return_data .= '
'; - $return_data .= 'Agent: ' . $node_data['nombre'] . ''; - $return_data .= '| X '; - $return_data .= ' -> |'; - $return_data .= '
'; - - $return_data .= '
'; - $return_data .= 'IP Addres: ' . $node_data['direccion'] . '
'; - $agent_os = db_get_row_sql("SELECT name FROM tconfig_os WHERE id_os = " . $node_data['id_os']); - $agent_os = $agent_os['name']; - $return_data .= 'OS: ' . $agent_os . ' ' . $node_data['os_version'] .'
'; - $return_data .= 'Description: ' . $node_data['comentarios'] . '
'; - $agent_group = db_get_row_sql("SELECT nombre FROM tgrupo WHERE id_grupo = " . $node_data['id_grupo']); - $agent_group = $agent_group['nombre']; - $return_data .= 'Group: ' . $agent_group . '
'; - $return_data .= 'Agent Version: ' . $node_data['agent_version'] . '
'; - $return_data .= 'Last Contact: ' . $node_data['ultimo_contacto'] . '
'; - $return_data .= 'Remote: ' . $node_data['ultimo_contacto_remoto'] . ''; - $return_data .= '
'; - $return_data .= ''; - } - else { - $return_data = 'No data to show'; - } + $return_data = str_replace( + "{data_graph_id}", + $data_graph_id, + $return_data); + $return_data = str_replace( + "{node_id}", + $node_id, + $return_data); + $return_data = str_replace( + "{title}", + agents_get_name($id_node_data), + $return_data); + + + $agent_group = groups_get_name( + db_get_value('id_grupo', 'tagente', 'id_agente', $id_node_data)); + + ob_start(); + ?> + + : + +
+ + : + +
+ + : + +
+ + : + +
+ + : + +
+ + : + +
+ + : + + + | X '; $return_data .= ' -> |'; $return_data .= ''; - + $return_data .= '
'; $agent_module = db_get_row_sql("SELECT nombre FROM tagente WHERE id_agente = " . $node_data['id_agente']); $agent_module = $agent_module['nombre']; @@ -94,7 +132,7 @@ if (is_ajax ()) { } break; } - + sleep(1); echo json_encode($return_data); return; diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php index e12ebd51a0..e34f7aef24 100644 --- a/pandora_console/include/class/Map.class.php +++ b/pandora_console/include/class/Map.class.php @@ -132,7 +132,44 @@ abstract class Map { $this->writeJSGraph(); ?> - +