diff --git a/emhttp/plugins/dynamix/ShareList.page b/emhttp/plugins/dynamix/ShareList.page index 22f068a4e..93332fa3a 100644 --- a/emhttp/plugins/dynamix/ShareList.page +++ b/emhttp/plugins/dynamix/ShareList.page @@ -16,20 +16,33 @@ Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareUser')=='e'" */ ?> -// Function to filter out unwanted disks, check if any valid disks exist, and ignore disks with a blank device. +/* Function to filter out unwanted disks, check if any valid disks exist, and ignore disks with a blank device. */ function checkDisks($disks) { - foreach ($disks as $disk) { - // Check the disk type, fsStatus, and ensure the device is not blank. - if (!in_array($disk['name'], ['flash', 'parity', 'parity2']) && $disk['fsStatus'] !== "Unmountable: unsupported or no file system" && !empty($disk['device'])) { - // A valid disk with a non-blank device is found, return true. - return true; - } - } + global $pools, $poolsOnly; - // No valid disks found, return false. - return false; + $rc = false; + + if (!$poolsOnly) { + foreach ($disks as $disk) { + /* Check the disk type, fsStatus, and ensure the device is not blank. */ + if (!in_array($disk['name'], ['flash', 'parity', 'parity2']) && strpos($disk['fsStatus'], 'Unmountable') === false && !empty($disk['device'])) { + /* A valid disk with a non-blank device is found. */ + $rc = true; + + break; + } + } + } else { + /* See if there are any pools. */ + $rc = !empty($pools); + } + + return $rc; } +/* If the configuration is pools only, then no array disks are available. */ +$poolsOnly = ((int)$var['sbNumDisks'] == 2) ? true : false; + /* Are there any array disks? */ $disks = parse_ini_file('state/disks.ini',true) ?? []; $nodisks = checkDisks($disks) ? "" : "disabled"; diff --git a/emhttp/plugins/dynamix/include/DiskList.php b/emhttp/plugins/dynamix/include/DiskList.php index 53ac01d80..f947d23da 100644 --- a/emhttp/plugins/dynamix/include/DiskList.php +++ b/emhttp/plugins/dynamix/include/DiskList.php @@ -28,6 +28,13 @@ $var = parse_ini_file('state/var.ini'); $sec = parse_ini_file('state/sec.ini',true); $sec_nfs = parse_ini_file('state/sec_nfs.ini',true); +/* Get the pools from the disks.ini. */ +$pools_check = pools_filter(cache_filter($disks)); +$pools = implode(',', $pools_check); + +/* If the configuration is pools only, then no array disks are available. */ +$poolsOnly = ((int)$var['sbNumDisks'] == 2) ? true : false; + // exit when no mountable array disks $nodisks = "