mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Multi cache support
This commit is contained in:
@@ -78,7 +78,7 @@ pool_status();
|
||||
|
||||
<?$i = 0?>
|
||||
<?foreach ($pools as $pool):?>
|
||||
<?if ($cache[$pool]['devicesSb'] || $var['fsState']=='Stopped'):?>
|
||||
<?if ($cache[$pool]['devices'] || $var['fsState']=='Stopped'):?>
|
||||
<table class="disk_status wide<?=$i?' divider':''?>">
|
||||
<thead><tr><td>_(Device)_</td><td>_(Identification)_</td><td>_(Temp)_.</td><td>_(Reads)_</td><td>_(Writes)_</td><td>_(Errors)_</td><td>_(FS)_</td><td>_(Size)_</td><td>_(Used)_</td><td>_(Free)_</td><td>_(View)_</td></tr></thead>
|
||||
<tbody id="pool_device<?=$i++?>">
|
||||
|
||||
@@ -78,7 +78,7 @@ foreach ($disks as $disk) {
|
||||
$cache_size[$name] = $disk['fsSize'];
|
||||
$cache_used[$name] = $disk['fsSize']-$disk['fsFree'];
|
||||
$cache_type[$name] = $disk['rotational'] ? ($disk['luksState'] ? 'disk-encrypted' : 'disk') : 'nvme';
|
||||
$cache_pool[$name] = $disk['devicesSb'];
|
||||
$cache_pool[$name] = $disk['devices'];
|
||||
$cache_percent[$name] = number_format(100*$cache_used[$name]/($cache_size[$name] ?: 1),1,$dot,'');
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -78,7 +78,7 @@ effect of making it ***impossible*** to rebuild an existing failed drive - you h
|
||||
<?=mk_option_check(0,'parity',_('Parity slots'))?>
|
||||
<?=mk_option_check(0,'data',_('Data slots'))?>
|
||||
<?foreach ($pools as $pool):?>
|
||||
<?if ($cache[$pool]['devicesSb']) echo mk_option_check(0,$pool,ucfirst($pool).' '._('slots'))?>
|
||||
<?if ($cache[$pool]['devices']) echo mk_option_check(0,$pool,ucfirst($pool).' '._('slots'))?>
|
||||
<?endforeach;?>
|
||||
</select>
|
||||
<br>
|
||||
|
||||
@@ -150,7 +150,7 @@ _(Use cache pool (for new files/directories))_:
|
||||
_(Select cache pool)_:
|
||||
: <select name="poolName">
|
||||
<?foreach ($pools as $pool):?>
|
||||
<?if ($cache[$pool]['devicesSb']) echo mk_option($poolName,$pool,ucfirst($pool))?>
|
||||
<?if ($cache[$pool]['devices']) echo mk_option($poolName,$pool,ucfirst($pool))?>
|
||||
<?endforeach;?>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ case 'cache':
|
||||
$cache = cache_filter($disks);
|
||||
$pools = pools_filter($cache);
|
||||
foreach ($pools as $pool) {
|
||||
if ($cache[$pool]['devicesSb']) {
|
||||
if ($cache[$pool]['devices']) {
|
||||
array_group('Cache',$pool);
|
||||
echo "\0".($error+$warning)."\0".($red+$orange)."\0".($fail+$smart)."\0".($full+$high)."\r";
|
||||
}
|
||||
|
||||
@@ -393,11 +393,11 @@ case 'cache':
|
||||
}
|
||||
$data = []; foreach ($log as $key => $value) $data[] = "$key=\"$value\"";
|
||||
file_put_contents($tmp,implode("\n",$data));
|
||||
echo "<tr class='tr_last'><td>"._('Slots').":</td><td colspan='9'>".cache_slots($off,$pool,$cache[$pool]['devicesSb'],$cache[$pool]['slots'])."</td><td></td></tr>\0";
|
||||
echo "<tr class='tr_last'><td>"._('Slots').":</td><td colspan='9'>".cache_slots($off,$pool,$cache[$pool]['devices'],$cache[$pool]['slots'])."</td><td></td></tr>\0";
|
||||
} else {
|
||||
if ($cache[$pool]['devicesSb']) {
|
||||
if ($cache[$pool]['devices']) {
|
||||
foreach ($cache as $disk) if (prefix($disk['name'])==$pool) array_online($disk);
|
||||
if ($display['total'] && $cache[$pool]['devicesSb']>1) show_totals(sprintf(_('Pool of %s devices'),my_word($cache[$pool]['devicesSb'])),false);
|
||||
if ($display['total'] && $cache[$pool]['devices']>1) show_totals(sprintf(_('Pool of %s devices'),my_word($cache[$pool]['devices'])),false);
|
||||
echo "\0";
|
||||
}
|
||||
@unlink($tmp);
|
||||
|
||||
@@ -36,7 +36,7 @@ $cache = cache_filter($disks);
|
||||
$pools = pools_filter($cache);
|
||||
|
||||
$pool_devices = false;
|
||||
foreach ($pools as $pool) $pool_devices |= $cache[$pool]['devicesSb'];
|
||||
foreach ($pools as $pool) $pool_devices |= $cache[$pool]['devices'];
|
||||
|
||||
// Read network settings
|
||||
extract(parse_ini_file('state/network.ini',true));
|
||||
|
||||
Reference in New Issue
Block a user