From 96786e6490cc34c1f560fc299e00c271f26743f3 Mon Sep 17 00:00:00 2001 From: ArkHost <150489165+ARKHOST21@users.noreply.github.com> Date: Sat, 14 Jun 2025 03:10:00 +0200 Subject: [PATCH] Update ArkhostVPSAG.php --- modules/servers/ArkhostVPSAG/ArkhostVPSAG.php | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/modules/servers/ArkhostVPSAG/ArkhostVPSAG.php b/modules/servers/ArkhostVPSAG/ArkhostVPSAG.php index 46e7865..2d0778c 100644 --- a/modules/servers/ArkhostVPSAG/ArkhostVPSAG.php +++ b/modules/servers/ArkhostVPSAG/ArkhostVPSAG.php @@ -835,14 +835,41 @@ function ArkhostVPSAG_ClientArea(array $params) { // Process operating system info only if we have data if (isset($serverInfo['os']) && !empty($operatingSystemsTemp)) { - $serverInfo['operatingSystem'] = $serverInfo['os']; - $osIndex = array_search($serverInfo['operatingSystem'], array_column($operatingSystemsTemp, 'id')); + $osId = $serverInfo['os']; + $osIndex = array_search($osId, array_column($operatingSystemsTemp, 'id')); if ($osIndex !== false && isset($operatingSystemsTemp[$osIndex])) { - $serverInfo['operatingSystem'] = $operatingSystemsTemp[$osIndex]; - if (isset($serverInfo['operatingSystem']['group']) && isset($operatingSystems[$serverInfo['operatingSystem']['group']])) { - $serverInfo['operatingSystem'] = $operatingSystems[$serverInfo['operatingSystem']['group']]; + $currentOS = $operatingSystemsTemp[$osIndex]; + $osName = strtolower($currentOS['name']); + + // Determine the proper group based on current OS name + if (strpos($osName, 'almalinux') !== false || strpos($osName, 'alma') !== false) { + $group = 'almalinux'; + } elseif (strpos($osName, 'rocky') !== false || strpos($osName, 'rockylinux') !== false) { + $group = 'rocky'; + } elseif (strpos($osName, 'centos') !== false) { + $group = 'centos'; + } elseif (strpos($osName, 'debian') !== false) { + $group = 'debian'; + } elseif (strpos($osName, 'ubuntu') !== false) { + $group = 'ubuntu'; + } elseif (strpos($osName, 'windows') !== false) { + $group = 'windows'; + } else { + $group = $currentOS['group']; } + + // Use the specific OS information instead of the generic group + $serverInfo['operatingSystem'] = array( + 'name' => $currentOS['name'], + 'image' => isset($operatingSystems[$group]) ? $operatingSystems[$group]['image'] : 'data:image/png;base64,' . base64_encode(file_get_contents(__DIR__ . '/template/img/os/others.png')) + ); + } else { + // Fallback if OS not found in list + $serverInfo['operatingSystem'] = array( + 'name' => 'OS ID: ' . $osId, + 'image' => 'data:image/png;base64,' . base64_encode(file_get_contents(__DIR__ . '/template/img/os/others.png')) + ); } } }