Fixed graph of tactical view in metaconsole.

This commit is contained in:
Vanessa Gil 2014-09-29 11:19:51 +02:00
parent d3d636bc32
commit cc5b488f38
2 changed files with 10 additions and 5 deletions

View File

@ -1512,7 +1512,7 @@ function truncate_negatives(&$element) {
* @param bool return or echo flag
* @param bool show_not_init flag
*/
function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $return = false, $show_not_init = false) {
function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $return = false, $show_not_init = false, $data_agents=false) {
global $config;
@ -1532,7 +1532,12 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re
$fields[] = 'SUM(notinit_count) "Not init"';
}
if ($data_agents == false) {
$data = db_get_row_filter('tagente', $filter, $fields);
} else {
$data = $data_agents;
}
if (empty($data)) {
$data = array();
}

View File

@ -1350,7 +1350,7 @@ function reporting_get_stats_servers($tiny = true) {
return $output;
}
function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false) {
function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false, $data_agents=false) {
global $config;
// Link URLS
@ -1421,7 +1421,7 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
$table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;';
$tdata[0] = '<div id="outter_status_pie" style="height: ' . $graph_height . 'px">' .
'<div id="status_pie" style="margin: auto; width: ' . $graph_width . 'px;">' .
graph_agent_status(false, $graph_width, $graph_height, true, true) .
graph_agent_status(false, $graph_width, $graph_height, true, true, $data_agents) .
'</div></div>';
$table_mbs->rowclass[] = '';
$table_mbs->data[] = $tdata;