Merge pull request #1778 from dlandon/master

Parity check does not show completed on array operations page.
This commit is contained in:
tom mortensen
2024-07-09 13:44:58 -07:00
committed by GitHub
4 changed files with 13 additions and 14 deletions
@@ -12,11 +12,6 @@
*/
?>
<?
/* Read the docker configuration file. */
$cfgfile = "/boot/config/docker.cfg";
$config_ini = @parse_ini_file($cfgfile, true, INI_SCANNER_RAW);
$cfg = ($config_ini !== false) ? $config_ini : [];
function addRoute($ct) {
// add static route(s) for remote WireGuard access
[$pid,$net] = array_pad(explode(' ',exec("docker inspect --format='{{.State.Pid}} {{.NetworkSettings.Networks}}' $ct")),2,'');
@@ -242,7 +237,7 @@ function xmlSecurity(&$template) {
}
function xmlToCommand($xml, $create_paths=false) {
global $docroot, $var, $cfg, $driver;
global $docroot, $var, $driver;
$xml = xmlToVar($xml);
$cmdName = strlen($xml['Name']) ? '--name='.escapeshellarg($xml['Name']) : '';
$cmdPrivileged = strtolower($xml['Privileged'])=='true' ? '--privileged=true' : '';
@@ -307,12 +302,17 @@ function xmlToCommand($xml, $create_paths=false) {
}
}
/* Read the docker configuration file. */
$cfgfile = "/boot/config/docker.cfg";
$config_ini = @parse_ini_file($cfgfile, true, INI_SCANNER_RAW);
$docker_cfg = ($config_ini !== false) ? $config_ini : [];
// Add pid limit if user has not specified it as an extra parameter
$pidsLimit = preg_match('/--pids-limit (\d+)/', $xml['ExtraParams'], $matches) ? $matches[1] : null;
if ($pidsLimit === null) {
$pid_limit = "--pids-limit ";
if (($cfg['DOCKER_PID_LIMIT']??'') != "") {
$pid_limit .= $cfg['DOCKER_PID_LIMIT'];
if (($docker_cfg['DOCKER_PID_LIMIT']??'') != "") {
$pid_limit .= $docker_cfg['DOCKER_PID_LIMIT'];
} else {
$pid_limit .= "2048";
}
+1 -1
View File
@@ -383,7 +383,7 @@ devices.on('message', function(msg,meta) {
$.each(get,function(k,v) {if ($('#line'+k).length>0) $('#line'+k).html(v);});
// button control
if ($('#pauseButton').length>0 && $('#pauseButton').prop('disabled')==false) {
if (!msg && $('#cancelButton').length>0 && $('#cancelButton').val()=="_(Cancel)_") {
if ((get === "") && $('#cancelButton').val()=="_(Cancel)_") {
$('#cancelButton').val("_(Done)_").prop('onclick',null).off('click').click(function(){refresh();});
$('#pauseButton').prop('disabled',true);
$('#cancelText').html('');
+4 -1
View File
@@ -107,6 +107,9 @@ while (true) {
file_put_contents($log, "$timestamp|$duration|$speed|$status|$error|$action|$size\n", FILE_APPEND);
delete_file($stamps, $resync);
/* Parity check is completed. */
$echo = "";
}
}
@@ -130,7 +133,7 @@ while (true) {
$process = 2;
} elseif (exec('ps -C btrfs -o cmd=|grep -cv show') > 0) {
$process = 3;
} elseif (exec("zpool status|grep -c 'scrub in progress'") > 0) {
} elseif (exec("zpool status 2>/dev/null | grep -c 'scrub in progress'") > 0) {
$process = 4;
} else {
$process = 0;