From cdc6cf27214137a698afde8e7d83de082c1ea4e1 Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:30:16 +0100 Subject: [PATCH] Update Memory size and Nic speeds to support higher sizes --- emhttp/plugins/dynamix/nchan/update_3 | 3 ++- emhttp/plugins/dynamix/scripts/system_information | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/emhttp/plugins/dynamix/nchan/update_3 b/emhttp/plugins/dynamix/nchan/update_3 index b4053c8a8..d9d8be998 100755 --- a/emhttp/plugins/dynamix/nchan/update_3 +++ b/emhttp/plugins/dynamix/nchan/update_3 @@ -132,7 +132,8 @@ while (true) { if ($link) { $speed = port_get_contents("$net/$port/speed"); $duplex = port_get_contents("$net/$port/duplex"); - $echo['mode'][] = "$speed Mbps, $duplex duplex, mtu $mtu"; + $speed = ($speed >= 1000) ? ($speed/1000)." Gbps" : $speed." Mbps"; + $echo['mode'][] = "$speed, $duplex duplex, mtu $mtu"; } else { $echo['mode'][] = _('interface down'); } diff --git a/emhttp/plugins/dynamix/scripts/system_information b/emhttp/plugins/dynamix/scripts/system_information index 51a49378e..c4e3262cd 100755 --- a/emhttp/plugins/dynamix/scripts/system_information +++ b/emhttp/plugins/dynamix/scripts/system_information @@ -117,11 +117,16 @@ foreach ($memory_array as $device) { if ($base>=1) $memory_maximum += $size*pow(1024,$base); if (!$ecc && isset($device['Error Correction Type']) && $device['Error Correction Type']!='None') $ecc = $device['Error Correction Type']." "; } +if ($memory_installed >= 1048576) { + $memory_installed = round($memory_installed/1048576); + $memory_maximum = round($memory_maximum/1048576); + $unit = 'TiB'; +} else { if ($memory_installed >= 1024) { $memory_installed = round($memory_installed/1024); $memory_maximum = round($memory_maximum/1024); - $unit = 'GiB'; -} else $unit = 'MiB'; + $unit = 'GiB';} +else $unit = 'MiB'; } // If maximum < installed then roundup maximum to the next power of 2 size of installed. E.g. 6 -> 8 or 12 -> 16 $low = $memory_maximum < $memory_installed; @@ -187,7 +192,8 @@ foreach ($sPorts as $port) { if ($link) { $speed = file_get_contents("$int/speed"); $duplex = file_get_contents("$int/duplex"); - echo "$name$port: $speed Mbps, $duplex duplex, mtu $mtu"; + $speed = ($speed >= 1000) ? ($speed/1000)." Gbps" : $speed." Mbps"; + echo "$name$port: $speed, $duplex duplex, mtu $mtu"; } else { echo "$name$port: ",_('interface down'),""; }