API module graph width
This commit is contained in:
parent
b2d1369717
commit
1534fd9c40
|
@ -178,14 +178,19 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
|
||||
$params_combined = json_decode($data_combined, true);
|
||||
$module_list = json_decode($data_module_list, true);
|
||||
$type_graph_pdf = $type_graph_pdf;
|
||||
|
||||
if (isset($params['vconsole']) === false || $params['vconsole'] === false) {
|
||||
$params['width'] = (int) $viewport_width;
|
||||
if ((int) $viewport_width > 0) {
|
||||
$params['width'] = (int) $viewport_width;
|
||||
}
|
||||
|
||||
if ((isset($params['width']) === false
|
||||
|| ($params['width'] <= 0))
|
||||
) {
|
||||
$params['width'] = 650;
|
||||
if ((int) $params['width'] <= 0) {
|
||||
$params['width'] = 650;
|
||||
}
|
||||
|
||||
if ((int) $params['landscape'] === 1) {
|
||||
$params['width'] = 850;
|
||||
}
|
||||
|
|
|
@ -13767,16 +13767,18 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
|||
}
|
||||
|
||||
if (is_array($other['data']) === true) {
|
||||
// Parameters received by user call.
|
||||
$graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR;
|
||||
// 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'][1]) && $other['data'][1]) ? $other['data'][1] : 0;
|
||||
|
||||
// Graph height when send email by alert
|
||||
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : 225;
|
||||
$height = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 225;
|
||||
|
||||
// Graph width (optional).
|
||||
$width = (!empty($other) && isset($other['data'][4]) && $other['data'][4]) ? $other['data'][4] : 225;
|
||||
$width = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : '';
|
||||
} else {
|
||||
// Fixed parameters for _modulegraph_nh_.
|
||||
$graph_seconds = $other['data'];
|
||||
$graph_threshold = 0;
|
||||
$other['data'][1] = 0;
|
||||
|
|
Loading…
Reference in New Issue