Added volume reporting, improved overall configuration view
This commit is contained in:
@@ -10,78 +10,9 @@
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Node extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
$no = ORM::factory('NODE');
|
||||
$output = '';
|
||||
|
||||
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->count_all());
|
||||
$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'));
|
||||
$output .= sprintf('%s: %s',_('Choose a node to view'),Form::select('node_name',$select,NULL,array('id'=>'node_name')));
|
||||
$output .= Form::submit('form_submit',_('Go'));
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('TSM Nodes'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
public function action_detail() {
|
||||
$node_name = $this->request->param('id');
|
||||
|
||||
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.'),
|
||||
));
|
||||
|
||||
HTTP::redirect('node');
|
||||
}
|
||||
|
||||
$no = ORM::factory('NODE',$node_name);
|
||||
if (! $no->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Unknown NODE_NAME'),
|
||||
'type'=>'error',
|
||||
'body'=>sprintf(_('The node [%s] does not exist?.'),$node_name),
|
||||
));
|
||||
|
||||
HTTP::redirect('node');
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s %s',_('Detailed Node Information for'),$no->NODE_NAME),
|
||||
'body'=>View::factory('node/detail')->set('o',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Protected File System Information'),
|
||||
'body'=>View::factory('node/filesystems')->set('o',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Sequential Volume Usage Information'),
|
||||
'body'=>View::factory('node/volumes')->set('o',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Schedule Information'),
|
||||
'body'=>View::factory('node/schedule')->set('o',$no),
|
||||
));
|
||||
}
|
||||
class Controller_Node extends Controller_TemplateDefault_View {
|
||||
protected $index_title = 'TSM Nodes';
|
||||
protected $detail_title = 'Information on Node';
|
||||
protected $orm = 'NODE';
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user