Merge branch 'ent-3494-Item-group-en-visual-console-metaconsola' into 'develop'

fix bug in meta visual console: group item not retrieving values properly

See merge request 
This commit is contained in:
Alejandro Fraguas 2019-12-23 16:54:40 +01:00
commit 68a47354f9
1 changed files with 18 additions and 4 deletions
pandora_console/include

View File

@ -1900,6 +1900,8 @@ function visual_map_print_item(
echo '<img id="image_'.$id.'" src="images/console/signes/group_status.png" style="width:'.$width.'px;height:'.$height.'px;'.$imgpos.'">'; echo '<img id="image_'.$id.'" src="images/console/signes/group_status.png" style="width:'.$width.'px;height:'.$height.'px;'.$imgpos.'">';
} }
} else { } else {
$is_meta = is_metaconsole();
$agents_critical = agents_get_agents( $agents_critical = agents_get_agents(
[ [
'disabled' => 0, 'disabled' => 0,
@ -1908,7 +1910,10 @@ function visual_map_print_item(
], ],
['COUNT(*) as total'], ['COUNT(*) as total'],
'AR', 'AR',
false false,
false,
0,
$is_meta
); );
$agents_warning = agents_get_agents( $agents_warning = agents_get_agents(
[ [
@ -1918,7 +1923,10 @@ function visual_map_print_item(
], ],
['COUNT(*) as total'], ['COUNT(*) as total'],
'AR', 'AR',
false false,
false,
0,
$is_meta
); );
$agents_unknown = agents_get_agents( $agents_unknown = agents_get_agents(
[ [
@ -1928,7 +1936,10 @@ function visual_map_print_item(
], ],
['COUNT(*) as total'], ['COUNT(*) as total'],
'AR', 'AR',
false false,
false,
0,
$is_meta
); );
$agents_ok = agents_get_agents( $agents_ok = agents_get_agents(
[ [
@ -1938,7 +1949,10 @@ function visual_map_print_item(
], ],
['COUNT(*) as total'], ['COUNT(*) as total'],
'AR', 'AR',
false false,
false,
0,
$is_meta
); );
$total_agents = ($agents_critical[0]['total'] + $agents_warning[0]['total'] + $agents_unknown[0]['total'] + $agents_ok[0]['total']); $total_agents = ($agents_critical[0]['total'] + $agents_warning[0]['total'] + $agents_unknown[0]['total'] + $agents_ok[0]['total']);
$stat_agent_ok = ($agents_ok[0]['total'] / $total_agents * 100); $stat_agent_ok = ($agents_ok[0]['total'] / $total_agents * 100);