Merge branch 'ent-6762-10981-10968' into 'develop'
fix api function show graph See merge request artica/pandorafms!3636
This commit is contained in:
commit
9d5759e0f3
|
@ -55,8 +55,6 @@ $password = get_parameter('pass', '');
|
||||||
$user = get_parameter('user', '');
|
$user = get_parameter('user', '');
|
||||||
$info = get_parameter('info', '');
|
$info = get_parameter('info', '');
|
||||||
|
|
||||||
$other = parseOtherParameter($otherSerialize, $otherMode);
|
|
||||||
|
|
||||||
$other = parseOtherParameter($otherSerialize, $otherMode);
|
$other = parseOtherParameter($otherSerialize, $otherMode);
|
||||||
$apiPassword = io_output_password(
|
$apiPassword = io_output_password(
|
||||||
db_get_value_filter(
|
db_get_value_filter(
|
||||||
|
|
|
@ -13766,12 +13766,19 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR;
|
if (is_array($other['data']) === true) {
|
||||||
// 1 hour by default.
|
$graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR;
|
||||||
$graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0;
|
// 1 hour by default.
|
||||||
|
$graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0;
|
||||||
|
|
||||||
// Graph height when send email by alert
|
// Graph height when send email by alert
|
||||||
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : null;
|
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : 225;
|
||||||
|
} else {
|
||||||
|
$graph_seconds = $other['data'];
|
||||||
|
$graph_threshold = 0;
|
||||||
|
$other['data'][1] = 0;
|
||||||
|
$height = 225;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_nan($graph_seconds) || $graph_seconds <= 0) {
|
if (is_nan($graph_seconds) || $graph_seconds <= 0) {
|
||||||
// returnError('error_module_graph', __(''));
|
// returnError('error_module_graph', __(''));
|
||||||
|
|
Loading…
Reference in New Issue