More minor library display fixes
This commit is contained in:
parent
c4ef5e2275
commit
183f9e3b74
@ -132,7 +132,7 @@ class Model_LIBRARY extends ORMTSM {
|
|||||||
|
|
||||||
if (! isset($CACHE[__METHOD__]))
|
if (! isset($CACHE[__METHOD__]))
|
||||||
foreach (ORM::factory('volhistory')->where('TYPE','IN',Kohana::config('config.tsmdbtypes'))->find_all() as $vho)
|
foreach (ORM::factory('volhistory')->where('TYPE','IN',Kohana::config('config.tsmdbtypes'))->find_all() as $vho)
|
||||||
$CACHE[__METHOD__][$vho->LIBVOLUME ? 'IN' : 'OUT'][] = $vho;
|
$CACHE[__METHOD__][$vho->LIBVOLUME->LIBRARY_NAME ? 'IN' : 'OUT'][] = $vho;
|
||||||
|
|
||||||
return isset($CACHE[__METHOD__][$inout]) ? $CACHE[__METHOD__][$inout] : array();
|
return isset($CACHE[__METHOD__][$inout]) ? $CACHE[__METHOD__][$inout] : array();
|
||||||
}
|
}
|
||||||
|
@ -27,13 +27,17 @@ class Model_LIBVOLUME extends ORMTSM {
|
|||||||
switch (strtolower($this->STATUS)) {
|
switch (strtolower($this->STATUS)) {
|
||||||
case 'scratch': return strtolower($this->STATUS);
|
case 'scratch': return strtolower($this->STATUS);
|
||||||
case 'private':
|
case 'private':
|
||||||
|
if ($this->VOLUME->STATUS == 'EMPTY')
|
||||||
|
return 'empty';
|
||||||
|
|
||||||
switch (strtolower($this->LAST_USE)) {
|
switch (strtolower($this->LAST_USE)) {
|
||||||
case 'dbbackup':
|
case 'dbbackup':
|
||||||
case 'data':
|
case 'data':
|
||||||
return strtolower($this->LAST_USE);
|
return strtolower($this->LAST_USE);
|
||||||
|
|
||||||
default: return ($this->VOLUME->STATUS == 'EMPTY') ? 'empty' : 'unknown';
|
default: return 'unkown';
|
||||||
}
|
}
|
||||||
|
|
||||||
default: return 'notcheckedin';
|
default: return 'notcheckedin';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +84,7 @@ class Model_LIBVOLUME extends ORMTSM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function removable() {
|
public function removable() {
|
||||||
return ($this->usage() == 'dbbackup' OR ($this->usage() != 'scratch' AND $this->VOLUME->STGPOOL->POOLTYPE != 'PRIMARY')) ? TRUE : FALSE;
|
return ($this->usage() == 'dbbackup' OR (! in_array($this->usage(),array('empty','scratch')) AND $this->VOLUME->STGPOOL->POOLTYPE != 'PRIMARY')) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -56,7 +56,7 @@ class Model_VOLUME extends ORMTSM {
|
|||||||
|
|
||||||
// Age of a volume, based on last read/write access.
|
// Age of a volume, based on last read/write access.
|
||||||
public function age() {
|
public function age() {
|
||||||
if (! $this->LAST_READ_DATE AND ! $this->LAST_WRITE_DATE)
|
if ((! $this->LAST_READ_DATE AND ! $this->LAST_WRITE_DATE) OR $this->STATUS == 'EMPTY')
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return (int)((time()-(strtotime(strtotime($this->LAST_READ_DATE) > strtotime($this->LAST_WRITE_DATE) ? $this->LAST_WRITE_DATE : $this->LAST_READ_DATE)))/86400);
|
return (int)((time()-(strtotime(strtotime($this->LAST_READ_DATE) > strtotime($this->LAST_WRITE_DATE) ? $this->LAST_WRITE_DATE : $this->LAST_READ_DATE)))/86400);
|
||||||
|
@ -241,7 +241,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php $i=0; foreach ($lo->volsnotinlib() as $vo) { ?>
|
<?php $i=0; foreach ($lo->volsnotinlib() as $vo) { ?>
|
||||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||||
<td class="data"><?php echo $vo; ?></td>
|
<td class="data"><?php echo $vo.($vo->recycle() ? ' ¹' : ''); ?></td>
|
||||||
<td class="data"><?php echo $vo->STGPOOL_NAME; ?></td>
|
<td class="data"><?php echo $vo->STGPOOL_NAME; ?></td>
|
||||||
<td class="data"><?php printf('%s/%s',$vo->display('STATUS'),$vo->display('ACCESS')); ?></td>
|
<td class="data"><?php printf('%s/%s',$vo->display('STATUS'),$vo->display('ACCESS')); ?></td>
|
||||||
<td class="data"><?php echo $vo->display('PCT_UTILIZED'); ?></td>
|
<td class="data"><?php echo $vo->display('PCT_UTILIZED'); ?></td>
|
||||||
|
Reference in New Issue
Block a user