mirror of
https://github.com/unraid/webgui.git
synced 2026-02-07 09:29:18 -06:00
Multi cache pool support
This commit is contained in:
@@ -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")?>">
|
||||
|
||||
@@ -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)_'});
|
||||
|
||||
@@ -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');
|
||||
?>
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user