diff --git a/pandora_console/godmode/reporting/create_container.php b/pandora_console/godmode/reporting/create_container.php index fed5a6242a..9be93af597 100644 --- a/pandora_console/godmode/reporting/create_container.php +++ b/pandora_console/godmode/reporting/create_container.php @@ -41,7 +41,7 @@ if (is_ajax()){ $id_agent = get_parameter('id_agent'); $id_agent_module = get_parameter('id_agent_module'); $time_lapse = get_parameter('time_lapse'); - $only_avg = (int) get_parameter('only_avg'); + $only_avg = (bool) get_parameter('only_avg'); $values = array( 'id_container' => $id_container2, @@ -76,6 +76,7 @@ if (is_ajax()){ $agent_alias = get_parameter('agent_alias',''); $module_name = get_parameter('module_name',''); $tag = get_parameter('tag',0); + $only_avg = (bool) get_parameter('only_avg'); $values = array( 'id_container' => $id_container2, @@ -85,8 +86,8 @@ if (is_ajax()){ 'id_module_group' => $module_group, 'agent' => $agent_alias, 'module' => $module_name, - 'id_tag' => $tag); - + 'id_tag' => $tag, + 'only_average' => $only_avg); $id_item = db_process_sql_insert('tcontainer_item', $values); return; } @@ -433,7 +434,13 @@ if($edit_container){ $tag, '', __('Any'), 0, true, false, false); $table->data[] = $data; $table->rowclass[] = ''; - + + $data = array(); + $data[0] = __('Only average'); + $data[1] = html_print_checkbox('only_avg', 1, false,true); + $table->data[] = $data; + $table->rowclass[] = ''; + $data = array(); $data[0] = ""; $data[1] = ""; @@ -592,6 +599,7 @@ echo html_print_input_hidden('id_agent', 0); var group = $("#container_id_group1").val(); var module_group = $("#combo_modulegroup").val(); var tag = $("#tag").val(); + var only_avg = $("#checkbox-only_avg1").prop("checked"); var id_container = ; jQuery.post ("ajax.php", {"page" : "godmode/reporting/create_container", @@ -603,6 +611,7 @@ echo html_print_input_hidden('id_agent', 0); "module_name" : module_name, "tag" : tag, "id_container" : id_container, + "only_avg" : only_avg, }, function (data, status) { var url = location.href.replace('&update_container=1', ""); diff --git a/pandora_console/godmode/reporting/graph_container.php b/pandora_console/godmode/reporting/graph_container.php index beef4167d2..6c4903fbb8 100644 --- a/pandora_console/godmode/reporting/graph_container.php +++ b/pandora_console/godmode/reporting/graph_container.php @@ -94,7 +94,7 @@ echo ""; }, success: function(data) { $("#div_"+hash).remove(); - $("#tgl_div_"+hash).prepend("
"+data+"
"); + $("#tgl_div_"+hash).prepend("
"+data+"
"); if($('div[class *= graph]').length == 0 && $('div[class *= bullet]').length == 0 && $('div[id *= gauge_]').length == 0){ $("#div_"+hash).remove(); diff --git a/pandora_console/images/image_problem_area.png b/pandora_console/images/image_problem_area.png new file mode 100644 index 0000000000..d89324cf81 Binary files /dev/null and b/pandora_console/images/image_problem_area.png differ diff --git a/pandora_console/include/ajax/graph.ajax.php b/pandora_console/include/ajax/graph.ajax.php index 4b0e4d582a..1b537f8a48 100644 --- a/pandora_console/include/ajax/graph.ajax.php +++ b/pandora_console/include/ajax/graph.ajax.php @@ -162,12 +162,12 @@ if ($get_graphs){ tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']); $sql_alias = db_get_all_rows_sql("SELECT alias from tagente WHERE id_agente = ". $sql_modulo[0]['id_agente']); - $table .= "

AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."


"; + $table .= "

AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."


"; $table .= grafico_modulo_sparse( $value['id_agent_module'], $value['time_lapse'], 0, - 800, + 1000, 300, '', '', @@ -225,11 +225,11 @@ if ($get_graphs){ } else { $height = 300; } - $table .= "

CUSTOM GRAPH ".$graph[0]['name']."


"; + $table .= "

".$graph[0]['name']."


"; $table .= graphic_combined_module($modules, $weights, $value['time_lapse'], - 800, + 1000, $height, '', '', @@ -259,8 +259,10 @@ if ($get_graphs){ } break; case 'dynamic_graph': - $alias = " AND alias like '%".io_safe_output($value['agent'])."%'"; - + if($value['agent'] != ''){ + $alias = " AND alias REGEXP '".$value['agent']."'"; + } + if($value['id_group'] === '0'){ $id_group = ""; } else { @@ -281,8 +283,10 @@ if ($get_graphs){ $id_tag = " AND ttag_module.id_tag = ".$value['id_tag']; } - $module_name = " AND nombre like '%".io_safe_output($value['module'])."%'"; - + if($value['module'] != ''){ + $module_name = " AND nombre REGEXP '".$value['module']."'"; + } + $id_agent_module = db_get_all_rows_sql("SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo ". $tag . "WHERE 1=1" . $id_module_group . $module_name . " AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")" @@ -296,13 +300,13 @@ if ($get_graphs){ $sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente WHERE id_agente = ". $sql_modulo2[0]['id_agente']); - $table .= "

AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."


"; + $table .= "

AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."


"; $table .= grafico_modulo_sparse( $value2['id_agente_modulo'], $value['time_lapse'], 0, - 800, + 1000, 300, '', '', diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 9ee675f508..bb9b009d4a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -4159,4 +4159,25 @@ div#footer_help{ /*view-agents lastest events for this agent*/ #div_all_events_24h{ padding: 4px; +} + +/*styles graph conteiner*/ +.graph_conteiner_inside > .parent_graph{ + width: 100% !important; +} + +.graph_conteiner_inside > .parent_graph > .menu_graph{ + left: 90% !important; +} + +.graph_conteiner_inside > .parent_graph > .noresizevc{ + width: 90% !important; +} + +.graph_conteiner_inside > div > .nodata_container > .nodata_text { + display: none; +} + +.graph_conteiner_inside > div > .nodata_container{ + background-size: 120px 80px !important; } \ No newline at end of file