Added no data to show to some graphs where id not found

Former-commit-id: 1697a482e80521666f679eb18d2f44fc3975e304
This commit is contained in:
fermin831 2019-02-25 16:50:27 +01:00
parent d8ee90c285
commit ac9452583a
1 changed files with 19 additions and 6 deletions

View File

@ -549,12 +549,6 @@ function grafico_modulo_sparse($params)
return false;
}
if (!isset($params['agent_module_id'])) {
return false;
} else {
$agent_module_id = $params['agent_module_id'];
}
if (!isset($params['period'])) {
return false;
}
@ -710,6 +704,12 @@ function grafico_modulo_sparse($params)
$params['projection'] = false;
}
if (!isset($params['agent_module_id'])) {
return graph_nodata_image($params['width'], $params['height']);
} else {
$agent_module_id = $params['agent_module_id'];
}
// XXXX Configurable
$params['grid_color'] = '#C1C1C1';
$params['legend_color'] = '#636363';
@ -1318,6 +1318,10 @@ function graphic_combined_module(
$array_data = [];
foreach ($module_list as $key => $agent_module_id) {
if ((bool) $agent_module_id === false) {
continue;
}
if (is_metaconsole() && $params_combined['type_report'] == 'automatic_graph') {
$server = metaconsole_get_connection_by_id($agent_module_id['server']);
if (metaconsole_connect($server) != NOERR) {
@ -1394,6 +1398,15 @@ function graphic_combined_module(
}
}
if (empty($array_data)) {
if ($params_combined['return']) {
return graph_nodata_image($width, $height);
}
echo graph_nodata_image($width, $height);
return false;
}
if ($params_combined['projection']) {
// If projection doesn't have data then don't draw graph
if ($output_projection != null) {