mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated version_info to output unix timestamp
This commit is contained in:
@@ -237,5 +237,5 @@ echo "
|
|||||||
|
|
||||||
// convert the version date from ISO 8601 to the browser's timezone
|
// convert the version date from ISO 8601 to the browser's timezone
|
||||||
var ver_date = $('#version_date');
|
var ver_date = $('#version_date');
|
||||||
ver_date.text(new Date(ver_date.text()).toString());
|
ver_date.text(moment.unix(ver_date.text()));
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1038,7 +1038,7 @@ function version_info($remote=true) {
|
|||||||
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
|
||||||
$output['github'] = json_decode(curl_exec($api),true);
|
$output['github'] = json_decode(curl_exec($api),true);
|
||||||
}
|
}
|
||||||
list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ci' -s HEAD`));
|
list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ct' -s HEAD`));
|
||||||
$output['local_sha'] = $local_sha;
|
$output['local_sha'] = $local_sha;
|
||||||
$output['local_date'] = $local_date;
|
$output['local_date'] = $local_date;
|
||||||
$output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
|
$output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
|
||||||
|
@@ -76,7 +76,7 @@ $versions = version_info();
|
|||||||
echo "Version info:\n";
|
echo "Version info:\n";
|
||||||
$cur_sha = $versions['local_sha'];
|
$cur_sha = $versions['local_sha'];
|
||||||
if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
|
if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
|
||||||
$commit_date = new DateTime($versions['local_date'], new DateTimeZone(date_default_timezone_get()));
|
$commit_date = new DateTime('@'.$versions['local_date'], new DateTimeZone(date_default_timezone_get()));
|
||||||
print_warn("Your install is out of date: $cur_sha " . $commit_date->format('(r)'));
|
print_warn("Your install is out of date: $cur_sha " . $commit_date->format('(r)'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user