Added volumes for a node
Added schedules Added management classes for a node Added clientopts to nodes Added schedule and event information
This commit is contained in:
parent
a244d693b5
commit
58ddb97d87
@ -73,6 +73,22 @@ $(document).ready(function () {$("#node_name").change(function () {
|
||||
'body'=>$output,
|
||||
));
|
||||
|
||||
$output = View::factory('nodes/detail_volumes')
|
||||
->set('node',$no);
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Sequential Volume Usage Information'),
|
||||
'body'=>$output,
|
||||
));
|
||||
|
||||
$output = View::factory('nodes/detail_schedule')
|
||||
->set('node',$no);
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Schedule Information'),
|
||||
'body'=>$output,
|
||||
));
|
||||
|
||||
$this->template->content = Block::factory();
|
||||
}
|
||||
}
|
||||
|
24
application/classes/model/association.php
Normal file
24
application/classes/model/association.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Client Schedule Associations
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_ASSOCIATION extends ORMTSM {
|
||||
protected $_table_name = 'ASSOCIATIONS';
|
||||
protected $_primary_key = 'DOMAIN_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'SCHEDULE_NAME'=>'ASC',
|
||||
'NODE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'SCHEDULE_CLIENT'=>array('foreign_key'=>'SCHEDULE_NAME','far_key'=>'SCHEDULE_NAME'),
|
||||
);
|
||||
}
|
||||
?>
|
@ -13,82 +13,5 @@ class Model_Auth_UserDefault extends Model_Auth_User {
|
||||
protected $_disable_wild_select = TRUE;
|
||||
protected $_disable_join_table_name = TRUE;
|
||||
protected $_disable_limit = TRUE;
|
||||
|
||||
// Validation rules
|
||||
protected $_rules = array(
|
||||
'admin_name' => array(
|
||||
'not_empty' => NULL,
|
||||
'min_length' => array(4),
|
||||
'max_length' => array(8),
|
||||
),
|
||||
'password' => array(
|
||||
'not_empty' => NULL,
|
||||
'min_length' => array(5),
|
||||
'max_length' => array(16),
|
||||
),
|
||||
'password_confirm' => array(
|
||||
'matches_ifset' => array('password'),
|
||||
),
|
||||
);
|
||||
|
||||
// Columns to ignore
|
||||
protected $_ignored_columns = array('password_confirm');
|
||||
|
||||
// Field labels
|
||||
protected $_labels = array(
|
||||
'admin_name' => 'username',
|
||||
'email' => 'email address',
|
||||
'password' => 'password',
|
||||
'password_confirm' => 'password confirmation',
|
||||
);
|
||||
|
||||
/**
|
||||
* Validates login information from an array, and optionally redirects
|
||||
* after a successful login.
|
||||
*
|
||||
* @param array values to check
|
||||
* @param string URI or URL to redirect to
|
||||
* @return boolean
|
||||
*/
|
||||
public function login(array & $array, $redirect = FALSE) {
|
||||
$fieldname = 'admin_name'; // @todo This should be defined in a config or database driver file
|
||||
$array = Validate::factory($array)
|
||||
->label('username', $this->_labels[$fieldname])
|
||||
->label('password', $this->_labels['password'])
|
||||
->filter(TRUE, 'trim')
|
||||
->filter('username','strtoupper')
|
||||
->rules('username', $this->_rules[$fieldname])
|
||||
->rules('password', $this->_rules['password']);
|
||||
|
||||
// Get the remember login option
|
||||
$remember = isset($array['remember']);
|
||||
|
||||
// Login starts out invalid
|
||||
$status = FALSE;
|
||||
|
||||
if ($array->check())
|
||||
{
|
||||
// Attempt to load the user
|
||||
$this->where($fieldname, '=', $array['username'])->find();
|
||||
|
||||
if ($this->loaded() AND Auth::instance()->login($this, $array['password'], $remember))
|
||||
{
|
||||
if (is_string($redirect))
|
||||
{
|
||||
// Redirect after a successful login
|
||||
Request::instance()->redirect($redirect);
|
||||
}
|
||||
|
||||
// Login is successful
|
||||
$status = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$array->error('admin_name', 'invalid');
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
21
application/classes/model/clientopt.php
Normal file
21
application/classes/model/clientopt.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Volume
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_CLIENTOPT extends ORMTSM {
|
||||
protected $_table_name = 'CLIENTOPTS';
|
||||
protected $_primary_key = 'OPTIONSET_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'OPTIONSET_NAME'=>'ASC',
|
||||
'OPTION_NAME'=>'ASC',
|
||||
'SEQNUMBER'=>'ASC',
|
||||
);
|
||||
}
|
||||
?>
|
21
application/classes/model/copygroup/ar.php
Normal file
21
application/classes/model/copygroup/ar.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Archive Copy Groups
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_COPYGROUP_AR extends ORMTSM {
|
||||
protected $_table_name = 'AR_COPYGROUPS';
|
||||
protected $_primary_key = 'DOMAIN_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'DOMAIN_NAME'=>'ASC',
|
||||
'SET_NAME'=>'ASC',
|
||||
'CLASS_NAME'=>'ASC',
|
||||
);
|
||||
}
|
||||
?>
|
21
application/classes/model/copygroup/bu.php
Normal file
21
application/classes/model/copygroup/bu.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Backup Copy Groups
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_COPYGROUP_BU extends ORMTSM {
|
||||
protected $_table_name = 'BU_COPYGROUPS';
|
||||
protected $_primary_key = 'DOMAIN_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'DOMAIN_NAME'=>'ASC',
|
||||
'SET_NAME'=>'ASC',
|
||||
'CLASS_NAME'=>'ASC',
|
||||
);
|
||||
}
|
||||
?>
|
21
application/classes/model/devclasses.php
Normal file
21
application/classes/model/devclasses.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Volume
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
* @node This is model is using the plural name, as storage pools have an attribute with the singular name
|
||||
*/
|
||||
class Model_DEVCLASSES extends ORMTSM {
|
||||
protected $_table_name = 'DEVCLASSES';
|
||||
protected $_primary_key = 'DEVCLASS_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'DEVTYPE'=>'ASC',
|
||||
'DEVCLASS_NAME'=>'ASC',
|
||||
);
|
||||
}
|
||||
?>
|
32
application/classes/model/event.php
Normal file
32
application/classes/model/event.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Event
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_EVENT extends ORMTSM {
|
||||
protected $_table_name = 'EVENTS';
|
||||
protected $_primary_key = 'NODE_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'SCHEDULED_START'=>'ASC',
|
||||
'NODE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'SCHEDULED_START'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M H:i')),
|
||||
),
|
||||
'ACTUAL_START'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M H:i')),
|
||||
),
|
||||
'COMPLETED'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M H:i')),
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
@ -11,18 +11,21 @@
|
||||
*/
|
||||
class Model_FILESPACE extends ORMTSM {
|
||||
protected $_table_name = 'FILESPACES';
|
||||
protected $_primary_key = 'FILESPACE_NAME';
|
||||
protected $_primary_key = 'FILESPACE_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
'FILESPACE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_many = array(
|
||||
'VOLUMEUSAGE'=>array('foreign_key'=>array('NODE_NAME','FILESPACE_NAME'),'far_key'=>'FILESPACE_NAME'),
|
||||
'OCCUPANCY'=>array('foreign_key'=>array('NODE_NAME','FILESPACE_NAME'),'far_key'=>'FILESPACE_NAME'),
|
||||
);
|
||||
|
||||
protected $_formats = array(
|
||||
'BACKUP_END'=>array('ORMTSM::date'=>array('d-M-Y')),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
protected $_display_filters = array(
|
||||
'BACKUP_END'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M-Y')),
|
||||
),
|
||||
);
|
||||
|
||||
public function utilsation() {
|
||||
@ -37,20 +40,20 @@ class Model_FILESPACE extends ORMTSM {
|
||||
->where('TYPE','=',$dtype)
|
||||
->group_by('STGPOOL_NAME')
|
||||
->order_by('STGPOOL_NAME')
|
||||
->find_all() as $vo) {
|
||||
->find_all() as $oo) {
|
||||
|
||||
array_push($pool,$vo->STGPOOL_NAME);
|
||||
array_push($pool,$oo->STGPOOL);
|
||||
}
|
||||
|
||||
return $pool;
|
||||
}
|
||||
|
||||
public function pool_logical_util($pool) {
|
||||
return $this->OCCUPANCY->where('STGPOOL_NAME','=',$pool)->find()->LOGICAL_MB;
|
||||
public function pool_logical_util($pool,$btype) {
|
||||
return $this->OCCUPANCY->where('STGPOOL_NAME','=',$pool)->where('TYPE','=',$btype)->find()->LOGICAL_MB;
|
||||
}
|
||||
|
||||
public function pool_numvols($pool) {
|
||||
return $this->VOLUMEUSAGE->where('STGPOOL_NAME','=',$pool)->find_all()->count();
|
||||
public function pool_numvols($pool,$ctype) {
|
||||
return $this->VOLUMEUSAGE->where('STGPOOL_NAME','=',$pool)->where('COPY_TYPE','=',$ctype)->find_all()->count();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
26
application/classes/model/mgmtclass.php
Normal file
26
application/classes/model/mgmtclass.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Management Class
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_MGMTCLASS extends ORMTSM {
|
||||
protected $_table_name = 'MGMTCLASSES';
|
||||
protected $_primary_key = 'DOMAIN_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'DEFAULTMC'=>'DESC',
|
||||
'DOMAIN_NAME'=>'ASC',
|
||||
'CLASS_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'COPYGROUP_BU'=>array('foreign_key'=>array('DOMAIN_NAME','SET_NAME','CLASS_NAME')),
|
||||
'COPYGROUP_AR'=>array('foreign_key'=>array('DOMAIN_NAME','SET_NAME','CLASS_NAME')),
|
||||
);
|
||||
}
|
||||
?>
|
@ -12,8 +12,18 @@
|
||||
class Model_NODE extends ORMTSM {
|
||||
protected $_table_name = 'NODES';
|
||||
protected $_primary_key = 'NODE_NAME';
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_many = array(
|
||||
'FILESPACE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'FILESPACE_NAME'),
|
||||
'FILESPACE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
|
||||
'VOLUMEUSAGE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
|
||||
'ASSOCIATION'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
|
||||
'MGMTCLASS'=>array('foreign_key'=>'DOMAIN_NAME','far_key'=>'DOMAIN_NAME'),
|
||||
'CLIENTOPT'=>array('foreign_key'=>'OPTIONSET_NAME','far_key'=>'OPTION_SET'),
|
||||
'SUMMARY'=>array('foreign_key'=>'ENTITY','far_key'=>'NODE_NAME'),
|
||||
'EVENT'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
@ -46,10 +56,6 @@ class Model_NODE extends ORMTSM {
|
||||
),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
// Pools used by a node.
|
||||
private $pools = array();
|
||||
|
||||
@ -106,39 +112,72 @@ class Model_NODE extends ORMTSM {
|
||||
|
||||
// @todo This should return the system setting (cloptset), if the node setting is not configured.
|
||||
public function txngroupmax() {
|
||||
return $this->display('TXNGROUPMAX');
|
||||
return $this->TXNGROUPMAX;
|
||||
}
|
||||
|
||||
// Work out all the storage pools used by a node.
|
||||
// $dtype is BACKUP or ARCHIVE
|
||||
public function storagepools($dtype) {
|
||||
public function getStoragePools($dtype) {
|
||||
return isset($this->pools[$dtype]) ? $this->pools[$dtype] : $this->_getpools($dtype);
|
||||
}
|
||||
|
||||
private function _getpools($dtype) {
|
||||
$this->pools[$dtype] = array();
|
||||
|
||||
foreach ($this->FILESPACE->find_all() as $fso) {
|
||||
foreach ($fso->storagepools($dtype) as $pool_name) {
|
||||
$po = ORM::Factory('stgpool',$pool_name);
|
||||
|
||||
if (! isset($this->pools[$dtype][$po->POOLTYPE]) OR ! in_array($pool_name,$this->pools[$dtype][$po->POOLTYPE]))
|
||||
$this->pools[$dtype][$po->POOLTYPE][] = $pool_name;
|
||||
}
|
||||
}
|
||||
foreach ($this->FILESPACE->find_all() as $fso)
|
||||
foreach ($fso->storagepools($dtype) as $po)
|
||||
if (! isset($this->pools[$dtype][$po->POOLTYPE]) OR ! in_array($po->STGPOOL_NAME,$this->pools[$dtype][$po->POOLTYPE]))
|
||||
$this->pools[$dtype][$po->POOLTYPE][] = $po;
|
||||
|
||||
return $this->pools[$dtype];
|
||||
}
|
||||
|
||||
// Return the storage pools used for a backup type
|
||||
// $dtype is BACKUP or ARCHIVE
|
||||
public function getStoragePools($dtype,$ptype) {
|
||||
// $ptype is pool type (PRIMARY,ACTIVE,COPY)
|
||||
public function getStoragePoolsType($dtype,$ptype) {
|
||||
if (! isset($this->pools[$dtype]))
|
||||
$this->_getpools($dtype);
|
||||
|
||||
return isset($this->pools[$dtype][$ptype]) ? $this->pools[$dtype][$ptype] : array();
|
||||
}
|
||||
|
||||
// @todo This routine should be cached.
|
||||
public function getStorageTypeFiles($type) {
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->FILESPACE->find_all() as $fo)
|
||||
foreach ($fo->OCCUPANCY->find_all() as $oa)
|
||||
if ($oa->STGPOOL->POOLTYPE == $type)
|
||||
$count += $oa->NUM_FILES;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
// @todo This routine should be cached.
|
||||
public function getStorageTypeData($type) {
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->FILESPACE->find_all() as $fo)
|
||||
foreach ($fo->OCCUPANCY->find_all() as $oa)
|
||||
if ($oa->STGPOOL->POOLTYPE == $type)
|
||||
$count += $oa->LOGICAL_MB;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
// Return the volumes that this node uses
|
||||
// $dtype is BACKUP or ARCHIVE
|
||||
// @todo Cache this data
|
||||
public function volumes($dtype) {
|
||||
$volumes = array();
|
||||
|
||||
foreach ($this->VOLUMEUSAGE->where('COPY_TYPE','=',$dtype)->order_by('STGPOOL_NAME,FILESPACE_NAME')->find_all() as $vol)
|
||||
$volumes[$vol->STGPOOL_NAME][] = $vol->VOLUME;
|
||||
|
||||
return $volumes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the nodes by OS
|
||||
*/
|
||||
|
@ -11,17 +11,15 @@
|
||||
*/
|
||||
class Model_OCCUPANCY extends ORMTSM {
|
||||
protected $_table_name = 'OCCUPANCY';
|
||||
protected $_primary_key = 'FILESPACE_NAME';
|
||||
protected $_has_many = array(
|
||||
);
|
||||
|
||||
protected $_formats = array(
|
||||
);
|
||||
|
||||
protected $_primary_key = 'NODE_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
'FILESPACE_NAME'=>'ASC',
|
||||
'STGPOOL_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'STGPOOL'=>array('foreign_key'=>'STGPOOL_NAME','far_key'=>'STGPOOL_NAME'),
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
25
application/classes/model/schedule/client.php
Normal file
25
application/classes/model/schedule/client.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Client Schedule Associations
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_SCHEDULE_CLIENT extends ORMTSM {
|
||||
protected $_table_name = 'CLIENT_SCHEDULES';
|
||||
protected $_primary_key = 'SCHEDULE_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'SCHEDULE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'STARTTIME'=>array(
|
||||
array('ORMTSM::date',array(':value','h:m')),
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
@ -12,14 +12,12 @@
|
||||
class Model_STGPOOL extends ORMTSM {
|
||||
protected $_table_name = 'STGPOOLS';
|
||||
protected $_primary_key = 'STGPOOL_NAME';
|
||||
protected $_has_many = array(
|
||||
);
|
||||
|
||||
protected $_formats = array(
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
'STGPOOL_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'DEVCLASSES'=>array('foreign_key'=>'DEVCLASS_NAME','far_key'=>'DEVCLASS'),
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
30
application/classes/model/summary.php
Normal file
30
application/classes/model/summary.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Summary
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_SUMMARY extends ORMTSM {
|
||||
protected $_table_name = 'SUMMARY';
|
||||
protected $_primary_key = 'ACTIVITY'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'START_TIME'=>'ASC',
|
||||
'ENTITY'=>'ASC',
|
||||
'ACTIVITY'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'START_TIME'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M H:i')),
|
||||
),
|
||||
'END_TIME'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M H:i')),
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
39
application/classes/model/volume.php
Normal file
39
application/classes/model/volume.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Volume
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Model_VOLUME extends ORMTSM {
|
||||
protected $_table_name = 'VOLUMES';
|
||||
protected $_primary_key = 'VOLUME_NAME';
|
||||
protected $_sorting = array(
|
||||
'VOLUME_NAME'=>'ASC',
|
||||
'STGPOOL_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_many = array(
|
||||
'VOLUMEUSAGE'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'LAST_READ_DATE'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M-Y')),
|
||||
),
|
||||
'LAST_WRITE_DATE'=>array(
|
||||
array('ORMTSM::date',array(':value','d-M-Y')),
|
||||
),
|
||||
);
|
||||
|
||||
// Show the number of nodes on a volume
|
||||
// $dtype is BACKUP or ARCHIVE
|
||||
public function getNodesOnVol($dtype) {
|
||||
return $this->VOLUMEUSAGE->where('COPY_TYPE','=',$dtype)->find_all()->count();
|
||||
}
|
||||
}
|
||||
?>
|
@ -11,17 +11,15 @@
|
||||
*/
|
||||
class Model_VOLUMEUSAGE extends ORMTSM {
|
||||
protected $_table_name = 'VOLUMEUSAGE';
|
||||
protected $_primary_key = 'FILESPACE_NAME';
|
||||
protected $_has_many = array(
|
||||
);
|
||||
|
||||
protected $_formats = array(
|
||||
);
|
||||
|
||||
protected $_primary_key = 'NODE_NAME'; // We need a primary key to detect that the object is loaded.
|
||||
protected $_sorting = array(
|
||||
'NODE_NAME'=>'ASC',
|
||||
'FILESPACE_NAME'=>'ASC',
|
||||
'VOLUME_NAME'=>'ASC',
|
||||
# 'FILESPACE_NAME'=>'ASC', // @todo Disabled, as we were getting some SQL errors, when the query returned no records
|
||||
# 'VOLUME_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'VOLUME'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'),
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
@ -63,7 +63,7 @@ class ORM extends Kohana_ORM {
|
||||
if (isset($this->_object_formated[$column]))
|
||||
return $this->_object_formated[$column];
|
||||
else
|
||||
return $value;
|
||||
return $value ? $value : ' ';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -29,7 +29,7 @@ class ORMTSM extends ORM {
|
||||
}
|
||||
|
||||
public static function date($date,$format) {
|
||||
return date($format,strtotime($date));
|
||||
return $date ? date($format,strtotime($date)) : '';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -4,6 +4,7 @@ table.box-left { border: 1px solid #AAAACC; margin-right: auto; }
|
||||
table.box-center { border: 1px solid #AAAACC; margin-left: auto; margin-right: auto; }
|
||||
table.box-full { border: 1px solid #AAAACC; margin-right: auto; width: 100%; }
|
||||
tr.head { font-weight: bold; }
|
||||
tr.subhead { background-color: #BBBBDD; }
|
||||
td.head { font-weight: bold; }
|
||||
td.bold { font-weight: bold; }
|
||||
td.bold-right { font-weight: bold; text-align: right; }
|
||||
|
@ -45,7 +45,7 @@
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
<table width="100%">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Last Session Performance Information</td>
|
||||
</tr>
|
||||
@ -135,7 +135,88 @@
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
[PERFORMANCE PIE-GRAPH?]
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Policy Settings</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="head" colspan="2">Backup Settings</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MGMT Class</td>
|
||||
<td>HSM Pool</td>
|
||||
<td>1st Backup Pool</td>
|
||||
<td>Ver Exist</td>
|
||||
<td>Ver Del</td>
|
||||
<td>Frequency</td>
|
||||
</tr>
|
||||
<?php $i=0; foreach ($node->MGMTCLASS->where('SET_NAME','=','ACTIVE')->find_all() as $mco) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $mco->display('CLASS_NAME'); ?><?php echo $mco->DEFAULTMC=='Yes' ? ' <sup>*</sup>' : ''; ?></td>
|
||||
<td class="head"><?php echo $mco->display('MIGDESTINATION'); ?></td>
|
||||
<td class="head"><?php echo $mco->COPYGROUP_BU->display('DESTINATION'); ?></td>
|
||||
<td class="head"><?php printf('%s/%s',$mco->COPYGROUP_BU->display('VEREXISTS'),$mco->COPYGROUP_BU->display('RETEXTRA')); ?></td>
|
||||
<td class="head"><?php printf('%s/%s',$mco->COPYGROUP_BU->display('VERDELETED'),$mco->COPYGROUP_BU->display('RETONLY')); ?></td>
|
||||
<td class="head"><?php echo $mco->COPYGROUP_BU->display('FREQUENCY'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="head" colspan="2">Archive Settings</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MGMT Class</td>
|
||||
<td>Destination</td>
|
||||
<td>Retain</td>
|
||||
</tr>
|
||||
<?php $i=0; foreach ($node->MGMTCLASS->where('SET_NAME','=','ACTIVE')->find_all() as $mco) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $mco->display('CLASS_NAME'); ?><?php echo $mco->DEFAULTMC=='Yes' ? ' <sup>*</sup>' : ''; ?></td>
|
||||
<td class="head"><?php echo $mco->COPYGROUP_AR->display('DESTINATION'); ?></td>
|
||||
<td class="head"><?php echo $mco->COPYGROUP_AR->display('RETVER'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Server Side Client Options</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client Option</td>
|
||||
<td>Seq #</td>
|
||||
<td>Setting</td>
|
||||
<td>Forced</td>
|
||||
</tr>
|
||||
<?php if ($node->OPTION_SET) { ?>
|
||||
<?php $i=0; foreach ($node->CLIENTOPT->find_all() as $coo) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $coo->display('OPTION_NAME'); ?></td>
|
||||
<td class="head"><?php echo $coo->display('SEQNUMBER'); ?></td>
|
||||
<td class="head"><?php echo $coo->display('OPTION_VALUE'); ?></td>
|
||||
<td class="head"><?php echo $coo->display('FORCE'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td>This node is not configured for any server side Client Options</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<tr>
|
||||
<td class="head" colspan="2">Backup Information</td>
|
||||
</tr>
|
||||
<?php if ($node->storagepools('Bkup')) { ?>
|
||||
<?php if ($node->getStoragePools('Bkup')) { ?>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
@ -14,7 +14,7 @@
|
||||
<td>Last Date</td>
|
||||
<td style="text-align: right;">Utilisation</td>
|
||||
<?php foreach (Kohana::config('config.tsmpooltypes') as $type)
|
||||
if (count($pools = $node->getStoragePools('Bkup',$type)))
|
||||
if (count($pools = $node->getStoragePoolsType('Bkup',$type)))
|
||||
foreach ($pools as $pool_name) { ?>
|
||||
<td style="text-align: right;"><?php echo $pool_name; ?> <span style="vertical-align: super; font-size: 60%;"><?echo $type; ?></span></td>
|
||||
<?php } ?>
|
||||
@ -25,9 +25,9 @@
|
||||
<td class="head"><?php echo $fso->display('BACKUP_END'); ?></td>
|
||||
<td class="head" style="text-align: right;"><?php echo number_format($fso->utilsation(),2); ?></td>
|
||||
<?php foreach (Kohana::config('config.tsmpooltypes') as $type)
|
||||
if (count($pools = $node->getStoragePools('Bkup',$type)))
|
||||
if (count($pools = $node->getStoragePoolsType('Bkup',$type)))
|
||||
foreach ($pools as $pool_name) { ?>
|
||||
<td class="head" style="text-align: right; vertical-align: top;"><?php echo number_format($fso->pool_logical_util($pool_name),2); ?> (<?php echo $fso->pool_numvols($pool_name); ?>)</td>
|
||||
<td class="head" style="text-align: right; vertical-align: top;"><?php echo number_format($fso->pool_logical_util($pool_name,'Bkup'),2); ?> (<?php echo $fso->pool_numvols($pool_name,'BACKUP'); ?>)</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -36,8 +36,27 @@
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
|
||||
<td style="width: 50%; vertical-align: top;" rowspan="2">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Storage Summary</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Storage Type</td>
|
||||
<td>Files</td>
|
||||
<td>MB</td>
|
||||
</tr>
|
||||
<?php $i=0; foreach (Kohana::config('config.tsmpooltypes') as $type) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $type; ?></td>
|
||||
<td class="head"><?php echo $node->getStorageTypeFiles($type); ?></td>
|
||||
<td class="head"><?php echo $node->getStorageTypeData($type); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -46,14 +65,14 @@
|
||||
<tr>
|
||||
<td class="head" colspan="2">Archive Information</td>
|
||||
</tr>
|
||||
<?php if ($node->storagepools('Arch')) { ?>
|
||||
<?php if ($node->getStoragePools('Arch')) { ?>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>File Space</td>
|
||||
<?php foreach (Kohana::config('config.tsmpooltypes') as $type)
|
||||
if (count($pools = $node->getStoragePools('Arch',$type)))
|
||||
if (count($pools = $node->getStoragePoolsType('Arch',$type)))
|
||||
foreach ($pools as $pool_name) { ?>
|
||||
<td style="text-align: right;"><?php echo $pool_name; ?> <span style="vertical-align: super; font-size: 60%;"><?echo $type; ?></span></td>
|
||||
<?php } ?>
|
||||
@ -62,9 +81,9 @@
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $fso->display('FILESPACE_NAME'); ?></td>
|
||||
<?php foreach (Kohana::config('config.tsmpooltypes') as $type)
|
||||
if (count($pools = $node->getStoragePools('Arch',$type)))
|
||||
if (count($pools = $node->getStoragePoolsType('Arch',$type)))
|
||||
foreach ($pools as $pool_name) { ?>
|
||||
<td class="head" style="text-align: right; vertical-align: top;"><?php echo number_format($fso->pool_logical_util($pool_name),2); ?> (<?php echo $fso->pool_numvols($pool_name); ?>)</td>
|
||||
<td class="head" style="text-align: right; vertical-align: top;"><?php echo number_format($fso->pool_logical_util($pool_name,'Arch'),2); ?> (<?php echo $fso->pool_numvols($pool_name,'ARCHIVE'); ?>)</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
92
application/views/nodes/detail_schedule.php
Normal file
92
application/views/nodes/detail_schedule.php
Normal file
@ -0,0 +1,92 @@
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">TSM Node Schedules</td>
|
||||
</tr>
|
||||
<?php if ($node->ASSOCIATION->find_all()) { ?>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Schedule</td>
|
||||
<td>Start Time</td>
|
||||
<td>Duration</td>
|
||||
<td>Repeat</td>
|
||||
<td>Valid Day</td>
|
||||
<td>Priority</td>
|
||||
</tr>
|
||||
<?php $i=0;foreach ($node->ASSOCIATION->find_all() as $ao) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $ao->display('SCHEDULE_NAME'); ?></td>
|
||||
<td class="head"><?php echo $ao->SCHEDULE_CLIENT->display('STARTTIME'); ?></td>
|
||||
<td class="head"><?php printf('%s %s',$ao->SCHEDULE_CLIENT->DURATION,$ao->SCHEDULE_CLIENT->DURUNITS); ?></td>
|
||||
<td class="head"><?php printf('%s %s',$ao->SCHEDULE_CLIENT->PERIOD,$ao->SCHEDULE_CLIENT->PERUNITS); ?></td>
|
||||
<td class="head"><?php echo $ao->SCHEDULE_CLIENT->display('DAYOFWEEK'); ?></td>
|
||||
<td class="head"><?php echo $ao->SCHEDULE_CLIENT->display('PRIORITY'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<tr><td>There are no TSM schedules define for this Node.</td></tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;" rowspan="2">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Summary Activity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Start</td>
|
||||
<td>End</td>
|
||||
<td>Activity</td>
|
||||
<td>Schedule</td>
|
||||
<td>MB</td>
|
||||
</tr>
|
||||
<?php $i=0;foreach ($node->SUMMARY->find_all() as $so) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $so->display('START_TIME'); ?></td>
|
||||
<td class="head"><?php echo $so->display('END_TIME'); ?></td>
|
||||
<td class="head"><?php echo $so->display('ACTIVITY'); ?></td>
|
||||
<td class="head"><?php echo $so->display('SCHEDULE_NAME'); ?></td>
|
||||
<td class="head" style="text-align: right;"><?php printf('%3.2f',round($so->display('BYTES')/1024/1024,2)); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2">Schedule Activity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sched Start</td>
|
||||
<td>Act Start</td>
|
||||
<td>Schedule Name</td>
|
||||
<td>Status</td>
|
||||
<td>Completed</td>
|
||||
<td>Result</td>
|
||||
<tr>
|
||||
<?php $i=0;foreach ($node->EVENT->find_all() as $eo) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $eo->display('SCHEDULED_START'); ?></td>
|
||||
<td class="head"><?php echo $eo->ACTUAL_START ? $eo->display('ACTUAL_START') : ' '; ?></td>
|
||||
<td class="head"><?php echo $eo->display('SCHEDULE_NAME'); ?></td>
|
||||
<td class="head"><?php echo $eo->display('STATUS'); ?></td>
|
||||
<td class="head"><?php echo $eo->COMPLETED ? $eo->display('COMPLETED') : ' '; ?></td>
|
||||
<td class="head"><?php printf('%s %s',$eo->RESULT,$eo->display('REASON')); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
51
application/views/nodes/detail_volumes.php
Normal file
51
application/views/nodes/detail_volumes.php
Normal file
@ -0,0 +1,51 @@
|
||||
<table width="100%">
|
||||
<?php foreach (array('BACKUP','ARCHIVE') as $dtype) { ?>
|
||||
<tr>
|
||||
<td style="width: 100%; vertical-align: top;">
|
||||
<table class="box-full">
|
||||
<tr>
|
||||
<td class="head" colspan="2"><?php echo $dtype=='BACKUP' ? _('Backup Volumes') : _('Archive Volumes'); ?></td>
|
||||
</tr>
|
||||
<?php if ($node->volumes($dtype)) { ?>
|
||||
<tr>
|
||||
<td class="spacer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Volume</td>
|
||||
<td>Last Read Date</td>
|
||||
<td>Last Write Date</td>
|
||||
<td>Access</td>
|
||||
<td>Status</td>
|
||||
<td>Errors R/W</td>
|
||||
<td>Utilisation</td>
|
||||
<td>Reclaim</td>
|
||||
<td>Nodes on Vol</td>
|
||||
</tr>
|
||||
<?php $i=0; foreach ($node->volumes($dtype) as $stgpool => $vols) {
|
||||
$spo = ORM::factory('STGPOOL',$stgpool); ?>
|
||||
<tr class="subhead"><td colspan="9"><?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>
|
||||
<?php foreach ($vols as $vol) { ?>
|
||||
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
|
||||
<td class="head"><?php echo $vol->VOLUME_NAME; ?></td>
|
||||
<td class="head"><?php echo $vol->display('LAST_READ_DATE'); ?></td>
|
||||
<td class="head"><?php echo $vol->display('LAST_WRITE_DATE'); ?></td>
|
||||
<td class="head"><?php echo $vol->display('ACCESS'); ?></td>
|
||||
<td class="head"><?php echo $vol->display('STATUS'); ?></td>
|
||||
<td class="head"><?php printf('%s/%s',$vol->READ_ERRORS,$vol->WRITE_ERRORS); ?></td>
|
||||
<td class="head"><?php echo $vol->display('EST_CAPACITY_MB'); ?></td>
|
||||
<td class="head"><?php echo $vol->display('PCT_RECLAIM'); ?></td>
|
||||
<td class="head"><?php echo $vol->getNodesOnVol($dtype); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<tr><td><?php echo $dtype=='BACKUP' ? _('There are NO Backup Volumes for this Node.') : _('There are NO Archive Volumes for this Node.'); ?></td></tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
<td style="width: 50%; vertical-align: top;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</table>
|
Reference in New Issue
Block a user