mirror of
https://github.com/unraid/webgui.git
synced 2026-01-27 03:59:01 -06:00
@@ -237,7 +237,27 @@ $(function() {
|
||||
if ($.cookie('btrfs-check-<?=$tag?>')) btrfs = btrfsCheck($.cookie('btrfs-check-<?=$tag?>'));
|
||||
if ($.cookie('rfs-check-<?=$tag?>')) btrfs = rfsCheck($.cookie('rfs-check-<?=$tag?>'));
|
||||
if ($.cookie('xfs-check-<?=$tag?>')) btrfs = xfsCheck($.cookie('xfs-check-<?=$tag?>'));
|
||||
if (!btrfs) $.get('/webGui/include/ReloadPage.php',{btrfs:'btrfs'},function(btrfs){if(btrfs=='disable'){$.cookie('btrfs-balance-<?=$tag?>','/mnt/<?=$tag?>');btrfsBalance($.cookie('btrfs-balance-<?=$tag?>'));}});
|
||||
if (!btrfs) {
|
||||
$.get('/webGui/include/ReloadPage.php',{mount:'<?=$tag?>'},function(a){
|
||||
var action = a.split(',');
|
||||
for (var i=0,busy; busy=action[i]; i++) {
|
||||
switch (busy) {
|
||||
case 'balance':
|
||||
$.cookie('btrfs-balance-<?=$tag?>','/mnt/<?=$tag?>');
|
||||
btrfsBalance($.cookie('btrfs-balance-<?=$tag?>'));
|
||||
break;
|
||||
case 'scrub':
|
||||
$.cookie('btrfs-scrub-<?=$tag?>','/mnt/<?=$tag?>');
|
||||
btrfsScrub($.cookie('btrfs-scrub-<?=$tag?>'));
|
||||
break;
|
||||
case 'check':
|
||||
$.cookie('btrfs-check-<?=$tag?>','/mnt/<?=$tag?>');
|
||||
btrfsCheck($.cookie('btrfs-check-<?=$tag?>'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -16,7 +16,10 @@ $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
$_SERVER['REQUEST_URI'] = '';
|
||||
require_once "$docroot/webGui/include/Translations.php";
|
||||
|
||||
if (empty($_GET['btrfs'])) {
|
||||
if (isset($_GET['mount'])) {
|
||||
exec("ps -eo cmd|awk '/^(\/sbin\/)?btrfs.*\/mnt\/{$_GET['mount']}/{print $2}'",$action);
|
||||
echo implode(',',$action);
|
||||
} elseif (empty($_GET['btrfs'])) {
|
||||
$var = parse_ini_file("state/var.ini");
|
||||
switch ($var['fsState']) {
|
||||
case 'Copying':
|
||||
|
||||
Reference in New Issue
Block a user