From 028c16be3d0f4b281d98965a05c12c5472518f30 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 4 May 2026 20:19:35 +0200 Subject: [PATCH] stat: Highlight deprecated Windows versions --- www/res/stat.css | 4 ++-- www/stat.php | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/www/res/stat.css b/www/res/stat.css index 3425c27..db6cf03 100644 --- a/www/res/stat.css +++ b/www/res/stat.css @@ -82,7 +82,7 @@ justify-content: space-between; } -.device:not(.inactive) .versions .elwig.deprecated { +.device:not(.inactive) .versions .deprecated { color: #C00000; } @@ -119,7 +119,7 @@ img { .device.online .date { color: #00A000; } - .device:not(.inactive) .versions .elwig.deprecated { + .device:not(.inactive) .versions .deprecated { color: #E00000; } } diff --git a/www/stat.php b/www/stat.php index f61eafb..cad7b42 100644 --- a/www/stat.php +++ b/www/stat.php @@ -31,6 +31,11 @@ $osVersions = [ 'Microsoft Windows NT 10.0.26200.0' => 'Windows 11 (25H2)', ]; +$latestOsVersions = []; +foreach ($osVersions as $id => $name) { + $latestOsVersions[substr($name, 0, 10)] = $name; +} + $DEVICES ??= []; if ($_SERVER['PATH_INFO'] === '/log') { @@ -45,7 +50,7 @@ cat files/.log.csv \ EOF); } else { passthru(<<:g;s:^::g;s:$::g' EOF); @@ -60,7 +65,7 @@ EOF); $line = explode('|', $line); if (sizeof($line) < 6) continue; if (!str_starts_with($line[5], 'Elwig/')) continue; - if (str_contains($line[5], "PICARD") || str_contains($line[5], "ENTERPRISE") || str_contains($line[5], "GEORGIOU") || str_contains($line[5], "78A16E85-410A-4")) continue; + if (str_contains($line[5], "WGX") || str_contains($line[5], "PICARD") || str_contains($line[5], "ENTERPRISE") || str_contains($line[5], "GEORGIOU") || str_contains($line[5], "78A16E85-410A-4")) continue; $timestamp = intval($line[0]); $version = substr(explode(' ', $line[5], 2)[0], 6); $comment = preg_match("/\((.*?), *(.*?), *(.*?), *(.*?)\)/", $line[5], $m); @@ -243,10 +248,13 @@ EOF); echo "
"; echo "
"; - $stat = $latestVersion === null ? '' : ($d[0] === $latestVersion ? 'latest' : 'deprecated'); - echo " $d[0]"; + $elwigVers = $latestVersion === null ? '' : ($d[0] === $latestVersion ? 'latest' : 'deprecated'); + echo " $d[0]"; if (isset($osVersions[$d[2]])) { - echo "" . str_replace('Windows', " ", $osVersions[$d[2]]) . ""; + $v = $osVersions[$d[2]]; + $l = $latestOsVersions[substr($v, 0, 10)] ?? null; + $osVers = $l === null ? '' : ($l === $v ? 'latest' : 'deprecated'); + echo "" . str_replace('Windows', " ", $v) . ""; } else { echo "$d[2]"; }