mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 00:09:27 -05:00
Multi cache pool support
This commit is contained in:
@@ -19,6 +19,9 @@ 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")?>">
|
||||
@@ -29,9 +32,9 @@ table.divider{margin-top:20px}
|
||||
<script>
|
||||
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,6 +49,10 @@ 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');
|
||||
?>
|
||||
@@ -268,12 +272,12 @@ function prepareEdit(form) {
|
||||
swal({title:'_(Missing share name)_',text:'_(Enter a name for the share)_',type:'error',confirmButtonText:'_(Ok)_'});
|
||||
return false;
|
||||
}
|
||||
var reserved = [<?=implode(',',array_map('escapeshellarg',explode(',',$var['reservedNames'])))?>];
|
||||
var reserved = [<?=implode(',',array_map('escapestring',explode(',',$var['reservedNames'])))?>];
|
||||
if (reserved.includes(share)) {
|
||||
swal({title:'_(Invalid share name)_',text:'_(Do not use reserved names)_',type:'error',confirmButtonText:'_(Ok)_'});
|
||||
return false;
|
||||
}
|
||||
var pools = [<?=implode(',',array_map('escapeshellarg',$pools))?>];
|
||||
var pools = [<?=implode(',',array_map('escapestring',$pools))?>];
|
||||
if (pools.includes(share)) {
|
||||
swal({title:'_(Invalid share name)_',text:'_(Do not use pool names)_',type:'error',confirmButtonText:'_(Ok)_'});
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user