diff --git a/application/classes/Model/ACTLOG.php b/application/classes/Model/ACTLOG.php index a1843c2..1506b7a 100644 --- a/application/classes/Model/ACTLOG.php +++ b/application/classes/Model/ACTLOG.php @@ -15,5 +15,20 @@ class Model_ACTLOG extends ORM_TSM { protected $_sorting = array( 'DATE_TIME'=>'ASC', ); + + protected $_display_filters = array( + 'DATE_TIME'=>array( + array('ORM_TSM::date',array(':value','d-M H:i')), + ), + ); + + private $_msgno_ba_objects = array(4952,4953,4954,4958,4960,4957,4970,4959,4982); + private $_msgno_ba_bytes = array(4977,4975,4984,4198,4961); + private $_msgno_ba_transfer = array(4963,4966,4967,4964); + private $_msgno_ba_reduction = array(4968,4981,4976); + + public function exclude_ba() { + return $this->where('MSGNO','NOT IN',array_merge($this->_msgno_ba_objects,$this->_msgno_ba_bytes,$this->_msgno_ba_transfer,$this->_msgno_ba_reduction)); + } } ?> diff --git a/application/classes/Model/NODE.php b/application/classes/Model/NODE.php index 5c27074..dddf7ba 100644 --- a/application/classes/Model/NODE.php +++ b/application/classes/Model/NODE.php @@ -20,6 +20,7 @@ class Model_NODE extends ORM_TSM { 'DOMAIN'=>array('foreign_key'=>'DOMAIN_NAME','far_key'=>'DOMAIN_NAME'), ); protected $_has_many = array( + 'ACTLOG'=>array('foreign_key'=>'NODENAME','far_key'=>'NODE_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'), @@ -267,6 +268,25 @@ class Model_NODE extends ORM_TSM { return $this->vols_byctype($type) ? TRUE : FALSE; } + public function activity() { + Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__)); + + $k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME); + $c = Kohana::$config->load('config')->cache; + + if (is_null($result = Cache::instance($c)->get($k))) { + $result = array(); + + $result = $this->ACTLOG->exclude_ba()->find_all(); + + // @todo Cache time should be configurble + Cache::instance($c)->set($k,$result,300); + } + + Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__)); + return $result; + } + /** * Return the BACKUP TYPES used by this NODE * ie: Bkup/Arch/SpMg @@ -278,7 +298,7 @@ class Model_NODE extends ORM_TSM { $c = Kohana::$config->load('config')->cache; if (is_null($result = Cache::instance($c)->get($k))) { - $x = $result = array(); + $result = array(); foreach ($this->_occupancy() as $oo) if (! in_array($oo->TYPE,$result)) diff --git a/application/classes/ORM/TSM.php b/application/classes/ORM/TSM.php index a859b28..b03daab 100644 --- a/application/classes/ORM/TSM.php +++ b/application/classes/ORM/TSM.php @@ -111,7 +111,6 @@ abstract class ORM_TSM extends ORM { private function isCacheable() { $config = Kohana::$config->load('database')->{Kohana::$config->load('config')->client_type}; -//echo Debug::vars(array('m'=>__METHOD__,'cpl'=>$config['cachepreload'],'tn'=>$this->_table_name,'db'=>count($this->_db_pending),'pend'=>$this->_db_pending,'pk'=>$this->_primary_key)); if ($config['caching'] AND isset($config['cachepreload'][$this->_table_name]) AND count($this->_db_pending) == 1 AND $this->_db_pending[0]['name'] == 'where' AND $this->_db_pending[0]['args'][0] == $this->_primary_key AND $this->_db_pending[0]['args'][1] == '=') return $config['cachepreload'][$this->_table_name]; else diff --git a/application/views/node/activity.php b/application/views/node/activity.php new file mode 100644 index 0000000..37dc2fa --- /dev/null +++ b/application/views/node/activity.php @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + activity() as $ao) { ?> + + + +
Node Activity
 
DateScheduleSessionMessage
DISPLAY('DATE_TIME'); ?> + DISPLAY('SCHEDNAME'); ?> + DISPLAY('SESSION'); ?> + DISPLAY('MESSAGE'); ?> +
diff --git a/application/views/node/detail.php b/application/views/node/detail.php index 20eaa7f..e1da41c 100644 --- a/application/views/node/detail.php +++ b/application/views/node/detail.php @@ -15,3 +15,4 @@ set('o',$o); ?> set('o',$o); ?> set('o',$o); ?> +set('o',$o); ?>