mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Fix last value meta and status bug
This commit is contained in:
parent
fd75b5360f
commit
7fc62b4a2c
@ -4176,15 +4176,26 @@ function reporting_last_value($report, $content, $datetime, $period)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$search_in_history_db = db_search_in_history_db($datelimit);
|
$search_in_history_db = db_search_in_history_db($datetime);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$module->connectNode();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// Do not link items if failed to find them.
|
||||||
|
$module->restoreConnection();
|
||||||
|
}
|
||||||
|
|
||||||
$datos = db_get_row_sql($sql, $search_in_history_db);
|
$datos = db_get_row_sql($sql, $search_in_history_db);
|
||||||
|
|
||||||
|
// Restore if needed.
|
||||||
|
$module->restoreConnection();
|
||||||
|
|
||||||
if ($datos !== false) {
|
if ($datos !== false) {
|
||||||
$result['datos'] = $datos['datos'];
|
$result['datos'] = $datos['datos'];
|
||||||
$result['utimestamp'] = $datos['utimestamp'];
|
$result['utimestamp'] = $datos['utimestamp'];
|
||||||
} else {
|
} else {
|
||||||
$result = [];
|
|
||||||
|
|
||||||
$result['utimestamp'] = '-';
|
$result['utimestamp'] = '-';
|
||||||
|
$result['estado'] = AGENT_MODULE_STATUS_NO_DATA;
|
||||||
$result['datos'] = __('No data to display within the selected interval');
|
$result['datos'] = __('No data to display within the selected interval');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user