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:
Negatifff
2020-08-18 19:18:54 +03:00
committed by GitHub
parent 0f74406dbd
commit 71d27de3c9

View File

@@ -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