2012-05-03 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.php: refixed the add the items with modules with entities. * include/functions_reporting.php, include/functions_networkmap.php, include/functions_visual_map.php: cleaned source code style. MERGED FROM 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6238 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7a84bf9cd3
commit
5a8b19b129
|
@ -1,3 +1,13 @@
|
|||
2012-05-03 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/visual_console_builder.php: refixed the add the
|
||||
items with modules with entities.
|
||||
|
||||
* include/functions_reporting.php, include/functions_networkmap.php,
|
||||
include/functions_visual_map.php: cleaned source code style.
|
||||
|
||||
MERGED FROM 4.0.2
|
||||
|
||||
2012-04-30 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
All changes (except a small patch on function_groups) are
|
||||
|
|
|
@ -212,13 +212,18 @@ switch ($activeTab) {
|
|||
foreach ($id_agents as $ag) {
|
||||
$id_module = agents_get_modules($ag,
|
||||
array('id_agente_modulo'),
|
||||
array('nombre' => io_safe_input($mod)));
|
||||
array('nombre' => $mod));
|
||||
if (empty($id_module))
|
||||
continue;
|
||||
else {
|
||||
$id_module = reset($id_module);
|
||||
$id_module = $id_module['id_agente_modulo'];
|
||||
}
|
||||
|
||||
$id_modules[] = $id_module;
|
||||
}
|
||||
}
|
||||
|
||||
$message .= visual_map_process_wizard_add_modules($id_modules,
|
||||
$image, $idVisualConsole, $range, $width, $height,
|
||||
$period, $process_value, $percentileitem_width,
|
||||
|
|
|
@ -33,7 +33,7 @@ function networkmap_is_descendant ($node, $ascendant, $parents) {
|
|||
if (! isset ($parents[$node])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($node == $ascendant) {
|
||||
return true;
|
||||
}
|
||||
|
@ -153,7 +153,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||
// Verify that the parent is in the graph
|
||||
if (isset ($nodes[$parent_id])) {
|
||||
$graph .= networkmap_create_edge ($node, $parent_id, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'topology', $id_networkmap);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$orphans[$node] = 1;
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +514,7 @@ function networkmap_create_pandora_node ($name, $font_size = 10, $simple = 0, $s
|
|||
if ($simple == 1){
|
||||
$label = '';
|
||||
}
|
||||
|
||||
|
||||
$stats_json = base64_encode(json_encode($stats));
|
||||
|
||||
$node = '0 [ color="#364D1F", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.8, height=0.6, label=<'.$label.'>,
|
||||
|
|
|
@ -968,7 +968,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
elseif (preg_match('/^(http:\/\/)((.)+)$/i', $layout_data['label'])){
|
||||
// Link to an URL
|
||||
echo '<a style="' . ($layout_data['label_color'][0] == '#' ? 'color: '.$layout_data['label_color'].';' : '') . '" href="' . $layout_data['label'] .'">';
|
||||
$endTagA = true;
|
||||
$endTagA = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1268,7 +1268,8 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
else {
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$layout_data["id_agent"].'&tab=data">';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layout_data['id_layout_linked'].'">';
|
||||
}
|
||||
}
|
||||
|
@ -1359,12 +1360,12 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
|||
$filter = array ();
|
||||
|
||||
$where = db_format_array_where_clause_sql ($filter);
|
||||
|
||||
|
||||
if ($returnAllGroup)
|
||||
$groups = users_get_groups ($id_user);
|
||||
else
|
||||
$groups = users_get_groups ($id_user, 'IR', false);
|
||||
|
||||
|
||||
if(!empty($groups)) {
|
||||
if ($where != '') {
|
||||
$where .= ' AND ';
|
||||
|
@ -1375,7 +1376,7 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
|||
if($where == '') {
|
||||
$where = array();
|
||||
}
|
||||
|
||||
|
||||
$layouts = db_get_all_rows_filter ('tlayout', $where);
|
||||
|
||||
if ($layouts == false)
|
||||
|
@ -1409,12 +1410,12 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) {
|
|||
$temp_status = 0;
|
||||
$temp_total = 0;
|
||||
$depth++; // For recursion depth checking
|
||||
|
||||
|
||||
// TODO: Implement this limit as a configurable item in setup
|
||||
if ($depth > 10){
|
||||
if ($depth > 10) {
|
||||
return 3; // No status data if we need to exit by a excesive recursion
|
||||
}
|
||||
|
||||
|
||||
$id_layout = (int) $id_layout;
|
||||
|
||||
$result = db_get_all_rows_filter ('tlayout_data', array ('id_layout' => $id_layout),
|
||||
|
@ -1428,11 +1429,14 @@ function visual_map_get_layout_status ($id_layout = 0, $depth = 0) {
|
|||
// Other Layout (Recursive!)
|
||||
if (($data["id_layout_linked"] != 0) && ($data["id_agente_modulo"] == 0)) {
|
||||
$status = visual_map_get_layout_status ($data["id_layout_linked"], $depth);
|
||||
}
|
||||
// Module
|
||||
} elseif ($data["id_agente_modulo"] != 0) {
|
||||
elseif ($data["id_agente_modulo"] != 0) {
|
||||
$status = modules_get_agentmodule_status ($data["id_agente_modulo"]);
|
||||
|
||||
}
|
||||
// Agent
|
||||
} else {
|
||||
else {
|
||||
$status = agents_get_status ($data["id_agent"]);
|
||||
}
|
||||
if ($status == 1)
|
||||
|
@ -1499,7 +1503,7 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
|||
if (!empty($moduleName)) {
|
||||
$text .= " - " . ui_print_truncate_text($moduleName, 10, false);
|
||||
}
|
||||
|
||||
|
||||
$text .= ")";
|
||||
}
|
||||
$text .= ' (' . $idData . ')';
|
||||
|
|
Loading…
Reference in New Issue