mirror of
https://github.com/unraid/webgui.git
synced 2026-04-25 20:01:38 -05:00
Multi cache support
This commit is contained in:
@@ -39,7 +39,7 @@ $user = $_GET['user'];
|
||||
$list = [];
|
||||
$all = $docroot.preg_replace('/([\'" &()[\]\\\\])/','\\\\$1',$dir).'/*';
|
||||
$fix = substr($dir,0,4)=='/mnt' ? explode('/',trim_slash($dir))[2] : 'flash';
|
||||
$cache = implode('|',pools_filter(cache_filter($disks))) ?: 'cache';
|
||||
$cache = implode('|',pools_filter($disks)) ?: 'cache';
|
||||
|
||||
exec("shopt -s dotglob; stat -L -c'%F|%n|%s|%Y' $all 2>/dev/null",$file);
|
||||
if ($user) {
|
||||
|
||||
@@ -263,9 +263,7 @@ case 'cache':
|
||||
require_once "$docroot/webGui/include/CustomMerge.php";
|
||||
require_once "$docroot/webGui/include/Preselect.php";
|
||||
$error = $warning = $red = $orange = $fail = $smart = $full = $high = 0;
|
||||
$cache = cache_filter($disks);
|
||||
$pools = pools_filter($cache);
|
||||
foreach ($pools as $pool) if ($cache[$pool]['devices']) {
|
||||
foreach (pools_filter($disks) as $pool) if ($disks[$pool]['devices']) {
|
||||
array_group('Cache',$pool);
|
||||
echo "\0".($error+$warning)."\0".($red+$orange)."\0".($fail+$smart)."\0".($full+$high)."\r";
|
||||
}
|
||||
|
||||
@@ -379,8 +379,7 @@ case 'flash':
|
||||
break;
|
||||
case 'cache':
|
||||
$cache = cache_filter($disks);
|
||||
$pools = pools_filter($cache);
|
||||
foreach ($pools as $pool) {
|
||||
foreach (pools_filter($cache) as $pool) {
|
||||
$tmp = "/var/tmp/$pool.log.tmp";
|
||||
foreach ($cache as $disk) if (prefix($disk['name'])==$pool) $crypto |= $disk['luksState']!=0 || vfs_luks($disk['fsType']);
|
||||
if ($var['fsState']=='Stopped') {
|
||||
|
||||
@@ -79,8 +79,8 @@ function data_filter($disks) {
|
||||
function cache_filter($disks) {
|
||||
return array_filter($disks,'cache_only');
|
||||
}
|
||||
function pools_filter($cache) {
|
||||
return array_unique(array_map('prefix',array_keys($cache)));
|
||||
function pools_filter($disks) {
|
||||
return array_unique(array_map('prefix',array_keys(cache_filter($disks))));
|
||||
}
|
||||
function my_id($id) {
|
||||
global $display;
|
||||
|
||||
Reference in New Issue
Block a user