2010-08-13 Sergio Martin <sergio.martin@artica.es>

* 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
This commit is contained in:
zarzuelo 2010-08-13 11:08:14 +00:00
parent bcd263b5c8
commit ca648be4e2
2 changed files with 31 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2010-08-13 Sergio Martin <sergio.martin@artica.es>
* 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 <miguel.dedios@artica.es> 2010-08-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: fixed the loop of alerts when Pandora * include/functions_reporting.php: fixed the loop of alerts when Pandora
haven't alerts. haven't alerts.

View File

@ -61,6 +61,7 @@ function printItemInVisualConsole($layoutData) {
$period = $layoutData['period']; $period = $layoutData['period'];
$sizeStyle = ''; $sizeStyle = '';
$borderStyle = '';
$imageSize = ''; $imageSize = '';
$text = '<span id="text_' . $id . '" class="text">' . $label . '</span>'; $text = '<span id="text_' . $id . '" class="text">' . $label . '</span>';
@ -69,6 +70,10 @@ function printItemInVisualConsole($layoutData) {
case STATIC_GRAPH: case STATIC_GRAPH:
if ($layoutData['image'] != null) { if ($layoutData['image'] != null) {
$img = getImageStatusElement($layoutData); $img = getImageStatusElement($layoutData);
if(substr($img,0,1) == '4') {
$borderStyle ='border: 2px solid #ffa300;';
$img = substr_replace($img, '', 0,1);
}
$imgSizes = getimagesize($img); $imgSizes = getimagesize($img);
} }
if (($width != 0) && ($height != 0)) { if (($width != 0) && ($height != 0)) {
@ -77,7 +82,7 @@ function printItemInVisualConsole($layoutData) {
} }
echo '<div id="' . $id . '" class="item static_graph" style="text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">'; echo '<div id="' . $id . '" class="item static_graph" style="text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
if ($layoutData['image'] != null) { if ($layoutData['image'] != null) {
echo '<img class="image" id="image_' . $id . '" src="' . $img . '" ' . $imageSize . ' /><br />'; echo '<img class="image" id="image_' . $id . '" src="' . $img . '" ' . $imageSize . ' style="'.$borderStyle.'" /><br />';
} }
echo $text; echo $text;
echo "</div>"; echo "</div>";
@ -296,10 +301,13 @@ function getImageStatusElement($layoutData) {
else { else {
switch (getStatusElement($layoutData)) { switch (getStatusElement($layoutData)) {
case 1: case 1:
case 4: //Critical (BAD)
//Critical (BAD or ALERT)
$img .= "_bad.png"; $img .= "_bad.png";
break; break;
case 4:
//Critical (ALERT)
$img = "4".$img."_bad.png";
break;
case 0: case 0:
//Normal (OK) //Normal (OK)
$img .= "_ok.png"; $img .= "_ok.png";
@ -308,6 +316,8 @@ function getImageStatusElement($layoutData) {
//Warning //Warning
$img .= "_warning.png"; $img .= "_warning.png";
break; break;
case 3:
//Unknown
default: default:
$img .= ".png"; $img .= ".png";
// Default is Grey (Other) // 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"]; $img = "images/console/icons/".$layout_data["image"];
switch ($status) { switch ($status) {
case 1: case 1:
case 4: //Critical (BAD)
//Critical (BAD or ALERT)
$img .= "_bad.png"; $img .= "_bad.png";
break; break;
case 4:
//Critical (ALERT)
$img = "4".$img."_bad.png";
break;
case 0: case 0:
//Normal (OK) //Normal (OK)
$img .= "_ok.png"; $img .= "_ok.png";
@ -532,10 +545,16 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
//Warning //Warning
$img .= "_warning.png"; $img .= "_warning.png";
break; break;
case 3:
//Unknown
default: default:
// Default is Grey (Other)
$img .= ".png"; $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)) if (is_file($img))