From 529d70d2bb91c627a2fa2dceea645342360aa26c Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 23 Jun 2011 17:03:41 +1000 Subject: [PATCH] Add Storage Pool Info --- application/classes/controller/domain.php | 8 - application/classes/controller/node.php | 16 +- application/classes/controller/stgpool.php | 70 ++++++ application/classes/controller/tree.php | 8 + application/classes/model/stgpool.php | 3 + application/views/domain/detail.php | 2 +- application/views/{nodes => node}/detail.php | 2 +- .../{nodes => node}/detail_filesystem.php | 0 .../views/{nodes => node}/detail_schedule.php | 0 .../views/{nodes => node}/detail_volumes.php | 22 +- application/views/{nodes => node}/policy.php | 0 application/views/stgpool/detail.php | 216 ++++++++++++++++++ 12 files changed, 314 insertions(+), 33 deletions(-) create mode 100644 application/classes/controller/stgpool.php rename application/views/{nodes => node}/detail.php (98%) rename application/views/{nodes => node}/detail_filesystem.php (100%) rename application/views/{nodes => node}/detail_schedule.php (100%) rename application/views/{nodes => node}/detail_volumes.php (66%) rename application/views/{nodes => node}/policy.php (100%) create mode 100644 application/views/stgpool/detail.php diff --git a/application/classes/controller/domain.php b/application/classes/controller/domain.php index 5cca653..bd2a9e3 100644 --- a/application/classes/controller/domain.php +++ b/application/classes/controller/domain.php @@ -33,14 +33,6 @@ class Controller_DOMAIN extends Controller_TemplateDefault { $output .= Form::submit('form_submit',_('Go')); $output .= Form::close(); - Script::add(array( - 'type'=>'stdin', - 'data'=>' -$(document).ready(function () {$("#domain_name").change(function () { - $("#domain_name").trigger("submit"); - });});' - )); - Block::add(array( 'title'=>_('TSM Domains'), 'body'=>$output, diff --git a/application/classes/controller/node.php b/application/classes/controller/node.php index b84df33..47f4c82 100644 --- a/application/classes/controller/node.php +++ b/application/classes/controller/node.php @@ -33,14 +33,6 @@ class Controller_NODE extends Controller_TemplateDefault { $output .= Form::submit('form_submit',_('Go')); $output .= Form::close(); - Script::add(array( - 'type'=>'stdin', - 'data'=>' -$(document).ready(function () {$("#node_name").change(function () { - $("#node_detail").trigger("submit"); - });});' - )); - Block::add(array( 'title'=>_('TSM Nodes'), 'body'=>$output, @@ -71,22 +63,22 @@ $(document).ready(function () {$("#node_name").change(function () { Block::add(array( 'title'=>sprintf('%s %s',_('Detailed Node Information for'),$no->NODE_NAME), - 'body'=>View::factory('nodes/detail')->set('node',$no), + 'body'=>View::factory('node/detail')->set('node',$no), )); Block::add(array( 'title'=>_('Protected File System Information'), - 'body'=>View::factory('nodes/detail_filesystem')->set('node',$no), + 'body'=>View::factory('node/detail_filesystem')->set('node',$no), )); Block::add(array( 'title'=>_('Sequential Volume Usage Information'), - 'body'=>View::factory('nodes/detail_volumes')->set('node',$no), + 'body'=>View::factory('node/detail_volumes')->set('node',$no), )); Block::add(array( 'title'=>_('Schedule Information'), - 'body'=>View::factory('nodes/detail_schedule')->set('node',$no), + 'body'=>View::factory('node/detail_schedule')->set('node',$no), )); } } diff --git a/application/classes/controller/stgpool.php b/application/classes/controller/stgpool.php new file mode 100644 index 0000000..769a8bb --- /dev/null +++ b/application/classes/controller/stgpool.php @@ -0,0 +1,70 @@ +%s stgpool pools.'),$so->count_all()); + $output .= '
'; + $output .= '
'; + + $select = array(); + $select[NULL] = ''; + + foreach ($so->find_all() as $stgpool) + $select[$stgpool->STGPOOL_NAME] = $stgpool->STGPOOL_NAME; + + $output .= Form::open('/stgpool/detail',array('id'=>'stgpool_detail')); + $output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('stgpool_name',$select,NULL,array('id'=>'stgpool_name'))); + $output .= Form::submit('form_submit',_('Go')); + $output .= Form::close(); + + Block::add(array( + 'title'=>_('TSM Storage Pools'), + 'body'=>$output, + )); + } + + public function action_detail($stgpool=NULL) { + if (is_null($stgpool) AND (empty($_POST['stgpool_name']) OR ! $stgpool = $_POST['stgpool_name'])) { + SystemMessage::add(array( + 'title'=>_('STGPOOL_NAME is required'), + 'type'=>'error', + 'body'=>_('The stgpool pool name is required.'), + )); + + Request::current()->redirect('stgpool'); + } + + $so = ORM::factory('stgpool',$stgpool); + if (! $so->loaded()) { + SystemMessage::add(array( + 'title'=>_('Unknown STGPOOL_NAME'), + 'type'=>'error', + 'body'=>sprintf(_('The stgpool pool [%s] does not exist?.'),$stgpool), + )); + + Request::current()->redirect('stgpool'); + } + + Block::add(array( + 'title'=>sprintf(_('Storage Pool Information for %s'),$so->STGPOOL_NAME), + 'body'=>View::factory('stgpool/detail')->set('so',$so) + )); + } +} +?> diff --git a/application/classes/controller/tree.php b/application/classes/controller/tree.php index 8f45255..ede3e1a 100644 --- a/application/classes/controller/tree.php +++ b/application/classes/controller/tree.php @@ -47,6 +47,14 @@ class Controller_Tree extends Controller_lnApp_Tree { 'attr_href'=>URL::Site('server/gantt'), )); + array_push($data,array( + 'id'=>'stgpool', + 'name'=>'Storage Pool Info', + 'state'=>'none', + 'attr_id'=>'1', + 'attr_href'=>URL::Site('stgpool'), + )); + return parent::action_json($id,$data); } } diff --git a/application/classes/model/stgpool.php b/application/classes/model/stgpool.php index ff02beb..e1aed06 100644 --- a/application/classes/model/stgpool.php +++ b/application/classes/model/stgpool.php @@ -19,5 +19,8 @@ class Model_STGPOOL extends ORMTSM { protected $_has_one = array( 'DEVCLASSES'=>array('foreign_key'=>'DEVCLASS_NAME','far_key'=>'DEVCLASS'), ); + protected $_has_many = array( + 'VOLUME'=>array('foreign_key'=>'STGPOOL_NAME','far_key'=>'STGPOOL_NAME'), + ); } ?> diff --git a/application/views/domain/detail.php b/application/views/domain/detail.php index 3abb276..c002c99 100644 --- a/application/views/domain/detail.php +++ b/application/views/domain/detail.php @@ -166,7 +166,7 @@ - set('domain',$do); ?> + set('domain',$do); ?> diff --git a/application/views/nodes/detail.php b/application/views/node/detail.php similarity index 98% rename from application/views/nodes/detail.php rename to application/views/node/detail.php index cae9808..099ae89 100644 --- a/application/views/nodes/detail.php +++ b/application/views/node/detail.php @@ -148,7 +148,7 @@ - set('domain',$node->DOMAIN); ?> + set('domain',$node->DOMAIN); ?> diff --git a/application/views/nodes/detail_filesystem.php b/application/views/node/detail_filesystem.php similarity index 100% rename from application/views/nodes/detail_filesystem.php rename to application/views/node/detail_filesystem.php diff --git a/application/views/nodes/detail_schedule.php b/application/views/node/detail_schedule.php similarity index 100% rename from application/views/nodes/detail_schedule.php rename to application/views/node/detail_schedule.php diff --git a/application/views/nodes/detail_volumes.php b/application/views/node/detail_volumes.php similarity index 66% rename from application/views/nodes/detail_volumes.php rename to application/views/node/detail_volumes.php index a800ad2..9be763d 100644 --- a/application/views/nodes/detail_volumes.php +++ b/application/views/node/detail_volumes.php @@ -25,18 +25,18 @@ volumes($ctype) as $stgpool => $vols) { $spo = ORM::factory('STGPOOL',$stgpool); ?> - + - - - - - - - - - - + + + + + + + + + + diff --git a/application/views/nodes/policy.php b/application/views/node/policy.php similarity index 100% rename from application/views/nodes/policy.php rename to application/views/node/policy.php diff --git a/application/views/stgpool/detail.php b/application/views/stgpool/detail.php new file mode 100644 index 0000000..b0f25a9 --- /dev/null +++ b/application/views/stgpool/detail.php @@ -0,0 +1,216 @@ +
STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE); ?>
VOLUME_NAME; ?>display('LAST_READ_DATE'); ?>display('LAST_WRITE_DATE'); ?>display('ACCESS'); ?>display('STATUS'); ?>READ_ERRORS,$vol->WRITE_ERRORS); ?>display('EST_CAPACITY_MB'); ?>display('PCT_RECLAIM'); ?>getFSOnVol($ctype); ?>getNodesOnVol($ctype); ?>VOLUME_NAME; ?>display('LAST_READ_DATE'); ?>display('LAST_WRITE_DATE'); ?>display('ACCESS'); ?>display('STATUS'); ?>READ_ERRORS,$vo->WRITE_ERRORS); ?>display('EST_CAPACITY_MB'); ?>display('PCT_RECLAIM'); ?>getFSOnVol($ctype); ?>getNodesOnVol($ctype); ?>
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + DEVCLASS != 'DISK') { ?> + + + + + + + + + + + + + + + + + + + + + + DEVCLASS === 'DISK') { ?> + + + + + + + + + + + + + + + + + + + + + + + + NEXTSTGPOOL AND $so->POOLTYPE === 'PRIMARY') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + NEXTSTGPOOL AND $so->POOLTYPE === 'PRIMARY') { ?> + + + + + + + + + + + + + + + + + + +
Information for this Storage Pool
 
Descriptiondisplay('DESCRIPTION'); ?>
Typedisplay('POOLTYPE'); ?>
Est Capacitydisplay('EST_CAPACITY_MB'); ?>
Util %display('PCT_UTILIZED'); ?>
Scratch VolsNUMSCRATCHUSED,$so->MAXSCRATCH); ?>
Volume Reuse Delaydisplay('REUSEDELAY'); ?>
Accessdisplay('ACCESS'); ?>
Max Object Sizedisplay('MAXSIZE'); ?>
Collatedisplay('COLLOCATE'); ?>
Cache Migrated Filesdisplay('CACHE'); ?>
Reclaim %display('RECLAIM'); ?>
Reclaim Processesdisplay('RECLAIMPROCESS'); ?>
Reclaim Storage Pooldisplay('RECLAIMSTGPOOL'); ?>
 
Next Pooldisplay('NEXTSTGPOOL'); ?>
Migratable %display('PCT_MIGR'); ?>
Hi/Low MigrationHIGHMIG,$so->LOWMIG); ?>
Migration Delaydisplay('MIGDELAY'); ?>
Migration Continuedisplay('MIGCONTINUE'); ?>
Last Migration Timedisplay('MIGR_SECONDS'); ?>
Last Migration Datadisplay('MIGR_MB'); ?>
 
Active Data Poolsdisplay('ACTIVEDATASTGPOOLS'); ?>
Copy Poolsdisplay('COPYSTGPOOLS'); ?>
Copy Continuedisplay('COPYCONTINUE'); ?>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DEVCLASSES->DEVTYPE == 'FILE') { ?> + + + + + + + + + + + + + + + + + + +
Device Class information
 
AccessDEVCLASSES->display('ACCESS_STRATEGY'); ?>
Total Storage PoolsDEVCLASSES->display('STGPOOL_COUNT'); ?>
Device TypeDEVCLASSES->display('DEVTYPE'); ?>
FormatDEVCLASSES->display('FORMAT'); ?>
CapacityDEVCLASSES->display('CAPACITY'); ?>
Mount LimitDEVCLASSES->display('MOUNTLIMIT'); ?>
DirectoryDEVCLASSES->display('DIRECTORY'); ?>
LibraryDEVCLASSES->display('LIBRARY_NAME'); ?>
Mount WaitDEVCLASSES->display('MOUNTWAIT'); ?>
Mount RetentionDEVCLASSES->display('MOUNTRETENTION'); ?>
+
+ + + + + + + + + + + + + + + + + $ctype) { ?> + + + + + VOLUME->find_all() as $vo) { ?> + + + + + + + + + + $ctype) { ?> + + + + + +
Volumes in this Storage Pool
 
VolumeLast Read DateLast Write DateAccessStatusErrors R/WUtil %Reclaim
display('VOLUME_NAME'); ?>display('LAST_READ_DATE'); ?>display('LAST_WRITE_DATE'); ?>display('ACCESS'); ?>display('STATUS'); ?>READ_ERRORS,$vo->WRITE_ERRORS); ?>display('EST_CAPACITY_MB'); ?>display('PCT_RECLAIM'); ?>getFSOnVol($ctype); ?>getNodesOnVol($ctype); ?>
+