mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
New maps in progress... (Node details finished)
This commit is contained in:
parent
9d2dff71e3
commit
56cadb2037
@ -154,8 +154,6 @@ if (is_ajax ()) {
|
|||||||
}
|
}
|
||||||
else if ($getNodeDetails) {
|
else if ($getNodeDetails) {
|
||||||
$id_node_data = (int)get_parameter('id_node_data');
|
$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');
|
$data_graph_id = (int)get_parameter('data_graph_id');
|
||||||
$node_id = get_parameter('node_id');
|
$node_id = get_parameter('node_id');
|
||||||
|
|
||||||
@ -172,83 +170,75 @@ if (is_ajax ()) {
|
|||||||
<?php
|
<?php
|
||||||
$details = ob_get_clean();
|
$details = ob_get_clean();
|
||||||
|
|
||||||
switch ($type) {
|
$details = str_replace(
|
||||||
case ITEM_TYPE_AGENT_NETWORKMAP:
|
"{data_graph_id}",
|
||||||
$details = str_replace(
|
$data_graph_id,
|
||||||
"{data_graph_id}",
|
$details);
|
||||||
$data_graph_id,
|
$details = str_replace(
|
||||||
$details);
|
"{node_id}",
|
||||||
$details = str_replace(
|
$node_id,
|
||||||
"{node_id}",
|
$details);
|
||||||
$node_id,
|
$details = str_replace(
|
||||||
$details);
|
"{title}",
|
||||||
$details = str_replace(
|
agents_get_name($id_node_data),
|
||||||
"{title}",
|
$details);
|
||||||
agents_get_name($id_node_data),
|
|
||||||
$details);
|
|
||||||
|
|
||||||
$agent_modules = agents_get_modules($id_node_data);
|
$agent_modules = agents_get_modules($id_node_data);
|
||||||
$agent_modules = array_keys($agent_modules);
|
$agent_modules = array_keys($agent_modules);
|
||||||
$agent_interval = agents_get_interval ($id_node_data);
|
$agent_interval = agents_get_interval ($id_node_data);
|
||||||
|
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox data';
|
$table->class = 'databox data';
|
||||||
$table->head = array ();
|
$table->head = array ();
|
||||||
$table->head[0] = __('Name');
|
$table->head[0] = __('Name');
|
||||||
$table->head[1] = __('Description');
|
$table->head[1] = __('Description');
|
||||||
$table->head[2] = __('Type');
|
$table->head[2] = __('Type');
|
||||||
$table->head[3] = __('Interval');
|
$table->head[3] = __('Interval');
|
||||||
$table->head[4] = __('Status');
|
$table->head[4] = __('Status');
|
||||||
$table->rowstyle = array();
|
$table->rowstyle = array();
|
||||||
$table->style = array ();
|
$table->style = array ();
|
||||||
$table->style[0] = 'font-weight: bold';
|
$table->style[0] = 'font-weight: bold';
|
||||||
$table->align = array ();
|
$table->align = array ();
|
||||||
$table->align[0] = 'center';
|
$table->align[0] = 'center';
|
||||||
$table->align[1] = 'center';
|
$table->align[1] = 'center';
|
||||||
$table->align[2] = 'center';
|
$table->align[2] = 'center';
|
||||||
$table->align[3] = 'center';
|
$table->align[3] = 'center';
|
||||||
$table->align[4] = 'center';
|
$table->align[4] = 'center';
|
||||||
$table->data = array ();
|
$table->data = array ();
|
||||||
foreach ($agent_modules as $module) {
|
foreach ($agent_modules as $module) {
|
||||||
$data = array ();
|
$data = array ();
|
||||||
$status = '';
|
$status = '';
|
||||||
$title = '';
|
$title = '';
|
||||||
$module_data = db_get_all_rows_sql("SELECT nombre, id_tipo_modulo, descripcion, module_interval
|
$module_data = db_get_all_rows_sql("SELECT nombre, id_tipo_modulo, descripcion, module_interval
|
||||||
FROM tagente_modulo WHERE id_agente_modulo = " . $module);
|
FROM tagente_modulo WHERE id_agente_modulo = " . $module);
|
||||||
$module_data = $module_data[0];
|
$module_data = $module_data[0];
|
||||||
|
|
||||||
$module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module);
|
$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);
|
modules_get_status($module_status['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title);
|
||||||
|
|
||||||
$data[0] = $module_data['nombre'];
|
$data[0] = $module_data['nombre'];
|
||||||
$data[1] = $module_data['descripcion'];
|
$data[1] = $module_data['descripcion'];
|
||||||
$data[2] = '';
|
$data[2] = '';
|
||||||
$type = $module_data['id_tipo_modulo'];
|
$type = $module_data['id_tipo_modulo'];
|
||||||
if ($type) {
|
if ($type) {
|
||||||
$data[2] = ui_print_moduletype_icon($type, true);
|
$data[2] = ui_print_moduletype_icon($type, true);
|
||||||
}
|
}
|
||||||
if ($module_data['module_interval']) {
|
if ($module_data['module_interval']) {
|
||||||
$data[3] = human_time_description_raw($module_data['module_interval']);
|
$data[3] = human_time_description_raw($module_data['module_interval']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data[3] = human_time_description_raw($agent_interval);
|
$data[3] = human_time_description_raw($agent_interval);
|
||||||
}
|
}
|
||||||
$data[4] = ui_print_status_image($status, $title, true);;
|
$data[4] = ui_print_status_image($status, $title, true);;
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
|
||||||
$body = html_print_table ($table, true);
|
|
||||||
|
|
||||||
$details = str_replace(
|
|
||||||
"{body}",
|
|
||||||
$body,
|
|
||||||
$details);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ITEM_TYPE_MODULE_NETWORKMAP:
|
|
||||||
$details = "<span>...</span>";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
$body = html_print_table ($table, true);
|
||||||
|
|
||||||
|
$details = str_replace(
|
||||||
|
"{body}",
|
||||||
|
$body,
|
||||||
|
$details);
|
||||||
|
|
||||||
echo json_encode($details);
|
echo json_encode($details);
|
||||||
return;
|
return;
|
||||||
|
@ -1095,7 +1095,11 @@ MapController.prototype.init_events = function(principalObject) {
|
|||||||
{
|
{
|
||||||
title: 'Show details',
|
title: 'Show details',
|
||||||
action: function(elm, d, i) {
|
action: function(elm, d, i) {
|
||||||
self.nodeGetDetails(self, elm);
|
var nodeTarget = $(elm);
|
||||||
|
var type = parseInt(nodeTarget.data("type"));
|
||||||
|
if (type == 0) {
|
||||||
|
self.nodeGetDetails(self, elm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1294,16 +1298,12 @@ MapController.prototype.editMap = function(self, target) {
|
|||||||
MapController.prototype.nodeGetDetails = function(self, target) {
|
MapController.prototype.nodeGetDetails = function(self, target) {
|
||||||
var nodeTarget = $(target);
|
var nodeTarget = $(target);
|
||||||
var node_id = nodeTarget.attr("id");
|
var node_id = nodeTarget.attr("id");
|
||||||
var type = parseInt(nodeTarget.data("type"));
|
|
||||||
var data_id = parseInt(nodeTarget.data("id"));
|
var data_id = parseInt(nodeTarget.data("id"));
|
||||||
var data_graph_id = parseInt(nodeTarget.data("graph_id"));
|
var data_graph_id = parseInt(nodeTarget.data("graph_id"));
|
||||||
var id_map = self._id;
|
|
||||||
|
|
||||||
var params = {};
|
var params = {};
|
||||||
params["getNodeDetails"] = 1;
|
params["getNodeDetails"] = 1;
|
||||||
params["id_node_data"] = data_id;
|
params["id_node_data"] = data_id;
|
||||||
params["type"] = type;
|
|
||||||
params["id_map"] = id_map;
|
|
||||||
params["data_graph_id"] = data_graph_id;
|
params["data_graph_id"] = data_graph_id;
|
||||||
params["node_id"] = node_id;
|
params["node_id"] = node_id;
|
||||||
params["page"] = "include/ajax/map.ajax";
|
params["page"] = "include/ajax/map.ajax";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user