This commit is contained in:
fbsanchez 2021-03-05 11:17:50 +01:00
parent ae3d54cedf
commit bcde9f940e
1 changed files with 3 additions and 3 deletions

View File

@ -13773,7 +13773,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
$graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR; $graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR;
// Base64. // Base64.
$graph_threshold = (!empty($other) && isset($other['data'][1]) && $other['data'][1]) ? $other['data'][1] : 0; $base64 = $other['data'][1];
// 1 hour by default. // 1 hour by default.
$graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0; $graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0;
@ -13787,7 +13787,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
// Fixed parameters for _modulegraph_nh_. // Fixed parameters for _modulegraph_nh_.
$graph_seconds = $other['data']; $graph_seconds = $other['data'];
$graph_threshold = 0; $graph_threshold = 0;
$other['data'][1] = 0; $base64 = 0;
$height = 225; $height = 225;
$width = '90%'; $width = '90%';
} }
@ -13823,7 +13823,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
$graph_html = grafico_modulo_sparse($params); $graph_html = grafico_modulo_sparse($params);
if ($other['data'][1]) { if ($base64) {
header('Content-type: text/html'); header('Content-type: text/html');
returnData('string', ['type' => 'string', 'data' => '<img src="data:image/jpeg;base64,'.$graph_html.'">']); returnData('string', ['type' => 'string', 'data' => '<img src="data:image/jpeg;base64,'.$graph_html.'">']);
} else { } else {