mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
Minor code updates
This commit is contained in:
@@ -46,11 +46,17 @@ function shareInclude($name) {
|
||||
return !$include || substr($name,0,4)!='disk' || strpos("$include,", "$name,")!==false;
|
||||
}
|
||||
|
||||
function sharesOnly($disk) {
|
||||
return strpos('Data,Cache',$disk['type'])!==false && $disk['exportable']=='yes';
|
||||
}
|
||||
// filter disk shares
|
||||
$disks = array_filter($disks,'sharesOnly');
|
||||
|
||||
// Compute all disk shares & check encryption
|
||||
$crypto = false;
|
||||
foreach ($disks as $name => $disk) {
|
||||
if ($compute=='yes' && $disk['exportable']=='yes') exec("webGui/scripts/disk_size ".escapeshellarg($name)." ssz2");
|
||||
if (strstr('Data,Cache',$disk['type'])) $crypto |= strpos($disk['fsType'],'luks:')!==false;
|
||||
if ($compute=='yes') exec("webGui/scripts/disk_size ".escapeshellarg($name)." ssz2");
|
||||
$crypto |= strpos($disk['fsType'],'luks:')!==false;
|
||||
}
|
||||
|
||||
// global shares include/exclude
|
||||
@@ -66,10 +72,10 @@ else
|
||||
// Build table
|
||||
$row = 0;
|
||||
foreach ($disks as $name => $disk) {
|
||||
if (!strstr('Data,Cache',$disk['type']) || $disk['fsColor']=='grey-off' || $disk['exportable']=='no') continue;
|
||||
$color = $disk['fsColor'];
|
||||
$row++;
|
||||
$ball = "/webGui/images/{$disk['fsColor']}.png";
|
||||
switch ($disk['fsColor']) {
|
||||
$ball = "/webGui/images/$color.png";
|
||||
switch ($color) {
|
||||
case 'green-on': $help = 'All files protected'; break;
|
||||
case 'yellow-on': $help = 'All files unprotected'; break;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,9 @@ else
|
||||
$row = 0;
|
||||
foreach ($shares as $name => $share) {
|
||||
$row++;
|
||||
$ball = "/webGui/images/{$share['color']}.png";
|
||||
switch ($share['color']) {
|
||||
$color = $share['color'];
|
||||
$ball = "/webGui/images/$color.png";
|
||||
switch ($color) {
|
||||
case 'green-on': $help = 'All files protected'; break;
|
||||
case 'yellow-on': $help = 'Some or all files unprotected'; break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user