New maps in progress... (node details)

This commit is contained in:
Arturo Gonzalez 2016-03-17 10:31:18 +01:00
parent 12565ada17
commit 9d2dff71e3
2 changed files with 54 additions and 74 deletions

View File

@ -161,7 +161,7 @@ if (is_ajax ()) {
ob_start(); ob_start();
?> ?>
<div id="tooltip_{data_graph_id}"> <div id="details_{data_graph_id}">
<div class="title_bar"> <div class="title_bar">
<span class="title">{title}</span> <span class="title">{title}</span>
</div> </div>
@ -187,42 +187,57 @@ if (is_ajax ()) {
agents_get_name($id_node_data), agents_get_name($id_node_data),
$details); $details);
$agent_modules = agents_get_modules($id_node_data);
$agent_modules = array_keys($agent_modules);
$agent_interval = agents_get_interval ($id_node_data);
$agent_group = groups_get_name( $table = new stdClass();
db_get_value('id_grupo', 'tagente', 'id_agente', $id_node_data)); $table->width = '100%';
$table->class = 'databox data';
$table->head = array ();
$table->head[0] = __('Name');
$table->head[1] = __('Description');
$table->head[2] = __('Type');
$table->head[3] = __('Interval');
$table->head[4] = __('Status');
$table->rowstyle = array();
$table->style = array ();
$table->style[0] = 'font-weight: bold';
$table->align = array ();
$table->align[0] = 'center';
$table->align[1] = 'center';
$table->align[2] = 'center';
$table->align[3] = 'center';
$table->align[4] = 'center';
$table->data = array ();
foreach ($agent_modules as $module) {
$data = array ();
$status = '';
$title = '';
$module_data = db_get_all_rows_sql("SELECT nombre, id_tipo_modulo, descripcion, module_interval
FROM tagente_modulo WHERE id_agente_modulo = " . $module);
$module_data = $module_data[0];
ob_start(); $module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module);
?> modules_get_status($module_status['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title);
<span>
<strong><?php echo __('IP Address');?>: </strong> $data[0] = $module_data['nombre'];
<?php echo agents_get_address($id_node_data);?> $data[1] = $module_data['descripcion'];
</span><br /> $data[2] = '';
<span> $type = $module_data['id_tipo_modulo'];
<strong><?php echo __('OS');?>: </strong> if ($type) {
<?php echo os_get_name(agents_get_os($id_node_data));?> $data[2] = ui_print_moduletype_icon($type, true);
</span><br /> }
<span> if ($module_data['module_interval']) {
<strong><?php echo __('Description');?>: </strong> $data[3] = human_time_description_raw($module_data['module_interval']);
<?php echo db_get_value('comentarios', 'tagente', 'id_agente', $id_node_data);?> }
</span> <br/> else {
<span> $data[3] = human_time_description_raw($agent_interval);
<strong><?php echo __('Group');?>: </strong> }
<?php echo $agent_group;?> $data[4] = ui_print_status_image($status, $title, true);;
</span><br /> array_push ($table->data, $data);
<span> }
<strong><?php echo __('Agent Version');?>: </strong> $body = html_print_table ($table, true);
<?php echo db_get_value('agent_version', 'tagente', 'id_agente', $id_node_data);?>
</span><br />
<span>
<strong><?php echo __('Last Contact');?>: </strong>
<?php echo db_get_value('ultimo_contacto', 'tagente', 'id_agente', $id_node_data);?>
</span><br />
<span>
<strong><?php echo __('Remote');?>: </strong>
<?php echo db_get_value('ultimo_contacto_remoto', 'tagente', 'id_agente', $id_node_data);?>
</span>
<?php
$body = ob_get_clean();
$details = str_replace( $details = str_replace(
"{body}", "{body}",
@ -231,42 +246,7 @@ if (is_ajax ()) {
break; break;
case ITEM_TYPE_MODULE_NETWORKMAP: case ITEM_TYPE_MODULE_NETWORKMAP:
$node_data = db_get_all_rows_sql("SELECT descripcion $details = "<span>...</span>";
FROM tagente_modulo
WHERE id_agente_modulo = " . $id_node_data);
$node_data = $node_data[0];
$details = str_replace(
"{data_graph_id}",
$data_graph_id,
$details);
$details = str_replace(
"{node_id}",
$node_id,
$details);
$details = str_replace(
"{title}",
modules_get_agentmodule_name($id_node_data),
$details);
ob_start();
?>
<span>
<strong><?php echo __('Agent Name');?>: </strong>
<?php echo agents_get_name(modules_get_agentmodule_agent($id_node_data));?>
</span> <br/>
<span>
<strong><?php echo __('Description');?>: </strong>
<?php echo db_get_value('descripcion', 'tagente_modulo', 'id_agente_modulo', $id_node_data);?>
</span> <br/>
<?php
$body = ob_get_clean();
$details = str_replace(
"{body}",
$body,
$details);
break; break;
} }

View File

@ -1310,7 +1310,7 @@ MapController.prototype.nodeGetDetails = function(self, target) {
jQuery.ajax ({ jQuery.ajax ({
data: params, data: params,
dataType: "html", dataType: "JSON",
type: "POST", type: "POST",
url: "ajax.php", url: "ajax.php",
success: function (data) { success: function (data) {