mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 02:58:57 -05:00
Minor code updates
This commit is contained in:
@@ -60,10 +60,10 @@ function device_info(&$disk,$online) {
|
||||
$link = (strcmp($disk['status'], 'DISK_NP')!=0 || $disk['name']=="cache") ? "<a href=\"".htmlspecialchars("$path/$type?name=$name")."\">".$fancyname."</a>" : $fancyname;
|
||||
if ($crypto && $online) switch ($disk['luksState']) {
|
||||
case 0: $luks = "<i class='nolock fa fa-lock'></i>"; break;
|
||||
case 1: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt green-text'></i><span>Encrypted and unlocked</span></a>"; break;
|
||||
case 2: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Locked: missing encryption key</span></a>"; break;
|
||||
case 3: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Locked: wrong encryption key</span></a>"; break;
|
||||
default: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Locked: unknown error</span></a>"; break;
|
||||
case 1: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt green-text'></i><span>Device encrypted and unlocked</span></a>"; break;
|
||||
case 2: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Device locked: missing encryption key</span></a>"; break;
|
||||
case 3: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Device locked: wrong encryption key</span></a>"; break;
|
||||
default: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>Device locked: unknown error</span></a>"; break;
|
||||
} else $luks = '';
|
||||
return $status.$luks.$link;
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ function shareInclude($name) {
|
||||
}
|
||||
|
||||
// Compute all disk shares & check encryption
|
||||
$show = false;
|
||||
$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'])) $show |= strpos($disk['fsType'],'luks:')!==false;
|
||||
if (strstr('Data,Cache',$disk['type'])) $crypto |= strpos($disk['fsType'],'luks:')!==false;
|
||||
}
|
||||
|
||||
// global shares include/exclude
|
||||
@@ -73,7 +73,7 @@ foreach ($disks as $name => $disk) {
|
||||
case 'green-on': $help = 'All files protected'; break;
|
||||
case 'yellow-on': $help = 'All files unprotected'; break;
|
||||
}
|
||||
if ($show) switch ($disk['luksState']) {
|
||||
if ($crypto) switch ($disk['luksState']) {
|
||||
case 0: $luks = "<i class='nolock fa fa-lock'></i>"; break;
|
||||
case 1: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt green-text'></i><span>All files encrypted</span></a>"; break;
|
||||
case 2: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt orange-text'></i><span>Some or all files unencrypted</span></a>"; break;
|
||||
|
||||
@@ -54,10 +54,10 @@ function shareInclude($name) {
|
||||
}
|
||||
|
||||
// Compute all user shares & check encryption
|
||||
$show = false;
|
||||
$crypto = false;
|
||||
foreach ($shares as $name => $share) {
|
||||
if ($compute=='yes') exec("webGui/scripts/share_size ".escapeshellarg($name)." ssz1");
|
||||
$show |= $share['luksStatus']>0;
|
||||
$crypto |= $share['luksStatus']>0;
|
||||
}
|
||||
|
||||
// global shares include/exclude
|
||||
@@ -79,7 +79,7 @@ foreach ($shares as $name => $share) {
|
||||
case 'green-on': $help = 'All files protected'; break;
|
||||
case 'yellow-on': $help = 'Some or all files unprotected'; break;
|
||||
}
|
||||
if ($show) switch ($share['luksStatus']) {
|
||||
if ($crypto) switch ($share['luksStatus']) {
|
||||
case 0: $luks = "<i class='nolock fa fa-lock'></i>"; break;
|
||||
case 1: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt green-text'></i><span>All files encrypted</span></a>"; break;
|
||||
case 2: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-unlock-alt orange-text'></i><span>Some or all files unencrypted</span></a>"; break;
|
||||
|
||||
Reference in New Issue
Block a user