From 76a6cf84795b79bddb63e88843b6918ce7d3c4ec Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Fri, 13 Aug 2010 11:08:14 +0000 Subject: [PATCH] 2010-08-13 Sergio Martin * include/functions_visual_map.php: Added the alerts fired status to the visual maps drawing an orange edge around the static graph icon git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3142 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ .../include/functions_visual_map.php | 33 +++++++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5477754dab..8d9551fb71 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-08-13 Sergio Martin + + * include/functions_visual_map.php: Added the alerts fired status + to the visual maps drawing an orange edge around the static graph icon + 2010-08-13 Miguel de Dios * include/functions_reporting.php: fixed the loop of alerts when Pandora haven't alerts. diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index f56c06f041..cfaa2b72ee 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -61,6 +61,7 @@ function printItemInVisualConsole($layoutData) { $period = $layoutData['period']; $sizeStyle = ''; + $borderStyle = ''; $imageSize = ''; $text = '' . $label . ''; @@ -69,6 +70,10 @@ function printItemInVisualConsole($layoutData) { case STATIC_GRAPH: if ($layoutData['image'] != null) { $img = getImageStatusElement($layoutData); + if(substr($img,0,1) == '4') { + $borderStyle ='border: 2px solid #ffa300;'; + $img = substr_replace($img, '', 0,1); + } $imgSizes = getimagesize($img); } if (($width != 0) && ($height != 0)) { @@ -77,7 +82,7 @@ function printItemInVisualConsole($layoutData) { } echo '
'; if ($layoutData['image'] != null) { - echo '
'; + echo '
'; } echo $text; echo "
"; @@ -296,10 +301,13 @@ function getImageStatusElement($layoutData) { else { switch (getStatusElement($layoutData)) { case 1: - case 4: - //Critical (BAD or ALERT) + //Critical (BAD) $img .= "_bad.png"; break; + case 4: + //Critical (ALERT) + $img = "4".$img."_bad.png"; + break; case 0: //Normal (OK) $img .= "_ok.png"; @@ -308,6 +316,8 @@ function getImageStatusElement($layoutData) { //Warning $img .= "_warning.png"; break; + case 3: + //Unknown default: $img .= ".png"; // Default is Grey (Other) @@ -520,10 +530,13 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = $img = "images/console/icons/".$layout_data["image"]; switch ($status) { case 1: - case 4: - //Critical (BAD or ALERT) + //Critical (BAD) $img .= "_bad.png"; break; + case 4: + //Critical (ALERT) + $img = "4".$img."_bad.png"; + break; case 0: //Normal (OK) $img .= "_ok.png"; @@ -532,10 +545,16 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = //Warning $img .= "_warning.png"; break; + case 3: + //Unknown default: - // Default is Grey (Other) $img .= ".png"; - break; + // Default is Grey (Other) + } + $borderStyle = ''; + if(substr($img,0,1) == '4') { + $img_style['border'] ='2px solid #ffa300;'; + $img = substr_replace($img, '', 0,1); } if (is_file($img))