diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9ee947efbf..fd9c844ef7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-02-22 Sergio Martin + + * include/functions_html.php + include/styles/pandora.css + include/functions_graph.php + include/functions_events.php + include/javascript/pandora.js + operation/agentes/estado_generalagente.php: Improve agent view + interface, work in hidden menus to improve more the graphs + layout. + 2013-02-22 Sancho Lerena * include/api.php: Added a single protection on DoS attacks. diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index beb2d82d61..3f56b696dc 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -693,6 +693,39 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, $id_use return (int) db_process_sql ($sql, "insert_id"); } +/** + * Print tiny statistics of an agent + * + * @param integer number of total modules + * @param integer number of normal modules + * @param integer number of critical modules + * @param integer number of warning modules + * @param integer number of unknown modules + * @param bool return or echo flag + * + */ +function events_tiny_stats ($total_modules, $normal_modules, $critical_modules, $warning_modules, $unknown_modules, $return = false) { + $out = '' . $total_modules; + if ($critical_modules > 0) + $out .= ' : ' . $critical_modules . ''; + if ($warning_modules > 0) + $out .= ' : ' . $warning_modules . ''; + if ($unknown_modules > 0) + $out .= ' : ' . $unknown_modules . ''; + if ($normal_modules > 0) + $out .= ' : ' . $normal_modules . ''; + + $out .= ''; + + if ($return) { + return $out; + } + else { + echo $out; + } +} + + /** * Prints a small event table * diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index dc8846f56a..b11d1fa8a0 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1367,20 +1367,6 @@ function graph_agent_status ($id_agent, $width = 300, $height = 200, $return = f $out = pie2d_graph($config['flash_charts'], $data, $width, $height, __("other"), '', $water_mark, $config['fontpath'], $config['font_size'], 1, "hidden", $colors); - - $out .= '
'; - - $out .= array_sum($data); - if ($data['Critical'] > 0) - $out .= ' : ' . $data["Critical"] . ''; - if ($data["Warning"] > 0) - $out .= ' : ' . $data["Warning"] . ''; - if ($data["Unknown"] > 0) - $out .= ' : ' . $data["Unknown"] . ''; - if ($data["Normal"] > 0) - $out .= ' : ' . $data["Normal"] . ''; - - $out .= '
'; if ($return) { return $out; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index b78d071508..5e5083695e 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -127,6 +127,9 @@ function html_print_side_layer ($params) { 'bottom_text' => '', 'top' => '0', 'autotop' => '', + 'right' => '0', + 'autoright' => '', + 'vertical_mode' => 'out', 'icon_width' => 50, 'icon_height' => 50, 'icon_open' => $params['icon_closed'] @@ -151,6 +154,11 @@ function html_print_side_layer ($params) { $body_float = 'right'; $button_float = 'left'; break; + case 'bottom': + $round_class = 'menu_sidebar_radius_left menu_sidebar_radius_right'; + $body_float = 'right'; + $button_float = 'left'; + break; } $out_html = '