diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 448815f9da..3ec283605f 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -89,13 +89,24 @@ function visual_map_main() { }); $('.labelpos').click(function(event) { - $("#labelposup img").attr('src','images/label_up.png'); - $("#labelposdown img").attr('src','images/label_down.png'); - $("#labelposleft img").attr('src','images/label_left.png'); - $("#labelposright img").attr('src','images/label_right.png'); - $('.labelpos').attr('sel','no'); - $("#"+$(this).attr('id')+" img").attr('src','images/label_'+$(this).attr('id').replace('labelpos','')+'_2.png'); - $("#"+$(this).attr('id')).attr('sel','yes'); + if($("#hidden-metaconsole").val() == 1){ + $("#labelposup img").attr('src','../../images/label_up.png'); + $("#labelposdown img").attr('src','../../images/label_down.png'); + $("#labelposleft img").attr('src','../../images/label_left.png'); + $("#labelposright img").attr('src','../../images/label_right.png'); + $('.labelpos').attr('sel','no'); + $("#"+$(this).attr('id')+" img").attr('src','../../images/label_'+$(this).attr('id').replace('labelpos','')+'_2.png'); + $("#"+$(this).attr('id')).attr('sel','yes'); + } + else{ + $("#labelposup img").attr('src','images/label_up.png'); + $("#labelposdown img").attr('src','images/label_down.png'); + $("#labelposleft img").attr('src','images/label_left.png'); + $("#labelposright img").attr('src','images/label_right.png'); + $('.labelpos').attr('sel','no'); + $("#"+$(this).attr('id')+" img").attr('src','images/label_'+$(this).attr('id').replace('labelpos','')+'_2.png'); + $("#"+$(this).attr('id')).attr('sel','yes'); + } }); @@ -982,13 +993,24 @@ function loadFieldsFromDB(item) { } if (key == 'label_position') { - $('#labelposup'+" img").attr('src','images/label_up.png'); - $('#labelposdown'+" img").attr('src','images/label_down.png'); - $('#labelposleft'+" img").attr('src','images/label_left.png'); - $('#labelposright'+" img").attr('src','images/label_right.png'); - $('.labelpos').attr('sel','no'); - $('#labelpos'+val+" img").attr('src','images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png'); - $('#labelpos'+val).attr('sel','yes'); + if($("#hidden-metaconsole").val() == 1){ + $('#labelposup'+" img").attr('src','../../images/label_up.png'); + $('#labelposdown'+" img").attr('src','../../images/label_down.png'); + $('#labelposleft'+" img").attr('src','../../images/label_left.png'); + $('#labelposright'+" img").attr('src','../../images/label_right.png'); + $('.labelpos').attr('sel','no'); + $('#labelpos'+val+" img").attr('src','../../images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png'); + $('#labelpos'+val).attr('sel','yes'); + } + else{ + $('#labelposup'+" img").attr('src','images/label_up.png'); + $('#labelposdown'+" img").attr('src','images/label_down.png'); + $('#labelposleft'+" img").attr('src','images/label_left.png'); + $('#labelposright'+" img").attr('src','images/label_right.png'); + $('.labelpos').attr('sel','no'); + $('#labelpos'+val+" img").attr('src','images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png'); + $('#labelpos'+val).attr('sel','yes'); + } } if (key == 'image') { diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index d02963d4aa..3a2923eb6c 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -817,12 +817,39 @@ else{ } } + //data $module_value = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module); + //state + $module_status = db_get_sql ('SELECT estado + FROM tagente_estado + WHERE id_agente_modulo = ' . $id_module); + if (empty($module_value) || $module_value == 0) { $colorStatus = COL_UNKNOWN; } + else{ + switch ($module_status) { + case 0: //Normal + $colorStatus = COL_NORMAL; + break; + case 1: //Critical + $colorStatus = COL_CRITICAL; + break; + case 2: //Warning + $colorStatus = COL_WARNING; + break; + case 4: //Not_INIT + $colorStatus = COL_NOTINIT; + break; + case 3: //Unknown + default: + $colorStatus = COL_UNKNOWN; + break; + } + } + $value_text = false; if ($layoutData['image'] == 'percent') { $value_text = false; @@ -944,13 +971,24 @@ else{ $homeurl = $config['homeurl']; else $homeurl = ''; - - if (get_parameter('action') == 'edit') { + + if ( (get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap') ) { if($width == 0 || $height == 0){ - $img = ''; + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; + } + else{ + $img = ''; + } + } else{ - $img = ''; + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; + } + else{ + $img = ''; + } } } else { @@ -1005,7 +1043,7 @@ else{ false, 1, false, 0, '', 0, 0, true, $only_image, '', 1, false, '', false, false, false, $layoutData['image'], - null, true, false, $type_graph); + null, false, true, $type_graph); } } } diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 6d4fee8779..e2d6a24e13 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1577,7 +1577,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, } var stack = 0, bars = true, lines = false, steps = false; - var plot = $.plot($('#' + graph_id), datas, options); // Re-calculate the graph height with the legend height @@ -1760,7 +1759,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) { $('#legend_' + graph_id + ' .legendLabel') .eq(i).html(label_aux + '= ' + parseFloat(y).toFixed(precision_graph) + how_bigger + ' ' + unit); - console.log($('#legend_' + graph_id + ' .legendLabel')); } $('#legend_' + graph_id + ' .legendLabel')