Multi cache support

This commit is contained in:
bergware
2020-03-23 08:19:32 +01:00
parent 489f37c41c
commit ca8f359a15
2 changed files with 4 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ pool_status();
<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++?>">
<?foreach (cache_filter($disks) as $disk) if (prefix($disk['name']==$pool)) echo "<tr><td colspan='11'>&nbsp;</td></tr>"?>
<?foreach (cache_filter($disks) as $disk) if (prefix($disk['name'])==$pool) echo "<tr><td colspan='11'>&nbsp;</td></tr>"?>
</tbody>
</table>
<?endif;?>

View File

@@ -309,7 +309,7 @@ function show_totals($text,$array) {
echo "<td></td>";
} else
echo "<td colspan=4></td>";
echo "</tr>\0";
echo "</tr>";
}
function array_slots() {
global $var;
@@ -385,8 +385,7 @@ case 'cache':
if ($var['fsState']=='Stopped') {
$log = @(array)parse_ini_file($tmp);
$off = false;
foreach ($cache as $disk) {
if (prefix($disk['name'])!=$pool) continue;
foreach ($cache as $disk) if (prefix($disk['name'])==$pool) {
array_offline($disk);
if (isset($log[$disk['name']])) $off |= ($log[$disk['name']]!=$disk['id']); else $log[$disk['name']] = $disk['id'];
}
@@ -396,7 +395,7 @@ case 'cache':
} else {
if ($cache[$pool]['devices']) {
foreach ($cache as $disk) if (prefix($disk['name'])==$pool) {
if (substr($cache[$pool]['fsStatus'],0,11)=='Unmountable') $disk['fsStatus'] = $cache[$pool]['fsStatus'];
if (substr($cache[$pool]['fsStatus'],0,11)=='Unmountable' && empty($disk['fsStatus'])) $disk['fsStatus'] = $cache[$pool]['fsStatus'];
array_online($disk);
}
if ($display['total'] && $cache[$pool]['devices']>1) show_totals(sprintf(_('Pool of %s devices'),my_word($cache[$pool]['devices'])),false);