DeviceInfo page improvements:

* Present confirmation dialog for Delete Pool operation
* Fix expansion of single device pool to multi-device zfs mirror or btrfs raid-1
This commit is contained in:
Tom Mortensen
2024-08-01 21:38:33 -07:00
parent ed308c3a69
commit 3f103f2089

View File

@@ -20,7 +20,6 @@ require_once "$docroot/webGui/include/Preselect.php";
$unassigned = array_key_exists($name,$devs);
$disk = $disks[$name] ?? $devs[$name] ?? [];
$dev = _var($disk,'device');
$disk['id'] = _var($disk,'id');
$events = explode('|',$disk['smEvents'] ?? $var['smEvents'] ?? $numbers);
$mode = ['Disabled','Hourly','Daily','Weekly','Monthly'];
$days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
@@ -43,7 +42,9 @@ $tag = _var($disk,'name');
$end = count($sheets)-1;
$prev = $i>0 ? $sheets[$i-1] : $sheets[$end];
$next = $i<$end ? $sheets[$i+1] : $sheets[0];
$text = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content');
$textErase = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content');
$textDelete = _('This will unassign all devices from the pool but will NOT modify any device contents');
$fsTypeImmutable = (_var($var,'fsState')=="Stopped" && (_var($disk,'fsType')=='auto' || _var($disk,'slots',1)==1)) ? 'false' : 'true';
function disabled_if($condition) {
if ($condition !== false) echo ' disabled';
@@ -114,12 +115,12 @@ function isPool($name) {
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<script>
<?if (empty($disk)):?>
done();
<?endif;?>
String.prototype.celsius = function(){return Math.round((parseInt(this)-32)*5/9).toString();}
if ($.cookie('deletepool')) {
$.removeCookie('deletepool');
done();
}
function setFloor() {
if ($('#shareFloor').length==0) return;
const fsSize = {<?=fsSize()?>};
@@ -199,36 +200,32 @@ function prepareZFS(form) {
<?endif;?>
function selectDiskFsWidth() {
var num_slots = <?=_var($disk,'slots',0)?>;
var selected_width = <?=_var($disk,'fsWidth',0)?>;
$('#diskFsWidthZFS').empty();
if (num_slots == 0) {
$('#diskFsWidthZFS').prop('disabled',true).append($('<option>', {
value: 0,
text: "<?=_('no devices')?>"
}));
} else if (($('#diskFsType').val()||'').indexOf('zfs') == -1) {
var label = (num_slots == 1) ? "device" : "devices";
$('#diskFsWidthZFS').append($('<option>', {
value: num_slots,
text: _(sprintf('%s '+label,num_slots))
}));
} else if ($('#diskFsProfileZFS').val() == '') {
var label = (num_slots == 1) ? "device" : "devices";
$('#diskFsWidthZFS').append($('<option>', {
var slots = <?=_var($disk,'slots',1)?>;
$('#diskFsWidth').empty();
$('#diskFsWidth').append($('<option>', {
value: slots,
text: ''
}));
}
function selectDiskFsWidthZFS() {
var immutable = <?=$fsTypeImmutable?>;
var slots = <?=_var($disk,'slots',1)?>;
$('#diskFsWidth').empty();
if ($('#diskFsProfileZFS').val() == '') {
var label = (slots == 1) ? "device" : "devices";
$('#diskFsWidth').append($('<option>', {
value: 1,
text: _(sprintf('%s '+label,num_slots))
text: _(sprintf('%s '+label,slots))
}));
} else if ($('#diskFsProfileZFS').val() == 'mirror') {
var width;
for (width=2; width<=Math.min(num_slots,4); width++) {
if ((num_slots % width) == 0) {
var groups = num_slots / width;
for (width=2; width<=Math.min(slots,4); width++) {
if ((slots % width) == 0) {
var groups = slots / width;
var label = (groups == 1) ? "group" : "groups";
$('#diskFsWidthZFS').append($('<option>', {
$('#diskFsWidth').append($('<option>', {
value: width,
text: _(sprintf('%s '+label+' of %s devices',groups,width)),
selected: (width == selected_width)
}));
}
}
@@ -237,74 +234,72 @@ function selectDiskFsWidth() {
if ($('#diskFsProfileZFS').val() == 'raidz1') min_width = 3;
else if ($('#diskFsProfileZFS').val() == 'raidz2') min_width = 3;
else if ($('#diskFsProfileZFS').val() == 'raidz3') min_width = 4;
for (width=min_width; width<=num_slots; width++) {
if ((num_slots % width) == 0) {
var groups = num_slots / width;
for (width=min_width; width<=slots; width++) {
if ((slots % width) == 0) {
var groups = slots / width;
var label = (groups == 1) ? "group" : "groups";
$('#diskFsWidthZFS').append($('<option>', {
$('#diskFsWidth').append($('<option>', {
value: width,
text: _(sprintf('%s '+label+' of %s devices',groups,width)),
selected: (width == selected_width)
}));
}
}
if (immutable) $('#diskFsWidth').val(<?=_var($disk,'fsWidth')?>);
}
}
function selectDiskFsProfile(init) {
var num_slots = <?=_var($disk,'slots',0)?>;
var immutable = <?=$fsTypeImmutable?>;
var slots = <?=_var($disk,'slots',1)?>;
var fsType = "<?=_var($disk,'fsType')?>";
var subpool = "<?=isSubpool(_var($disk,'name'))?>";
var t = init ? null : 'slow';
$('#diskFsType').prop('disabled',immutable);
if (($('#diskFsType').val()||'').indexOf('auto') != -1) {
$('#diskFsProfileBTRFS').prop('disabled',true).hide();
$('#diskFsProfileZFS').prop('disabled',true).hide();
$('#diskFsWidthZFS').hide();;
$('#compression').hide(t);
$('#autotrim').hide(t);
} else if (($('#diskFsType').val()||'').indexOf('btrfs') != -1) {
if (!init) $('#diskFsProfileBTRFS').prop('disabled',false);
$('#diskFsProfileBTRFS').show();
$('#diskFsProfileZFS').prop('disabled',true).hide();
$('#diskFsWidthZFS').hide();;
$('#compression').show(t);
<?if (diskType('Cache')):?>
$('#autotrim').show(t);
if (!init) {
if (num_slots == 1) $('#diskFsProfileBTRFS').val('');
if (num_slots > 1) $('#diskFsProfileBTRFS').val('raid1');
$('#diskFsWidth').hide();
$('#compression').prop('disabled',true).hide(t);
$('#autotrim').prop('disabled',true).hide(t);
selectDiskFsWidth();
} else {
if (($('#diskFsType').val()||'').indexOf('btrfs') != -1) {
$('#diskFsProfileZFS').prop('disabled',true).hide();
$('#diskFsProfileBTRFS').prop('disabled',immutable);
if (slots > 1) $('#diskFsProfileBTRFS').show();
$('#diskFsWidth').prop('disabled',immutable).hide();;
$('#compression').prop('disabled',false).show(t);
if (!immutable && ($('#diskFsType').val() !== fsType)) {
if (slots == 1) $('#diskFsProfileBTRFS').val('');
if (slots > 1) $('#diskFsProfileBTRFS').val('raid1');
}
selectDiskFsWidth();
} else if (($('#diskFsType').val()||'').indexOf('zfs') != -1) {
$('#diskFsProfileBTRFS').prop('disabled',true).hide();
if (slots == 1) {
$('#diskFsProfileZFS').prop('disabled',immutable).hide();
$('#diskFsWidth').prop('disabled',immutable).hide();
}
else {
$('#diskFsProfileZFS').prop('disabled',immutable).show();
$('#diskFsWidth').prop('disabled',immutable).show();
}
if (!immutable && ($('#diskFsType').val() !== fsType)) {
if (slots == 1) $('#diskFsProfileZFS').val('');
if (slots == 2) $('#diskFsProfileZFS').val('mirror');
if (slots > 2) $('#diskFsProfileZFS').val('raidz1');
}
$('#compression').prop('disabled',false).show(t);
selectDiskFsWidthZFS();
} else if (($('#diskFsType').val()||'').indexOf('xfs') != -1) {
$('#compression').prop('disabled',true).hide(t);
selectDiskFsWidth();
}
<?endif;?>
} else if (($('#diskFsType').val()||'').indexOf('zfs') != -1) {
var subpool = "<?=isSubpool(_var($disk,'name'))?>";
$('#diskFsProfileBTRFS').prop('disabled',true).hide();
if (subpool.length) {
$('#diskFsType').prop('disabled',true).hide();
}
if (!init) {
$('#diskFsProfileZFS').prop('disabled',false);
}
$('#diskFsProfileZFS').show();
$('#diskFsWidthZFS').show();
if (!init) {
if (num_slots == 1) $('#diskFsProfileZFS').val('');
if (num_slots == 2) $('#diskFsProfileZFS').val('mirror');
if (num_slots > 2) $('#diskFsProfileZFS').val('raidz1');
}
$('#compression').show(t);
<?if (diskType('Cache')):?>
$('#autotrim').show(t);
} else if (($('#diskFsType').val()||'').indexOf('xfs') != -1) {
$('#autotrim').show(t);
<?if (diskType('Data')):?>
$('#autotrim').prop('disabled',true).hide(t);
<?else:?>
$('#autotrim').prop('disabled',false).show(t);
<?endif;?>
}
selectDiskFsWidth();
$('#diskFsGroups').val(0);
}
function changeFsType() {
var fstype = ($('#diskFsType').val()||'').replace('luks:','');
if (['btrfs', 'zfs'].includes(fstype)) $('#compression').show('slow'); else $('#compression').hide('slow');
<?if (diskType('Cache')):?>
if (['xfs', 'btrfs', 'zfs'].includes(fstype)) $('#autotrim').show('slow'); else $('#autotrim').hide('slow');
<?endif;?>
if (fstype=='reiserfs') $('#reiserfs').show(); else $('#reiserfs').hide();
}
function prepareDeviceInfo(form) {
var events = [];
@@ -539,14 +534,10 @@ function renamePoolPopup() {
});
dialogStyle();
}
function deletePool() {
$.cookie('deletepool','deletepool');
document.deletepool.submit();
}
function eraseDisk(name) {
swal({
title:"_(Erase Device Content)_?",
text:"<?=$text?><p style='font-weight:bold;color:red;margin:8px 0'>_(Existing content is permanently lost)_</p>",
text:"<?=$textErase?><p style='font-weight:bold;color:red;margin:8px 0'>_(Existing content is permanently lost)_</p>",
html:true,
type:'input',
inputPlaceholder:"<?=sprintf(_('To confirm your action type: %s'),$name)?>",
@@ -560,8 +551,37 @@ function eraseDisk(name) {
swal.close();
$('#doneButton').prop('disabled',true);
$('#eraseButton').prop('disabled',true);
$('#deleteButton').prop('disabled',true);
$('div.spinner.fixed').show();
$.get("/update.htm",{cmdWipefs:name,csrf_token:"<?=_var($var,'csrf_token')?>"},function(){
$.post("/update.htm",{cmdWipefs:name},function(){
$('div.spinner.fixed').hide();
refresh();
});
} else {
if (confirm.length) swal({title:"_(Incorrect confirmation)_",text:"_(Please try again)_!",type:'error',html:true,confirmButtonText:"_(Ok)_"});
}
});
}
function deletePool(name) {
swal({
title:"_(Delete pool)_?",
text:"<?=$textDelete?>",
html:true,
type:'input',
inputPlaceholder:"<?=sprintf(_('To confirm your action type: %s'),$name)?>",
showCancelButton:true,
closeOnConfirm:false,
confirmButtonText:"_(Proceed)_",
cancelButtonText:"_(Cancel)_"
},
function(confirm){
if (confirm == "<?=$name?>") {
swal.close();
$('#doneButton').prop('disabled',true);
$('#eraseButton').prop('disabled',true);
$('#deleteButton').prop('disabled',true);
$('div.spinner.fixed').show();
$.post("/update.htm",{changeSlots:"apply",poolName:name,poolSlots:0},function(){
$('div.spinner.fixed').hide();
refresh();
});
@@ -632,83 +652,56 @@ _(Spin down delay)_:
<?endif;?>
<?if (diskType('Data') || isPool($tag)):?>
<?$fsTypeImmutable = _var($var,'fsState')=="Started" || (isPool($tag) && _var($disk,'state')!="NEW_ARRAY")?>
<?if (diskType('Data') || (!isSubpool($name) && _var($disk,'slots',0)==1)):?>
<?if (!isSubpool($name)):?>
_(File system status)_:
: <?=_(_var($disk,'fsStatus'))?>&nbsp;
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="changeFsType()" <?=disabled_if($fsTypeImmutable)?>>
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)">
<?=mk_option(_var($disk,'fsType'), "auto", _('auto'))?>
<?=mk_option(_var($disk,'fsType'), "xfs", _('xfs'))?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "xfs", _('xfs'))?>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<?=mk_option(_var($disk,'fsType'), "btrfs", _('btrfs'))?>
<?=mk_option(_var($disk,'fsType'), "reiserfs", _('reiserfs'), "disabled")?>
<?=mk_option(_var($disk,'fsType'), "luks:xfs", _('xfs')." - "._('encrypted'))?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "reiserfs", _('reiserfs'), "disabled")?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "luks:xfs", _('xfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:zfs", _('zfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:btrfs", _('btrfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:reiserfs", _('reiserfs')." - "._('encrypted'), "disabled")?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "luks:reiserfs", _('reiserfs')." - "._('encrypted'), "disabled")?>
</select><span id="reiserfs" class="warning"<?if (!fsType('reiserfs')):?> style="display:none"<?endif;?>><i class="fa fa-warning"></i>&nbsp;_(ReiserFS is deprecated, please use another file system)_!</span>
:info_file_system_help:
<?elseif (!isSubpool($name) && _var($disk,'slots',0)>1):?>
_(File system status)_:
: <?=_(_var($disk,'fsStatus'))?>&nbsp;
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "auto", _('auto'))?>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<?=mk_option(_var($disk,'fsType'), "btrfs", _('btrfs'))?>
<?=mk_option(_var($disk,'fsType'), "luks:zfs", _('zfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:btrfs", _('btrfs')." - "._('encrypted'))?>
</select>
_(Allocation profile)_:
: <select id="diskFsProfileBTRFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<select id="diskFsProfileBTRFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none">
<?=mk_option(_var($disk,'fsProfile'),"single", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"raid0", _('raid0'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"raid1", _('raid1'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raid1c3", _('raid1c3'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid1c4", _('raid1c4'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid10", _('raid10'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raid5", _('raid5'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid6", _('raid6'))?>
<?if (_var($disk,'slots',1)>=2) echo mk_option(_var($disk,'fsProfile'),"raid0", _('raid0'))?>
<?if (_var($disk,'slots',1)>=2) echo mk_option(_var($disk,'fsProfile'),"raid1", _('raid1'))?>
<?if (_var($disk,'slots',1)>=3) echo mk_option(_var($disk,'fsProfile'),"raid1c3", _('raid1c3'))?>
<?if (_var($disk,'slots',1)>=4) echo mk_option(_var($disk,'fsProfile'),"raid1c4", _('raid1c4'))?>
<?if (_var($disk,'slots',1)>=4) echo mk_option(_var($disk,'fsProfile'),"raid10", _('raid10'))?>
<?if (_var($disk,'slots',1)>=3) echo mk_option(_var($disk,'fsProfile'),"raid5", _('raid5'))?>
<?if (_var($disk,'slots',1)>=4) echo mk_option(_var($disk,'fsProfile'),"raid6", _('raid6'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',0)%2)==0 || (_var($disk,'slots',0)%3)==0 || (_var($disk,'slots',0)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz1", _('raidz'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz2", _('raidz2'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raidz3", _('raidz3'))?>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none" onchange="selectDiskFsWidthZFS()">
<?if (_var($disk,'slots',1)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',1)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',1)%2)==0 || (_var($disk,'slots',1)%3)==0 || (_var($disk,'slots',1)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
<?if (_var($disk,'slots',1)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz1", _('raidz'))?>
<?if (_var($disk,'slots',1)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz2", _('raidz2'))?>
<?if (_var($disk,'slots',1)>=4) echo mk_option(_var($disk,'fsProfile'),"raidz3", _('raidz3'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<input id="diskFsGroups" name="diskFsGroups.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<select id="diskFsWidth" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none">
</select>
<?elseif (isSubpool($name)=="special" || isSubpool($name)=="logs" || isSubpool($name)=="dedup"):?>
_(Allocation profile)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" disabled>>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidthZFS()">
<?if (_var($disk,'slots',1)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',1)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',1)%2)==0 || (_var($disk,'slots',1)%3)==0 || (_var($disk,'slots',1)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',0)%2)==0 || (_var($disk,'slots',0)%3)==0 || (_var($disk,'slots',0)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<select id="diskFsWidth" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none">
</select>
<?elseif (isSubpool($name)=="cache"):?>
_(Allocation profile)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" disabled>>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidthZFS()">
<?if (_var($disk,'slots',1)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',1)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<select id="diskFsWidth" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none">
</select>
<?elseif (isSubpool($name)=="spares"):?>
<?endif;?>
@@ -773,8 +766,9 @@ _(Critical disk utilization threshold)_ (%):
<?if (_var($var,'fsState')=="Stopped" || (_var($var,'fsState')=="Started" && _var($var,'startMode')!="Normal")): $erasable=true; endif;?>
<input type="button" id="eraseButton" value="_(Erase Pool)_" onclick="eraseDisk('<?=$name?>')"<?=$erasable?'':' disabled'?>>
<?endif;?>
<?if (_var($var,'fsState')=="Stopped" && isPool($name)):?>
<input type="button" value="_(Delete Pool)_" onclick="deletePool()"<?=isSubpool($name)?' disabled':''?>>
<?if (isPool($name)):?>
<?$deleteable=_var($var,'fsState')=="Stopped" && !isSubpool($name)?>
<input type="button" id="deleteButton" value="_(Delete Pool)_" onclick="deletePool('<?=$name?>')"<?=$deleteable?'':' disabled'?>>
<?endif;?>
</form>
@@ -1378,13 +1372,6 @@ _(Name)_:
</form>
</div>
<form name="deletepool" method="POST" action="/update.htm" target="progressFrame" style="display:none">
<input type="hidden" name="changeSlots" value="apply">
<input type="hidden" name="poolName" value="<?=$name?>">
<input type="hidden" name="poolSlots" value="0">
<input type='hidden' name='csrf_token' value='<?=_var($var,'csrf_token')?>'>
</form>
<script>
$(function() {
<?if (count($sheets)>1):?>