diff --git a/plugins/dynamix/scripts/parity_history b/plugins/dynamix/scripts/parity_history index 157f98b36..ad37c3ce4 100755 --- a/plugins/dynamix/scripts/parity_history +++ b/plugins/dynamix/scripts/parity_history @@ -49,12 +49,12 @@ function this_duration($time) { $secs = $hmss%60; return this_plus($days,_('day'),($hour|$mins|$secs)==0).this_plus($hour,_('hr'),($mins|$secs)==0).this_plus($mins,_('min'),$secs==0).this_plus($secs,_('sec'),true); } -$log = "/boot/config/parity-checks.log"; -$head = ""; -$list = []; +$inlog = "/boot/config/parity-checks.log"; +$inhead = "
"._('Action').""._('Date').""._('Size').""._('Duration').""._('Speed').""._('Status').""._('Errors')."
"; +$inlist = []; -if (file_exists($log)) { - $handle = fopen($log, 'r'); +if (file_exists($inlog)) { + $handle = fopen($inlog, 'r'); while (($row = fgets($handle))!==false) { [$date,$duration,$speed,$status,$error,$action,$size] = my_explode('|',$row,7); $action = preg_split('/\s+/',$action); @@ -70,15 +70,15 @@ if (file_exists($log)) { // handle both old and new speed notation $speed = $speed ? (is_numeric($speed) ? my_scale($speed,$unit,1)." $unit/s" : $speed) : _('Unavailable'); $status = $status==0 ? _('OK') : ($status==-4 ? _('Canceled') : $status); - $list[] = ""; + $inlist[] = ""; } fclose($handle); } -if ($list) { - $list = array_reverse($list); +if ($inlist) { + $inlist = array_reverse($inlist); } else { - $list[] = ""; + $inlist[] = ""; } -write($head.implode($list)."
"._('Action').""._('Date').""._('Size').""._('Duration').""._('Speed').""._('Status').""._('Errors')."
$action$date$size$duration$speed$status$error
$action$date$size$duration$speed$status$error
"._('No parity check history present')."!
"._('No parity check history present')."!
"); -unset($head,$list); +write($inhead.implode($inlist).""); +unset($inhead,$inlist); ?> diff --git a/plugins/dynamix/scripts/system_information b/plugins/dynamix/scripts/system_information index 23cfbf8c7..6952fcc82 100755 --- a/plugins/dynamix/scripts/system_information +++ b/plugins/dynamix/scripts/system_information @@ -143,22 +143,22 @@ if ($memory_installed >= 1024) { $low = $memory_maximum < $memory_installed; if ($low) $memory_maximum = pow(2,ceil(log($memory_installed)/log(2))); -$style = ""; +$instyle = ""; -$list = []; -$list[] = ""; -$list[] = ""; -$list[] = ""; -$list[] = ""; -$list[] = ""; -$list[] = ""; -$list[] = ""; -$list[] = ""; +$inlist = []; +$inlist[] = "
"._('Model').":$model
".('M/B').":{$board['Manufacturer']} {$board['Product Name']} "._('Version')." {$board['Version']} - "._('s/n').": {$board['Serial Number']}
"._('BIOS').":{$bios['Vendor']} Version {$bios['Version']}. Dated: {$bios['Release Date']}
"._('CPU').":$cpumodel".(strpos($cpumodel,'@')===false && !empty($cpu['Current Speed']) ? " @ {$cpu['Current Speed']}" : "")."
"._('HVM').":$hvm
"._('IOMMU').":$iommu
"._('Cache').":".implode(', ',$cache_installed)."
$memory$memory_installed $unit $memory_type $ecc("._('max. installable capacity')." $memory_maximum $unit".($low?'*':'').")
"; +$inlist[] = ""; +$inlist[] = ""; +$inlist[] = ""; +$inlist[] = ""; +$inlist[] = ""; +$inlist[] = ""; +$inlist[] = ""; foreach ($memory_devices as $device) { if ($device['Type']=='Unknown') continue; $size = preg_replace('/( .)B$/','$1iB',$device['Size']); - $list[] = ""; + $inlist[] = ""; } exec("ls /sys/class/net|grep -Po '^(bond|eth)\d+$'",$sPorts); @@ -173,25 +173,25 @@ foreach ($sPorts as $port) { if (substr($port,0,4)=='bond') { if ($link) { $bond_mode = str_replace('Bonding Mode: ','',file("/proc/net/bonding/$port",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)[1]); - $list[] = ""; + $inlist[] = ""; } else { - $list[] = ""; + $inlist[] = ""; } } else { if ($link) { $speed = file_get_contents("$int/speed"); $duplex = file_get_contents("$int/duplex"); - $list[] = ""; + $inlist[] = ""; } else { - $list[] = ""; + $inlist[] = ""; } } } -$list[] = ""; -$list[] = ""; -$list[] = "
"._('Model').":$model
".('M/B').":{$board['Manufacturer']} {$board['Product Name']} "._('Version')." {$board['Version']} - "._('s/n').": {$board['Serial Number']}
"._('BIOS').":{$bios['Vendor']} Version {$bios['Version']}. Dated: {$bios['Release Date']}
"._('CPU').":$cpumodel".(strpos($cpumodel,'@')===false && !empty($cpu['Current Speed']) ? " @ {$cpu['Current Speed']}" : "")."
"._('HVM').":$hvm
"._('IOMMU').":$iommu
"._('Cache').":".implode(', ',$cache_installed)."
$memory$memory_installed $unit $memory_type $ecc("._('max. installable capacity')." $memory_maximum $unit".($low?'*':'').")
{$device['Manufacturer']} {$device['Part Number']}, {$size} {$device['Type']} @ {$device['Configured Memory Speed']}
{$device['Manufacturer']} {$device['Part Number']}, {$size} {$device['Type']} @ {$device['Configured Memory Speed']}
$name$port: $bond_mode, mtu $mtu
$name$port: $bond_mode, mtu $mtu
$name$port: "._("bond down")."
$name$port: "._("bond down")."
$name$port: $speed Mbps, $duplex duplex, mtu $mtu
$name$port: $speed Mbps, $duplex duplex, mtu $mtu
$name$port: "._("interface down")."
$name$port: "._("interface down")."
"._('Kernel').":$kernel
"._('OpenSSL').":$openssl
"._('Uptime').":
"; +$inlist[] = ""._('Kernel').":$kernel"; +$inlist[] = ""._('OpenSSL').":$openssl"; +$inlist[] = ""._('Uptime').":"; -write($style.implode($list)); -unset($style,$list); +write($instyle.implode($inlist)); +unset($instyle,$inlist); ?>