Exclude disks that have no device designation - disks are not assigned yet.

This commit is contained in:
dlandon
2024-05-13 18:15:57 -05:00
parent 6790400629
commit d85d68de2e
3 changed files with 12 additions and 12 deletions

View File

@@ -63,12 +63,12 @@ $pools = implode(',', $pools_check);
// Natural sorting of share names
uksort($shares,'strnatcasecmp');
// Function to filter out unwanted disks and check if any valid disks exist.
// 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 and fsStatus.
if (!in_array($disk['name'], ['flash', 'parity', 'parity2']) && $disk['fsStatus'] !== "Unmountable: unsupported or no file system") {
// A valid disk is found, return true.
// 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;
}
}