Commit 6441e52e authored by David Morley's avatar David Morley

Expose the last updated date to end users

parent b0fc042f
ALTER TABLE ratingcomments DROP COLUMN userurl;
UPDATE pods SET date_updated=null;
......@@ -204,7 +204,7 @@ foreach ($pods as $pod) {
die('Error in SQL query: ' . $e->getMessage());
}
$lastdatechecked = ($lastpodupdates['date_checked'] ?? date('Y-m-d H:i:s'));
$lastdatechecked = ($lastpodupdates['date_checked'] ?? date('Y-m-d H:i:s.u'));
$devlastdays = $devlastcommit ? date_diff(new DateTime($devlastcommit), new DateTime())->format('%a') : 30;//tmp//if no dev branch then what?
debug('Dev last commit was ', $devlastdays);
......@@ -382,8 +382,8 @@ foreach ($pods as $pod) {
$p['monthsmonitored'] = $months;
$p['uptime_alltime'] = $uptime;
$p['status'] = $status;
$p['date_laststats'] = date('Y-m-d H:i:s');
$p['date_updated'] = $lastdatechecked;
$p['date_laststats'] = date('Y-m-d H:i:s.u');
$p['date_updated'] = $lastpodupdates['date_checked'];
$p['latency'] = $avglatency;
$p['score'] = $score;
$p['country'] = $country;
......
......@@ -57,8 +57,8 @@ foreach ($pods as $pod) {
$classver = 'text-danger';
}
echo '<td>' . $pod['name'] . '</td>';
$lastupdated = ($pod['date_updated'] ? Carbon::createFromFormat('Y-m-d H:i:s',$pod['date_updated'])->diffForHumans() : 'unknown');
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ?: 'unknown') . ' code was last updated: ' . $lastupdated . '" data-toggle="tooltip">' . $version . '</div></td>';
$lastupdated = ($pod['date_updated'] ? Carbon::createFromFormat('Y-m-d H:i:s.u',$pod['date_updated'])->diffForHumans() : 'unknown');
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ?: 'unknown') . ' pod code was last updated: ' . $lastupdated . '" data-toggle="tooltip">' . $version . '</div></td>';
echo '<td>' . $pod['softwarename'] . '</td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td>' . ($pod['ipv6'] ? 'Yes' : 'No') . '</td>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment