New maps in progress... (tooltips data and click events)

This commit is contained in:
Arturo Gonzalez 2016-02-24 14:28:13 +01:00
parent 6d7286ec6f
commit 799730c48d
2 changed files with 18 additions and 5 deletions

View File

@ -39,8 +39,13 @@ if (is_ajax ()) {
WHERE id_agente = " . $id_node_data); WHERE id_agente = " . $id_node_data);
$node_data = $node_data[0]; $node_data = $node_data[0];
if (!empty($node_data)) { if (!empty($node_data)) {
$return_data .= '<div id="open_close_click_"' . $data_graph_id . '>';
$return_data .= '<span><strong>Agent: </strong>' . $node_data['nombre'] . '</span>';
/*-----------------PROVISIONAL, HABRÁ QUE METER ICONOS DE VERDAD------------------*/
/*-*/$return_data .= '<span class="close_click" onClick="close_button_tooltip()" style="float:right;">| X </span>';/*-*/
/*-*/$return_data .= '<span class="open_click" style="float:right;"> -> |</span>';/*-*/
/*--------------------------------------------------------------------------------*/
$return_data .= '<div id="agent_data_to_show_"' . $node_data['id_agente'] .'>'; $return_data .= '<div id="agent_data_to_show_"' . $node_data['id_agente'] .'>';
$return_data .= '<span><strong>Agent: </strong>' . $node_data['nombre'] . '</span></br>';
$return_data .= '<span><strong>IP Addres: </strong>' . $node_data['direccion'] . '</span></br>'; $return_data .= '<span><strong>IP Addres: </strong>' . $node_data['direccion'] . '</span></br>';
$agent_os = db_get_row_sql("SELECT name FROM tconfig_os WHERE id_os = " . $node_data['id_os']); $agent_os = db_get_row_sql("SELECT name FROM tconfig_os WHERE id_os = " . $node_data['id_os']);
$agent_os = $agent_os['name']; $agent_os = $agent_os['name'];

View File

@ -180,7 +180,6 @@ Return void
This function paint the nodes This function paint the nodes
*/ */
MapController.prototype.paint_nodes = function() { MapController.prototype.paint_nodes = function() {
this._viewport.selectAll(".node") this._viewport.selectAll(".node")
.data(nodes) .data(nodes)
.enter() .enter()
@ -267,9 +266,6 @@ MapController.prototype.click_event = function(event) {
if ($(event.currentTarget).parent().hasClass("node")) { if ($(event.currentTarget).parent().hasClass("node")) {
self.tooltip_map_create(self, event); self.tooltip_map_create(self, event);
} }
else {
self.tooltip_map_close();
}
break; break;
case 2: case 2:
break; break;
@ -374,3 +370,15 @@ MapController.prototype.nodeData = function(data_id, type, id_map, data_graph_id
} }
}); });
} }
/*-----------------------------------------------*/
/*-------------------Functions-------------------*/
/*-----------------------------------------------*/
/**
Function close_button_tooltip
Return void
This function hide the tooltip
*/
function close_button_tooltip() {
console.log($(this));
}