From 028c4a9cb42d0e6408c8610355d9a54fa4afcaf1 Mon Sep 17 00:00:00 2001 From: Carlos V <76731844+cvc90@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:51:19 +0200 Subject: [PATCH] Update systeminfo.php Cleaning and fixing code in the "Storage usage" section --- front/systeminfo.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/front/systeminfo.php b/front/systeminfo.php index b20750d3..d664cdc9 100755 --- a/front/systeminfo.php +++ b/front/systeminfo.php @@ -365,15 +365,17 @@ echo '
'; for ($x = 0; $x < sizeof($hdd_devices); $x++) { if (stristr($hdd_devices[$x], '/dev/')) { - if ($hdd_devices_total[$x] == 0) {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_total = trim($temp_total);} - if ($hdd_devices_used[$x] == 0) {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_used = trim($temp_total);} - if ($hdd_devices_free[$x] == 0) {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_free = trim($temp_total);} + if (!stristr($hdd_devices[$x], '/loop')) { + if ($hdd_devices_total[$x] == 0 || $hdd_devices_total[$x] == '') {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_total = trim($temp_total);} + if ($hdd_devices_used[$x] == 0 || $hdd_devices_used[$x] == '') {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_used = trim($temp_total);} + if ($hdd_devices_free[$x] == 0 || $hdd_devices_free[$x] == '') {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_free = trim($temp_total);} echo '
'; echo '
"' . lang('Systeminfo_Storage_Usage_Mount') . ' ' . $hdd_devices_mount[$x] . '"
'; echo '
' . lang('Systeminfo_Storage_Usage_Total') . ' ' . $temp_total . ' GB
'; echo '
' . lang('Systeminfo_Storage_Usage_Used') . ' ' . $temp_used . ' GB (' . $hdd_devices_percent[$x]. ')
'; echo '
' . lang('Systeminfo_Storage_Usage_Free') . ' ' . $temp_free . ' GB
'; echo '
'; + } } } #echo '
' . $lang['SysInfo_storage_note'];