From 5ec529eda76ad45766bff4dfa0d9d652e33bbe3f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 17 Aug 2011 12:44:26 +0000 Subject: [PATCH] 2011-08-17 Miguel de Dios * include/functions_visual_map.php, godmode/reporting/visual_console_builder.php, godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php: fixes more things, see the item in sourceforge tracker. Fixes: #3389987 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4751 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 +++ .../visual_console_builder.editor.js | 61 +++++++++++++++++++ .../visual_console_builder.editor.php | 6 ++ .../reporting/visual_console_builder.php | 4 ++ .../include/functions_visual_map.php | 16 ++++- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6e5f6075dc..0e8b767efb 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2011-08-17 Miguel de Dios + + * include/functions_visual_map.php, + godmode/reporting/visual_console_builder.php, + godmode/reporting/visual_console_builder.editor.js, + godmode/reporting/visual_console_builder.editor.php: fixes more things, see + the item in sourceforge tracker. + + Fixes: #3389987 + 2011-08-17 Juan Manuel Ramon * pandoradb.oracle.sql: Added columns 'module_action_threshold' and diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index fc74825eab..a99b23174f 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -306,6 +306,52 @@ function createAction() { validate = false; } break; + case 'percentile_bar': + if ((values['agent'] == '')) { + alert($("#message_alert_no_agent").html()); + validate = false; + } + if ((values['module'] == 0)) { + alert($("#message_alert_no_module").html()); + validate = false; + } + if ((values['max_percentile'] == '')) { + alert($("#message_alert_no_max_percentile").html()); + validate = false; + } + if ((values['width_percentile'] == '')) { + alert($("#message_alert_no_width_percentile").html()); + validate = false; + } + break; + case 'module_graph': + if ((values['agent'] == '')) { + alert($("#message_alert_no_agent").html()); + validate = false; + } + if ((values['module'] == 0)) { + alert($("#message_alert_no_module").html()); + validate = false; + } + if ((values['period'] == 0)) { + alert($("#message_alert_no_period").html()); + validate = false; + } + break; + case 'simple_value': + if ((values['agent'] == '')) { + alert($("#message_alert_no_agent").html()); + validate = false; + } + if ((values['module'] == 0)) { + alert($("#message_alert_no_module").html()); + validate = false; + } + if ((values['process_simple_value'] == 0)) { + alert($("#message_alert_no_process").html()); + validate = false; + } + break; } if (validate) { @@ -524,6 +570,9 @@ function hiddenFields(item) { $("#agent_row").css('display', 'none'); $("#agent_row." + item).css('display', ''); + $("#module_row").css('display', 'none'); + $("#module_row." + item).css('display', ''); + $("#process_value_row").css('display', 'none'); $("#process_value_row." + item).css('display', ''); @@ -974,6 +1023,7 @@ function updateDB(type, idElement , values, event) { { switch (type) { case 'module_graph': + $("#image_" + idElement).attr("src", getModuleGraph(idElement)); case 'static_graph': case 'percentile_bar': case 'simple_value': @@ -990,8 +1040,10 @@ function updateDB(type, idElement , values, event) { $("#" + idElement).css('left', '0px').css('margin-left', left + 'px'); } $("#" + idElement).css('color', values['label_color']); + found = false; jQuery.each(lines, function(i, line) { if (lines[i]['id'] == idElement) { + found = true; if (values['parent'] == 0) { lines.splice(i); } @@ -1005,6 +1057,15 @@ function updateDB(type, idElement , values, event) { } } }); + + if (!found) { + var line = {"id": idElement, + "node_begin": values['parent'], + "node_end": idElement, + "color": visual_map_get_color_line_status(idElement) }; + lines.push(line); + } + refresh_lines(lines, 'background'); break; case 'background': diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index d97c7a242d..560320c0a6 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -295,6 +295,12 @@ echo ""; echo ''; echo ''; echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; ui_require_css_file ('color-picker'); diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 1dc30e377b..a7e67b3e5b 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -126,6 +126,10 @@ switch ($activeTab) { $values['height'] = get_parameter('height_' . $id, 0); $values['pos_x'] = get_parameter('left_' . $id, 0); $values['pos_y'] = get_parameter('top_' . $id, 0); + $type = db_get_value('type', 'tlayout_data', 'id', $id); + if ($type == 1) { + $values['period'] = get_parameter('period_' . $id, 0); + } $agentName = get_parameter('agent_' . $id, ''); $values['id_agent'] = agents_get_agent_id($agentName); $values['id_agente_modulo'] = get_parameter('module_' . $id, 0); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 6e68ad6892..6439e53128 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -794,7 +794,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line echo ''; $endTagA = true; - } + } + elseif ($layout_data['id_layout_linked'] > 0) { + + // Link to a map + echo ''; + $endTagA = true; + } } echo ''.$layout_data['label']. ' '; @@ -870,7 +876,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line echo ''; $endTagA = true; - } + } + elseif ($layout_data['id_layout_linked'] > 0) { + + // Link to a map + echo ''; + $endTagA = true; + } } echo $layout_data['label'];