stat: Highlight deprecated versions of elwig

This commit is contained in:
2026-04-23 14:26:46 +02:00
parent aa3564284f
commit fbb0ac86d5
2 changed files with 14 additions and 1 deletions
+7 -1
View File
@@ -5,6 +5,10 @@ include ".php/devices.inc";
authenticate(['stat']);
$fileNames = array_filter(scandir('files/'), function($e) { return str_starts_with($e, 'Elwig-'); });
usort($fileNames, 'version_compare');
$latestVersion = sizeof($fileNames) > 0 ? substr(substr($fileNames[sizeof($fileNames) - 1], 6), 0, -4) : null;
$osVersions = [
'Microsoft Windows NT 10.0.10240.0' => 'Windows 10 (1507)',
'Microsoft Windows NT 10.0.10586.0' => 'Windows 10 (1511)',
@@ -238,7 +242,9 @@ EOF);
$active = $timestamp + 36 * 60 * 60 > time() ? 'online' : ($timestamp + 28 * 24 * 60 * 60 > time() ? 'offline' : 'inactive');
echo "<div class='device $active'>";
echo "<div class='versions'><span><img src='/favicon.ico' width='16' height='16'/> $d[0]</span>";
echo "<div class='versions'>";
$stat = $latestVersion === null ? '' : ($d[0] === $latestVersion ? 'latest' : 'deprecated');
echo "<span class='elwig $stat'><img src='/favicon.ico' width='16' height='16'/> $d[0]</span>";
if (isset($osVersions[$d[2]])) {
echo "<span class='os'>" . str_replace('Windows', "<img src='/res/windows.png' width='16' height='16'/> ", $osVersions[$d[2]]) . "</span>";
} else {