mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Convert LastSync date for oxidized config info (#11779)
* Convert LastSync date for oxidized config info. Add format in settings. * commas and spaces fix * commas and spaces fix2 * fixed time if oxidized returned null * commas and spaces fix * datetime format fix * UTC is already in the string Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -132,6 +132,12 @@ if (Auth::user()->hasGlobalAdmin()) {
|
||||
// fetch info about the node and then a list of versions for that node
|
||||
$node_info = json_decode(file_get_contents(Config::get('oxidized.url') . '/node/show/' . $oxidized_hostname . '?format=json'), true);
|
||||
|
||||
if (!empty($node_info['last']['start'])) {
|
||||
$node_info['last']['start']=date(Config::get('dateformat.long'), strtotime($node_info['last']['start']));
|
||||
}
|
||||
if (!empty($node_info['last']['end'])) {
|
||||
$node_info['last']['end']=date(Config::get('dateformat.long'), strtotime($node_info['last']['end']));
|
||||
}
|
||||
// Try other hostname format if Oxidized request failed
|
||||
if (! $node_info) {
|
||||
// Adjust hostname based on whether domain was already in it or not
|
||||
|
Reference in New Issue
Block a user