Some more performance improvements and caching

This commit is contained in:
Deon George
2012-12-07 14:33:16 +11:00
parent df498a76a7
commit 7a3539cb95
13 changed files with 475 additions and 203 deletions

View File

@@ -0,0 +1,32 @@
<!-- $o = ORM::factory('NODE') -->
<table class="box-full">
<tr>
<td class="head" colspan="5">Storage By Pool Summary</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Storage Pool and Type</td>
<td class="right">Vols</td>
<td class="right">Files</td>
<td class="right">MB</td>
</tr>
<?php $i=0; foreach ($o->stgpooltypes() as $type) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data" colspan="2"><?php echo $type; ?></td>
<td class="data-right"><?php echo count($o->vols_byptype($type)); ?></td>
<td class="data-right"><?php echo number_format($o->file_byptype($type),0); ?></td>
<td class="data-right"><?php echo number_format($o->logmb_byptype($type),0); ?></td>
</tr>
<?php foreach ($o->stgpools_byptype($type) as $spo) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td>&nbsp;</td>
<td><?php echo HTML::anchor('stgpool/detail/'.$spo->STGPOOL_NAME,$spo->display('STGPOOL_NAME')); ?></td>
<td class="right"><?php echo count($o->vols_bypool($spo)); ?></td>
<td class="right"><?php echo number_format($o->file_bypool($spo),0); ?></td>
<td class="right"><?php echo number_format($o->logmb_bypool($spo),0); ?></td>
</tr>
<?php } ?>
<?php } ?>
</table>