mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 08:19:27 -05:00
DeviceInfo: add ZFS Clear button
Show Clear button instead of Scrub button when applicable
This commit is contained in:
@@ -358,7 +358,7 @@ function zfsScrub(path) {
|
||||
function zfsResilver(path) {
|
||||
$.post('/webGui/include/FileSystemStatus.php',{cmd:'zfs-resilver',path:path},function(data) {
|
||||
if (data.indexOf('resilver in progress')>0) {
|
||||
$('#scrub-button').prop('disabled',true);
|
||||
$('#zfs-button').prop('disabled',true);
|
||||
$('#zfs-pool').text(data);
|
||||
setTimeout(function(){zfsResilver(path);},1000);
|
||||
} else {
|
||||
@@ -985,18 +985,19 @@ _(btrfs check status)_:
|
||||
<div class="title nocontrol"><span class="left"><i class="title fa fa-info"></i>_(Pool Status)_</span></div>
|
||||
<form markdown="1" method="POST" action="/update.php" target="progressFrame" onsubmit="prepareFS(this,'zfs-scrub-<?=$tag?>','<?=$tag?>')">
|
||||
<?if (_var($disk,'fsStatus')=="Mounted"):?>
|
||||
<?exec("$docroot/webGui/scripts/zfs_scrub status $tag", $zfs_status, $retval)?>
|
||||
<?exec("$docroot/webGui/scripts/zfs_scrub status $tag", $zfs_status, $retval); $zfs_status = implode("\n",$zfs_status)?>
|
||||
<?$zfs_cmd = strpos($zfs_status,"'zpool clear'")===false ? 'start' : 'clear'?>
|
||||
|
||||
_(zfs pool status)_:
|
||||
: <pre id='zfs-pool'><?=implode("\n",$zfs_status)?></pre>
|
||||
: <pre id='zfs-pool'><?=$zfs_status?></pre>
|
||||
|
||||
<?if ($retval != 0):?>
|
||||
<input type="hidden" name="#command" value="/webGui/scripts/zfs_scrub">
|
||||
<input type="hidden" name="#arg[1]" value="start">
|
||||
<input type="hidden" name="#arg[1]" value="<?=$zfs_cmd?>">
|
||||
<input type="hidden" name="#arg[2]" value="<?=$tag?>">
|
||||
|
||||
|
||||
: <input type="submit" id="scrub-button" value="_(Scrub)_">
|
||||
: <input type="submit" id="zfs-button" value="<?=$zfs_cmd=='start' ? _('Scrub') : _('Clear')?>">
|
||||
|
||||
:info_zfs_scrub_help:
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# zfs_scrub start <pool>
|
||||
# zfs_scrub clear <pool>
|
||||
# zfs_scrub status <pool>
|
||||
# zfs_scrub cancel <pool>
|
||||
|
||||
@@ -7,6 +8,9 @@ case "$1" in
|
||||
'start')
|
||||
exec /usr/sbin/zpool scrub $2 2>/dev/null
|
||||
;;
|
||||
'clear')
|
||||
exec /usr/sbin/zpool clear $2 2>/dev/null
|
||||
;;
|
||||
'status')
|
||||
# first output whatever the status is to stdout
|
||||
/usr/sbin/zpool status -P $2
|
||||
|
||||
Reference in New Issue
Block a user