Consistency updates

This commit is contained in:
Deon George 2012-12-06 16:19:30 +11:00
parent 528a83a4fd
commit df498a76a7
9 changed files with 52 additions and 34 deletions

View File

@ -146,7 +146,7 @@ Route::set('default/media', 'media(/<file>)', array('file' => '.+'))
* Set the routes. Each route must have a minimum of a name, a URI and a set of * Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI. * defaults for the URI.
*/ */
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id'=>'[a-zA-Z0-9_.-=]+')) Route::set('default', '(<controller>(/<action>(/<id>)))', array('id'=>'[a-zA-Z0-9_.\-=]+'))
->defaults(array( ->defaults(array(
'controller' => 'welcome', 'controller' => 'welcome',
'action' => 'index', 'action' => 'index',

View File

@ -154,7 +154,7 @@ class Model_DOMAIN extends ORM_TSM {
/** /**
* Return the STORAGE POOLS that NODES in this DOMAIN uses by BACKUP TYPE * Return the STORAGE POOLS that NODES in this DOMAIN uses by BACKUP TYPE
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is Bkup/Arch/SpMg
*/ */
public function stgpools_bybtype($type) { public function stgpools_bybtype($type) {
$k = sprintf('%s-%s-%s',__METHOD__,$this->DOMAIN_NAME,$type); $k = sprintf('%s-%s-%s',__METHOD__,$this->DOMAIN_NAME,$type);
@ -228,7 +228,7 @@ class Model_DOMAIN extends ORM_TSM {
* Return the VOLUMES that NODES in this DOMAIN uses by BACKUP TYPE * Return the VOLUMES that NODES in this DOMAIN uses by BACKUP TYPE
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function vols_bybtype($type) { public function vols_byctype($type) {
$k = sprintf('%s-%s-%s',__METHOD__,$this->DOMAIN_NAME,$type); $k = sprintf('%s-%s-%s',__METHOD__,$this->DOMAIN_NAME,$type);
$c = Kohana::$config->load('config')->cache; $c = Kohana::$config->load('config')->cache;
@ -236,7 +236,7 @@ class Model_DOMAIN extends ORM_TSM {
$x = $result = array(); $x = $result = array();
foreach ($this->_nodes() as $no) foreach ($this->_nodes() as $no)
foreach ($no->vols_bybtype($type) as $vuo) foreach ($no->vols_byctype($type) as $vuo)
if (! in_array($vuo->VOLUME_NAME,$x)) { if (! in_array($vuo->VOLUME_NAME,$x)) {
array_push($result,$vuo); array_push($result,$vuo);
array_push($x,$vuo->VOLUME_NAME); array_push($x,$vuo->VOLUME_NAME);
@ -254,7 +254,7 @@ class Model_DOMAIN extends ORM_TSM {
* @param $pool is STORAGE POOL NAME * @param $pool is STORAGE POOL NAME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function vols_bypoolbybtype($pool,$type) { public function vols_bypoolbyctype($pool,$type) {
$x = $result = array(); $x = $result = array();
foreach ($this->vols_bypool($pool) as $vuo) foreach ($this->vols_bypool($pool) as $vuo)

View File

@ -201,7 +201,7 @@ class Model_FILESPACE extends ORM_TSM {
* @param $pool is STORAGE POOL NAME * @param $pool is STORAGE POOL NAME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function vols_bypoolbybtype($pool,$type) { public function vols_bypoolbyctype($pool,$type) {
$x = $result = array(); $x = $result = array();
foreach ($this->vols_bypool($pool) as $vuo) foreach ($this->vols_bypool($pool) as $vuo)

View File

@ -246,7 +246,7 @@ class Model_NODE extends ORM_TSM {
// Test to see if a node has any data of type // Test to see if a node has any data of type
// @param $type is BACKUP/ARCHIVE/SPACE MANAGED // @param $type is BACKUP/ARCHIVE/SPACE MANAGED
public function hasData($type) { public function hasData($type) {
return $this->vols_bybtype($type) ? TRUE : FALSE; return $this->vols_byctype($type) ? TRUE : FALSE;
} }
// $dtype is BACKUP or ARCHIVE // $dtype is BACKUP or ARCHIVE
@ -366,10 +366,10 @@ class Model_NODE extends ORM_TSM {
if (is_null($result = Cache::instance($c)->get($k))) { if (is_null($result = Cache::instance($c)->get($k))) {
$x = $result = array(); $x = $result = array();
foreach ($this->_volumeusage() as $vuo) foreach ($this->_occupancy() as $oo)
if (! in_array($vuo->STGPOOL_NAME,$x)) { if (! in_array($oo->STGPOOL_NAME,$x)) {
array_push($result,$vuo->STGPOOL); array_push($result,$oo->STGPOOL);
array_push($x,$vuo->STGPOOL_NAME); array_push($x,$oo->STGPOOL_NAME);
} }
// @todo Cache time should be configurble // @todo Cache time should be configurble
@ -408,7 +408,7 @@ class Model_NODE extends ORM_TSM {
/** /**
* Return the STORAGE POOLS that this NODE uses by BACKUP TYPE * Return the STORAGE POOLS that this NODE uses by BACKUP TYPE
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is Bkup/Arch/SpMg
*/ */
public function stgpools_bybtype($type) { public function stgpools_bybtype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__)); Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
@ -419,8 +419,8 @@ class Model_NODE extends ORM_TSM {
if (is_null($result = Cache::instance($c)->get($k))) { if (is_null($result = Cache::instance($c)->get($k))) {
$x = $result = array(); $x = $result = array();
foreach ($this->_volumeusage() as $vuo) foreach ($this->_occupancy() as $vuo)
if ($vuo->COPY_TYPE == $type AND ! in_array($vuo->STGPOOL_NAME,$x)) { if ($vuo->TYPE == $type AND ! in_array($vuo->STGPOOL_NAME,$x)) {
array_push($result,$vuo->STGPOOL); array_push($result,$vuo->STGPOOL);
array_push($x,$vuo->STGPOOL_NAME); array_push($x,$vuo->STGPOOL_NAME);
} }
@ -462,7 +462,7 @@ class Model_NODE extends ORM_TSM {
* Return the VOLUMES that this NODE uses by BACKUP TYPE * Return the VOLUMES that this NODE uses by BACKUP TYPE
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function vols_bybtype($type) { public function vols_byctype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__)); Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$type); $k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$type);
@ -535,7 +535,7 @@ class Model_NODE extends ORM_TSM {
* @param $pool is STORAGE POOL NAME * @param $pool is STORAGE POOL NAME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function vols_bypoolbybtype($pool,$type) { public function vols_bypoolbyctype($pool,$type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__)); Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$x = $result = array(); $x = $result = array();

View File

@ -53,7 +53,7 @@ class Model_VOLUME extends ORM_TSM {
* Get FILESYSTEMS on a VOLUME * Get FILESYSTEMS on a VOLUME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function fs_bybtype($type) { public function fs_byctype($type) {
$k = sprintf('%s-%s-%s',__METHOD__,$this->VOLUME_NAME,$type); $k = sprintf('%s-%s-%s',__METHOD__,$this->VOLUME_NAME,$type);
$c = Kohana::$config->load('config')->cache; $c = Kohana::$config->load('config')->cache;
@ -76,7 +76,7 @@ class Model_VOLUME extends ORM_TSM {
* Get NODES on a VOLUME * Get NODES on a VOLUME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED * @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/ */
public function nodes_bybtype($type) { public function nodes_byctype($type) {
$k = sprintf('%s-%s-%s',__METHOD__,$this->VOLUME_NAME,$type); $k = sprintf('%s-%s-%s',__METHOD__,$this->VOLUME_NAME,$type);
$c = Kohana::$config->load('config')->cache; $c = Kohana::$config->load('config')->cache;

View File

@ -7,7 +7,7 @@
<tr> <tr>
<td class="head" colspan="2"><?php echo $ctype.' '._('Volumes'); ?></td> <td class="head" colspan="2"><?php echo $ctype.' '._('Volumes'); ?></td>
</tr> </tr>
<?php if ($o->vols_bybtype($ctype)) { ?> <?php if ($o->vols_byctype($ctype)) { ?>
<tr> <tr>
<td class="spacer">&nbsp;</td> <td class="spacer">&nbsp;</td>
</tr> </tr>
@ -23,9 +23,18 @@
<td class="right">FS</td> <td class="right">FS</td>
<td class="right">Nodes</td> <td class="right">Nodes</td>
</tr> </tr>
<?php $i=0; foreach ($o->stgpools_bybtype($ctype) as $spo) { ?> <?php $i=0; foreach ($o->stgpools_bybtype($btype) as $spo) { ?>
<tr class="subhead"><td colspan="10"><?php printf('%s: Reclaim: %s%%, Scratch Usage: %s/%s, Device Type: %s',$spo->STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE); ?></td></tr> <tr class="subhead">
<?php foreach ($o->vols_bypoolbybtype($spo->STGPOOL_NAME,$ctype) as $vuo) { <td colspan="10">
<?php
if ($spo->DEVCLASS == 'DISK')
printf('%s: Utilised: %s%%, Device Type: %s',$spo->STGPOOL_NAME,$spo->PCT_UTILIZED,$spo->DEVCLASS);
else
printf('%s: Reclaim: %s%%, Scratch Usage: %s/%s, Device Type: %s',$spo->STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE);
?>
</td>
</tr>
<?php foreach ($o->vols_bypoolbyctype($spo->STGPOOL_NAME,$ctype) as $vuo) {
$vo = $vuo->VOLUME; ?> $vo = $vuo->VOLUME; ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>"> <tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo HTML::anchor('volume/detail/'.base64_encode($vo->VOLUME_NAME),$vo->display('VOLUME_NAME')); ?></td> <td class="data"><?php echo HTML::anchor('volume/detail/'.base64_encode($vo->VOLUME_NAME),$vo->display('VOLUME_NAME')); ?></td>
@ -36,8 +45,8 @@
<td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td> <td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_UTILIZED'); ?></td> <td class="data-right"><?php echo $vo->display('PCT_UTILIZED'); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td> <td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td>
<td class="data-right"><?php echo count($vo->fs_bybtype($ctype)); ?></td> <td class="data-right"><?php echo count($vo->fs_byctype($ctype)); ?></td>
<td class="data-right"><?php echo count($vo->nodes_bybtype($ctype)); ?></td> <td class="data-right"><?php echo count($vo->nodes_byctype($ctype)); ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>

View File

@ -7,7 +7,7 @@
<tr> <tr>
<td class="head" colspan="2"><?php echo $ctype; ?> Information</td> <td class="head" colspan="2"><?php echo $ctype; ?> Information</td>
</tr> </tr>
<?php if ($o->vols_bybtype($ctype)) { ?> <?php if ($o->vols_byctype($ctype)) { ?>
<tr> <tr>
<td class="spacer">&nbsp;</td> <td class="spacer">&nbsp;</td>
</tr> </tr>
@ -25,7 +25,7 @@
<td class="data"><?php echo ($btype == 'Bkup') ? $fso->display('BACKUP_END') : '&nbsp;'; ?></td> <td class="data"><?php echo ($btype == 'Bkup') ? $fso->display('BACKUP_END') : '&nbsp;'; ?></td>
<td class="data-right"><?php echo number_format($fso->utilsation(),2); ?></td> <td class="data-right"><?php echo number_format($fso->utilsation(),2); ?></td>
<?php foreach ($o->stgpools() as $spo) { ?> <?php foreach ($o->stgpools() as $spo) { ?>
<td class="data-right"><?php echo number_format($fso->logmb_bypoolbybtype($spo->STGPOOL_NAME,$btype),2); ?> (<?php echo count($fso->vols_bypoolbybtype($spo->STGPOOL_NAME,$ctype)); ?>)</td> <td class="data-right"><?php echo number_format($fso->logmb_bypoolbybtype($spo->STGPOOL_NAME,$btype),2); ?> (<?php echo count($fso->vols_bypoolbyctype($spo->STGPOOL_NAME,$ctype)); ?>)</td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php } ?> <?php } ?>

View File

@ -7,7 +7,7 @@
<tr> <tr>
<td class="head" colspan="2"><?php echo $ctype.' '._('Volumes'); ?></td> <td class="head" colspan="2"><?php echo $ctype.' '._('Volumes'); ?></td>
</tr> </tr>
<?php if ($o->vols_bybtype($ctype)) { ?> <?php if ($o->vols_byctype($ctype)) { ?>
<tr> <tr>
<td class="spacer">&nbsp;</td> <td class="spacer">&nbsp;</td>
</tr> </tr>
@ -23,9 +23,18 @@
<td class="right">Other FS</td> <td class="right">Other FS</td>
<td class="right">Other Node</td> <td class="right">Other Node</td>
</tr> </tr>
<?php $i=0; foreach ($o->stgpools_bybtype($ctype) as $spo) { ?> <?php $i=0; foreach ($o->stgpools_bybtype($btype) as $spo) { ?>
<tr class="subhead"><td colspan="10"><?php printf('%s: Reclaim: %s%%, Scratch Usage: %s/%s, Device Type: %s',$spo->STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE); ?></td></tr> <tr class="subhead">
<?php foreach ($o->vols_bypoolbybtype($spo->STGPOOL_NAME,$ctype) as $vuo) { <td colspan="10">
<?php
if ($spo->DEVCLASS == 'DISK')
printf('%s: Utilised: %s%%, Device Type: %s',$spo->STGPOOL_NAME,$spo->PCT_UTILIZED,$spo->DEVCLASS);
else
printf('%s: Reclaim: %s%%, Scratch Usage: %s/%s, Device Type: %s',$spo->STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE);
?>
</td>
</tr>
<?php foreach ($o->vols_bypoolbyctype($spo->STGPOOL_NAME,$ctype) as $vuo) {
$vo = $vuo->VOLUME; ?> $vo = $vuo->VOLUME; ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>"> <tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo HTML::anchor('volume/detail/'.base64_encode($vo->VOLUME_NAME),$vo->display('VOLUME_NAME')); ?></td> <td class="data"><?php echo HTML::anchor('volume/detail/'.base64_encode($vo->VOLUME_NAME),$vo->display('VOLUME_NAME')); ?></td>
@ -36,8 +45,8 @@
<td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td> <td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_UTILIZED'); ?></td> <td class="data-right"><?php echo $vo->display('PCT_UTILIZED'); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td> <td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td>
<td class="data-right"><?php echo count($vo->fs_bybtype($ctype))-1; ?></td> <td class="data-right"><?php echo count($vo->fs_byctype($ctype))-1; ?></td>
<td class="data-right"><?php echo count($vo->nodes_bybtype($ctype))-1; ?></td> <td class="data-right"><?php echo count($vo->nodes_byctype($ctype))-1; ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>

View File

@ -31,8 +31,8 @@
<td class="data-right"><abbr title="<?php echo $vo->display('EST_CAPACITY_MB'); ?>"><?php echo $vo->display('PCT_UTILIZED'); ?></abbr></td> <td class="data-right"><abbr title="<?php echo $vo->display('EST_CAPACITY_MB'); ?>"><?php echo $vo->display('PCT_UTILIZED'); ?></abbr></td>
<td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td> <td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td>
<?php foreach (Kohana::$config->load('config')->tsmdatatypes as $btype => $ctype) { ?> <?php foreach (Kohana::$config->load('config')->tsmdatatypes as $btype => $ctype) { ?>
<td class="data-right"><?php echo count($vo->fs_bybtype($ctype)); ?></td> <td class="data-right"><?php echo count($vo->fs_byctype($ctype)); ?></td>
<td class="data-right"><?php echo count($vo->nodes_bybtype($ctype)); ?></td> <td class="data-right"><?php echo count($vo->nodes_byctype($ctype)); ?></td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php } ?> <?php } ?>