diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1b07f6e7c8..9cb4982fe1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-08-12 Sergio Martin + + * extensions/agents_modules.php: Improved the agents/modules matrix in + visual way and converting the horizontal module names in vertical images + 2010-08-12 Sergio Martin * include/functions.php: Added the function string2image to obtain an image diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 423a4da2fe..e5b47ecd4f 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -51,7 +51,7 @@ function mainAgentsModules() { $offset = get_parameter('offset', 0); $hor_offset = get_parameter('hor_offset', 0); - $block = 13; + $block = 20; // Header print_page_header (__("Agents/Modules"), "images/bricks.png", false, "", false, $updated_time ); @@ -77,33 +77,34 @@ function mainAgentsModules() { } } - echo ''; + echo '
'; + echo ""; + + $agents = get_agents (array ('offset' => (int) $offset, + 'limit' => (int) $config['block_size'])); + $nagents = count($agents); + if($hor_offset > 0) { $new_hor_offset = $hor_offset-$block; - echo ""; + echo ""; } - - echo ""; - - $nmodules = 0; + $nmodules = 0; foreach($modules_by_name as $module) { $nmodules++; if($nmodules <= $hor_offset || $nmodules > ($hor_offset+$block)) { continue; } - echo ""; + $file_name = string2image(printTruncateText($module['name'],10, false, true, false, '...'), 90, 15, 3, 270, '#9EAC8B', 'FFF', 4, 0); + echo ""; } - + if(($hor_offset + $block) < $nmodules) { $new_hor_offset = $hor_offset+$block; - echo ""; + echo ""; } - $agents = get_agents (array ('offset' => (int) $offset, - 'limit' => (int) $config['block_size'])); - // Prepare pagination pagination ((int)count(get_agents ())); echo "
"; @@ -114,24 +115,29 @@ function mainAgentsModules() { // Calculate entire row color if ($data["monitor_alertsfired"] > 0){ - echo ""; + $rowcolor = '#ffa300'; + $textcolor = '#000'; } elseif ($data["monitor_critical"] > 0) { - echo ""; + $rowcolor = '#bc0000'; + $textcolor = '#FFF'; } elseif ($data["monitor_warning"] > 0) { - echo ""; + $rowcolor = '#f2ef00'; + $textcolor = '#000'; } elseif ($data["monitor_unknown"] > 0) { - echo ""; + $rowcolor = '#babdb6'; + $textcolor = '#000'; } elseif ($data["monitor_normal"] > 0) { - echo ""; + $rowcolor = '#8ae234'; + $textcolor = '#000'; } else { - echo ""; + $rowcolor = '#babdb6'; + $textcolor = '#000'; } - if($hor_offset > 0) { - echo ""; - } + echo ""; - echo ""; + $file_name = string2image(printTruncateText($agent['nombre'],20, false, true, false, '...'), 140, 15, 3, 0, $rowcolor, $textcolor, 4, 0); + echo ""; $agent_modules = get_agent_modules($agent['id_agente']); $nmodules = 0; @@ -148,22 +154,22 @@ function mainAgentsModules() { foreach($module['id'] as $module_id){ if(!$match && array_key_exists($module_id,$agent_modules)) { $status = get_agentmodule_status($module_id); - echo ""; @@ -172,38 +178,35 @@ function mainAgentsModules() { } if(!$match) { - echo ""; + echo ""; } } - if(($hor_offset+$block) < $nmodules) { - echo ""; - } echo ""; } echo "
".__("Agents")." \\ ".__("Modules")."<< ".print_image("images/darrowleft.png",true, array('title' => __('Previous modules')))." ".__("Agents")." \\ ".__("Modules")."".printTruncateText($module['name'],4, false)."".print_image($file_name, true, array('title' => $module['name'])).">> ".print_image("images/darrowright.png",true, array('title' => __('More modules')))."
".printTruncateText($agent['nombre'],20)."".print_image($file_name, true, array('title' => $agent['nombre'])).""; + echo ""; switch($status){ case 0: - print_status_image ('module_ok.png', $module['name']." in ".$agent['nombre'].": ".__('NORMAL')); + print_status_image ('module_ok.png', $module['name']." in ".$agent['nombre'].": ".__('NORMAL'), false, array('width' => '20px', 'height' => '20px')); break; case 1: - print_status_image ('module_critical.png', $module['name']." in ".$agent['nombre'].": ".__('CRITICAL')); + print_status_image ('module_critical.png', $module['name']." in ".$agent['nombre'].": ".__('CRITICAL'), false, array('width' => '20px', 'height' => '20px')); break; case 2: - print_status_image ('module_warning.png', $module['name']." in ".$agent['nombre'].": ".__('WARNING')); + print_status_image ('module_warning.png', $module['name']." in ".$agent['nombre'].": ".__('WARNING'), false, array('width' => '20px', 'height' => '20px')); break; case 3: - print_status_image ('module_unknown.png', $module['name']." in ".$agent['nombre'].": ".__('UNKNOWN')); + print_status_image ('module_unknown.png', $module['name']." in ".$agent['nombre'].": ".__('UNKNOWN'), false, array('width' => '20px', 'height' => '20px')); break; case 4: - print_status_image ('module_alertsfired.png', $module['name']." in ".$agent['nombre'].": ".__('ALERTS FIRED')); + print_status_image ('module_alertsfired.png', $module['name']." in ".$agent['nombre'].": ".__('ALERTS FIRED'), false, array('width' => '20px', 'height' => '20px')); break; } echo "
"; - echo "

" . __("The colours meaning:") . + echo "

" . __("The colours meaning:") . "

" .