diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2203bb2b3e..f0b981549c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2011-12-13 Sergio Martin + + * include/functions_graph.php: Fixed a bug of the + NO DATA images in the pdf graph reports + + * include/styles/pandora.css + include/functions_reporting.php: Added styles to the + group report + 2011-12-12 Sergio Martin * include/functions_graph.php: Fixed some notices of the graphs diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 1be3ad197c..df7c19662e 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -758,7 +758,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ case GRAPH_AREA: $color = null; return area_graph($flash_charts, $graph_values, $width, $height, - $color, $module_name_list, $long_index, "images/image_problem.opaque.png", + $color, $module_name_list, $long_index, $homeurl."images/image_problem.opaque.png", "", "", $homeurl, $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], "", $ttl); break; @@ -766,21 +766,21 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ case GRAPH_STACKED_AREA: $color = null; return stacked_area_graph($flash_charts, $graph_values, $width, $height, - $color, $module_name_list, $long_index, "images/image_problem.opaque.png", + $color, $module_name_list, $long_index, $homeurl."images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], "", $ttl, $homeurl); break; case GRAPH_LINE: $color = null; return line_graph($flash_charts, $graph_values, $width, $height, - $color, $module_name_list, $long_index, "images/image_problem.opaque.png", + $color, $module_name_list, $long_index, $homeurl."images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], "", $ttl, $homeurl); break; case GRAPH_STACKED_LINE: $color = null; return stacked_line_graph($flash_charts, $graph_values, $width, $height, - $color, $module_name_list, $long_index, "images/image_problem.opaque.png", + $color, $module_name_list, $long_index, $homeurl."images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], "", $ttl, $homeurl); break; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 879ee3f83e..d0438fe75a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3026,48 +3026,77 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f case 'group_report': $group_name = groups_get_name($content['id_group']); $group_stats = reporting_get_group_stats($content['id_group']); - - $data = array (); + // Get events of the last 8 hours + $events = events_get_group_events ($content['id_group'], 28800, $report['datetime']); + $data = array (); $table->colspan[0][0] = 7; - $table->colspan[1][3] = 4; - $table->colspan[3][3] = 4; - $table->colspan[4][2] = 5; + $table->colspan[1][1] = 3; + $table->colspan[1][4] = 3; + $table->colspan[2][1] = 3; + $table->colspan[2][4] = 3; + $table->colspan[5][1] = 3; + $table->colspan[5][4] = 3; + $table->colspan[6][1] = 3; + $table->colspan[6][4] = 3; + $table->colspan[7][1] = 6; + $table->colspan[8][1] = 6; $data[0] = $sizh. __('Group report').': "'.$group_name.'"' . $sizhfin; array_push ($table->data, $data); $data = array(); - $data[0] = ''.__('Agents').''; - $data[1] = __('Total').' ('.$group_stats['total_agents'].')'; - $data[2] = __('Unknown').' ('.$group_stats['agents_unknown'].')'; - $data[3] = ''; - array_push ($table->data, $data); - - $data = array(); - $data[0] = ''.__('Monitors').''; - $data[1] = __('Total').' ('.$group_stats['monitor_checks'].')'; - $data[2] = __('Normal').' ('.$group_stats['monitor_ok'].')'; - $data[3] = __('Critical').' ('.$group_stats['monitor_critical'].')'; - $data[4] = __('Warning').' ('.$group_stats['monitor_warning'].')'; - $data[5] = __('Unknown').' ('.$group_stats['monitor_unknown'].')'; - $data[6] = __('Not init').' ('.$group_stats['monitor_not_init'].')'; - array_push ($table->data, $data); - - $data = array(); - $data[0] = ''.__('Alerts').''; - $data[1] = __('Total').' ('.$group_stats['monitor_alerts'].')'; - $data[2] = __('Fired').' ('.$group_stats['monitor_alerts_fired'].')'; - $data[3] = ''; + $data[0] = ''; + $data[1] = "
".__('Total')."
"; + $data[4] = "
".__('Unknown')."
"; array_push ($table->data, $data); - // Get events of the last 8 hours - $events = events_get_group_events ($content['id_group'], 28800, $report["datetime"]); + $data = array(); + $data[0] = "
".__('Agents')."
"; + $data[1] = "
".$group_stats['total_agents']."
"; + $data[4] = "
".$group_stats['agents_unknown']."
"; + array_push ($table->data, $data); $data = array(); - $data[0] = ''.__('Events').''; - $data[1] = __('Last 8 hours events').' ('.count($events).')'; - $data[2] = ''; + $data[0] = ''; + $data[1] = "
".__('Total')."
"; + $data[2] = "
".__('Normal')."
"; + $data[3] = "
".__('Critical')."
"; + $data[4] = "
".__('Warning')."
"; + $data[5] = "
".__('Unknown')."
"; + $data[6] = "
".__('Not init')."
"; + array_push ($table->data, $data); + + $data = array(); + $data[0] = "
".__('Monitors')."
"; + $data[1] = "
".$group_stats['monitor_checks']."
"; + $data[2] = "
".$group_stats['monitor_ok']."
"; + $data[3] = "
".$group_stats['monitor_critical']."
"; + $data[4] = "
".$group_stats['monitor_warning']."
"; + $data[5] = "
".$group_stats['monitor_unknown']."
"; + $data[6] = "
".$group_stats['monitor_not_init']."
"; + array_push ($table->data, $data); + + $data = array(); + $data[0] = ''; + $data[1] = "
".__('Defined')."
"; + $data[4] = "
".__('Fired')."
"; + array_push ($table->data, $data); + + $data = array(); + $data[0] = "
".__('Alerts')."
"; + $data[1] = "
".$group_stats['monitor_alerts']."
"; + $data[4] = "
".$group_stats['monitor_alerts_fired']."
"; + array_push ($table->data, $data); + + $data = array(); + $data[0] = ''; + $data[1] = "
".__('Last 8 hours')."
"; + array_push ($table->data, $data); + + $data = array(); + $data[0] = "
".__('Events')."
"; + $data[1] = "
".count($events)."
"; array_push ($table->data, $data); break; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 4065c4b65c..5c96574270 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1314,3 +1314,76 @@ tfoot.scwFoot { color: #FFA500 !important; } +/* Cells divs to set individual styles with the table objects */ +div.cellBold { + width:100%; + height:100%; + font-weight: bold; +} + +div.cellCenter { + width:100%; + height:100%; + text-align:center; +} + +div.cellWhite { + width:100%; + height:100%; + background: #fff; + color: #000; +} + +div.cellNormal { + width:100%; + height:100%; + background: #008e00; + color: #fff; +} + +div.cellCritical { + width:100%; + height:100%; + background: #cc0000; + color: #fff; +} + +div.cellWarning { + width:100%; + height:100%; + background: #fce94f; + color: #000; +} + +div.cellUnknown { + width:100%; + height:100%; + background: #babdb6; + color: #000; +} + +div.cellNotInit { + width:100%; + height:100%; + background: #729fcf; + color: #000; +} + +div.cellAlert { + width:100%; + height:100%; + background: #ffa300; + color: #000; +} + +div.cellBorder1 { + width:100%; + height:100%; + border: 1px solid black; +} + +div.cellBig { + width:100%; + height:100%; + font-size: 18px; +}