From fbb0ac86d56bf2d4c50db0c750c329f6c492aaac Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 23 Apr 2026 14:26:46 +0200 Subject: [PATCH] stat: Highlight deprecated versions of elwig --- www/res/stat.css | 7 +++++++ www/stat.php | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/www/res/stat.css b/www/res/stat.css index c150e87..3425c27 100644 --- a/www/res/stat.css +++ b/www/res/stat.css @@ -82,6 +82,10 @@ justify-content: space-between; } +.device:not(.inactive) .versions .elwig.deprecated { + color: #C00000; +} + img { width: 1em; height: 1em; @@ -115,4 +119,7 @@ img { .device.online .date { color: #00A000; } + .device:not(.inactive) .versions .elwig.deprecated { + color: #E00000; + } } diff --git a/www/stat.php b/www/stat.php index af7df78..f61eafb 100644 --- a/www/stat.php +++ b/www/stat.php @@ -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 "
"; - echo "
$d[0]"; + echo "
"; + $stat = $latestVersion === null ? '' : ($d[0] === $latestVersion ? 'latest' : 'deprecated'); + echo " $d[0]"; if (isset($osVersions[$d[2]])) { echo "" . str_replace('Windows', " ", $osVersions[$d[2]]) . ""; } else {