Merge pull request #679 from bergware/mutli-language

Multi cache pool support
This commit is contained in:
tom mortensen
2020-05-12 08:26:56 -07:00
committed by GitHub
11 changed files with 17 additions and 22 deletions

View File

@@ -19,9 +19,6 @@ Cond="($pool_devices || $var['fsState']=='Stopped')"
function sharename($share) {
return substr($share,0,-4);
}
function escapestring($share) {
return "\"$share\"";
}
$bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c';
?>
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">

View File

@@ -227,9 +227,9 @@ function updateMode(form,mode) {
}
function validate(poolname) {
var valid = /^[a-z_]([a-z0-9_-]*[a-z_])*$/;
var reserved = [<?=implode(',',array_map('escapeshellarg',explode(',',$var['reservedNames'])))?>];
var shares = [<?=implode(',',array_map('escapeshellarg',array_filter(array_map('sharename',scandir('boot/config/shares')))))?>];
var pools = [<?=implode(',',array_map('escapeshellarg',$pools))?>];
var reserved = [<?=implode(',',array_map('escapestring',explode(',',$var['reservedNames'])))?>];
var shares = [<?=implode(',',array_map('escapestring',array_filter(array_map('sharename',scandir('boot/config/shares')))))?>];
var pools = [<?=implode(',',array_map('escapestring',$pools))?>];
if (!poolname.trim()) return false;
if (reserved.includes(poolname)) {
swal({title:'_(Invalid pool name)_',text:'_(Do not use reserved names)_',type:'error',confirmButtonText:'_(Ok)_'});

View File

@@ -671,7 +671,7 @@ _(Interface description)_:
: <span class="status vshift"><i id="tag-eth0-<?=$i?>" class="fa fa-fw fa-chevron-down" style="cursor:pointer" onclick="viewToggle('eth0','<?=$i?>')"></i></span>
<input type="text" name="DESCRIPTION:<?=$i?>" maxlength="80" value="<?=htmlspecialchars($eth0["DESCRIPTION:$i"])?>" onchange="exitCode(this.form,true)">
:eth_interface_description_help
:eth_interface_description_help:
<div markdown="1" id="view-eth0-<?=$i?>" style="display:none">
_(VLAN number)_:

View File

@@ -49,10 +49,6 @@ function globalInclude($name) {
return substr($name,0,4)=='disk' && (!$var['shareUserInclude'] || strpos("{$var['shareUserInclude']},","$name,")!==false);
}
function escapestring($share) {
return "\"$share\"";
}
// global shares include/exclude
$myDisks = array_filter(array_diff(array_keys(array_filter($disks,'my_disks')), explode(',',$var['shareUserExclude'])), 'globalInclude');
?>

View File

@@ -191,7 +191,9 @@ function plus($val, $word, $last) {
function compress($name,$size=18,$end=6) {
return strlen($name)<=$size ? $name : substr($name,0,$size-($end?$end+3:0)).'...'.($end?substr($name,-$end):'');
}
function escapestring($name) {
return "\"$name\"";
}
function read_parity_log($epoch, $busy=false) {
$log = '/boot/config/parity-checks.log';
if (file_exists($log)) {

View File

@@ -69,8 +69,8 @@ $language = [];
$locale = $_SESSION['locale'];
$return = "function _(t){return t;}";
$jscript = "$docroot/webGui/javascript/translate.en_US.js";
$root = "$docroot/webGui/help/helptext.txt";
$help = "$docroot/webGui/help/helptext.dot";
$root = "$docroot/languages/en_US/helptext.txt";
$help = "$docroot/languages/en_US/helptext.dot";
if ($locale) {
$text = "$docroot/languages/$locale/translations.txt";

View File

@@ -47,8 +47,8 @@ input.narrow{width:174px}
input.trim{width:74px;min-width:74px}
textarea{resize:none}
#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#edeaef;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #9794a0}
#header .logo{float:left;margin-left:75px;color:#e22828;width:160px;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 50px 8px 0}
#header .logo{float:left;margin-left:75px;color:#e22828;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
#header .block{margin:0;float:right;text-align:right;background-color:rgba(237,234,239,0.2);padding:10px 12px}
#header .text-left{float:left;text-align:right;padding-right:5px;border-right:solid medium #f15a2c}
#header .text-right{float:right;text-align:left;padding-left:5px}

View File

@@ -46,8 +46,8 @@ input.narrow{width:166px}
input.trim{width:76px;min-width:76px}
textarea{resize:none}
#header{position:absolute;top:0;left:0;width:100%;min-width:1260px;height:91px;z-index:100;margin:0;color:#1c1b1b;background-color:#f2f2f2;background-size:100% 90px;background-repeat:no-repeat}
#header .logo{float:left;margin-left:10px;color:#e22828;width:160px;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 50px 8px 0}
#header .logo{float:left;margin-left:10px;color:#e22828;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
#header .block{margin:0;float:right;text-align:right;background-color:rgba(242,242,242,0.2);padding:10px 12px}
#header .text-left{float:left;text-align:right;padding-right:5px;border-right:solid medium #f15a2c}
#header .text-right{float:right;text-align:left;padding-left:5px}

View File

@@ -47,8 +47,8 @@ input.narrow{width:174px}
input.trim{width:74px;min-width:74px}
textarea{resize:none}
#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#121510;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #42453e}
#header .logo{float:left;margin-left:75px;color:#e22828;width:160px;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 50px 8px 0}
#header .logo{float:left;margin-left:75px;color:#e22828;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
#header .block{margin:0;float:right;text-align:right;background-color:rgba(18,21,16,0.2);padding:10px 12px}
#header .text-left{float:left;text-align:right;padding-right:5px;border-right:solid medium #f15a2c}
#header .text-right{float:right;text-align:left;padding-left:5px}

View File

@@ -46,8 +46,8 @@ input.narrow{width:166px}
input.trim{width:76px;min-width:76px}
textarea{resize:none}
#header{position:absolute;top:0;left:0;width:100%;min-width:1260px;height:91px;z-index:100;margin:0;color:#f2f2f2;background-color:#1c1b1b;background-size:100% 90px;background-repeat:no-repeat}
#header .logo{float:left;margin-left:10px;color:#e22828;width:160px;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 50px 8px 0}
#header .logo{float:left;margin-left:10px;color:#e22828;text-align:center}
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
#header .block{margin:0;float:right;text-align:right;background-color:rgba(28,27,27,0.2);padding:10px 12px}
#header .text-left{float:left;text-align:right;padding-right:5px;border-right:solid medium #f15a2c}
#header .text-right{float:right;text-align:left;padding-left:5px}