2011-04-07 05:03:05 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class provides information on TSM Nodes.
|
|
|
|
*
|
|
|
|
* @package PTA
|
|
|
|
* @subpackage Nodes
|
|
|
|
* @category Controllers
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 phpTSMadmin Development Team
|
|
|
|
* @license http://phptsmadmin.sf.net/license.html
|
|
|
|
*/
|
2012-11-27 01:26:56 +00:00
|
|
|
class Controller_Node extends Controller_TemplateDefault {
|
2011-04-07 05:03:05 +00:00
|
|
|
/**
|
|
|
|
* Default Index for Controller
|
|
|
|
*/
|
|
|
|
public function action_index() {
|
2012-11-27 01:26:56 +00:00
|
|
|
$no = ORM::factory('NODE');
|
2011-04-07 05:03:05 +00:00
|
|
|
$output = '';
|
|
|
|
|
2011-05-31 00:42:47 +00:00
|
|
|
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->count_all());
|
2011-04-07 05:03:05 +00:00
|
|
|
$output .= '<br/>';
|
|
|
|
$output .= '<br/>';
|
|
|
|
|
|
|
|
$select = array();
|
|
|
|
$select[NULL] = '';
|
|
|
|
|
|
|
|
foreach ($no->find_all() as $node)
|
|
|
|
$select[$node->NODE_NAME] = $node->NODE_NAME;
|
|
|
|
|
|
|
|
$output .= Form::open('/node/detail',array('id'=>'node_detail'));
|
2011-05-31 14:51:15 +00:00
|
|
|
$output .= sprintf('%s: %s',_('Choose a node to view'),Form::select('node_name',$select,NULL,array('id'=>'node_name')));
|
2011-04-07 05:03:05 +00:00
|
|
|
$output .= Form::submit('form_submit',_('Go'));
|
|
|
|
$output .= Form::close();
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('TSM Nodes'),
|
|
|
|
'body'=>$output,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2012-11-27 05:46:43 +00:00
|
|
|
public function action_detail() {
|
|
|
|
$node_name = $this->request->param('id');
|
|
|
|
|
2011-05-31 14:51:15 +00:00
|
|
|
if (is_null($node_name) AND (empty($_POST['node_name']) OR ! $node_name = $_POST['node_name'])) {
|
|
|
|
SystemMessage::add(array(
|
|
|
|
'title'=>_('NODE_NAME is required'),
|
|
|
|
'type'=>'error',
|
|
|
|
'body'=>_('The node name is required.'),
|
|
|
|
));
|
|
|
|
|
2012-11-26 05:57:18 +00:00
|
|
|
HTTP::redirect('node');
|
2011-05-31 14:51:15 +00:00
|
|
|
}
|
2011-04-07 05:03:05 +00:00
|
|
|
|
2012-11-27 01:26:56 +00:00
|
|
|
$no = ORM::factory('NODE',$node_name);
|
2011-05-31 14:51:15 +00:00
|
|
|
if (! $no->loaded()) {
|
|
|
|
SystemMessage::add(array(
|
|
|
|
'title'=>_('Unknown NODE_NAME'),
|
|
|
|
'type'=>'error',
|
|
|
|
'body'=>sprintf(_('The node [%s] does not exist?.'),$node_name),
|
|
|
|
));
|
|
|
|
|
2012-11-26 05:57:18 +00:00
|
|
|
HTTP::redirect('node');
|
2011-05-31 14:51:15 +00:00
|
|
|
}
|
2011-04-07 05:03:05 +00:00
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>sprintf('%s %s',_('Detailed Node Information for'),$no->NODE_NAME),
|
2012-11-29 22:58:15 +00:00
|
|
|
'body'=>View::factory('node/detail')->set('o',$no),
|
2011-04-07 05:03:05 +00:00
|
|
|
));
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('Protected File System Information'),
|
2012-11-29 22:58:15 +00:00
|
|
|
'body'=>View::factory('node/filesystems')->set('o',$no),
|
2011-04-07 05:03:05 +00:00
|
|
|
));
|
|
|
|
|
2011-05-23 15:04:40 +00:00
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('Sequential Volume Usage Information'),
|
2012-11-29 22:58:15 +00:00
|
|
|
'body'=>View::factory('node/volumes')->set('o',$no),
|
2011-05-23 15:04:40 +00:00
|
|
|
));
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('Schedule Information'),
|
2012-11-29 22:58:15 +00:00
|
|
|
'body'=>View::factory('node/schedule')->set('o',$no),
|
2011-05-23 15:04:40 +00:00
|
|
|
));
|
2011-04-07 05:03:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|