Merge pull request #641 from bergware/mutli-language

Multi cache pool support
This commit is contained in:
tom mortensen
2020-04-06 12:03:35 -07:00
committed by GitHub
7 changed files with 37 additions and 9 deletions
+2 -2
View File
@@ -346,8 +346,7 @@ function cache_slots($off,$pool,$min,$slots) {
return $out;
}
$crypto = false;
$cache = cache_filter($disks);
$pools = pools_filter($cache);
$pools = pools_filter($disks);
switch ($_POST['device']) {
case 'array':
$parity = parity_filter($disks);
@@ -382,6 +381,7 @@ case 'flash':
echo "</tr>";
break;
case 'cache':
$cache = cache_filter($disks);
foreach ($pools as $pool) {
$tmp = "/var/tmp/$pool.log.tmp";
foreach ($cache as $disk) if (prefix($disk['name'])==$pool) $crypto |= $disk['luksState']!=0 || vfs_luks($disk['fsType']);
+2 -1
View File
@@ -53,7 +53,8 @@ function my_temp($value) {
return is_numeric($value) ? (($unit=='F' ? round(9/5*$value+32) : str_replace('.', $number[0], $value))." $unit") : $value;
}
function my_disk($name) {
return ucfirst(preg_replace('/(\d+)$/',' $1',$name));
global $display;
return $display['raw'] ? $name : ucfirst(preg_replace('/(\d+)$/',' $1',$name));
}
function my_disks($disk) {
return strpos($disk['status'],'_NP')===false;
+2 -2
View File
@@ -52,8 +52,8 @@ function my_lang($text,$do=0) {
foreach ($keys as $key) if (isset($language[$key])) $text = preg_replace("/\b$key\b/",$language[$key],$text);
break;
case 3: // device translation
[$p1,$p2] = explode(' ',$text);
$text = rtrim(_($p1)." $p2");
[$p1,$p2] = preg_split('/(?<=[a-z])(?= ?[0-9]+)/i',$text);
$text = _($p1).$p2;
}
return $text;
}