Bug fixes

This commit is contained in:
bergware
2020-03-22 16:53:49 +01:00
parent e846b6c94c
commit 4d10ade6ee
2 changed files with 21 additions and 2 deletions

View File

@@ -237,7 +237,23 @@ $(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;
}
}
});
}
});
</script>

View File

@@ -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':