Added google chart
This commit is contained in:
@@ -14,5 +14,43 @@ class Controller_Node extends Controller_TemplateDefault_View {
|
||||
protected $index_title = 'TSM Nodes';
|
||||
protected $detail_title = 'Information on Node';
|
||||
protected $orm = 'NODE';
|
||||
|
||||
public function action_ajax_jsonbackup() {
|
||||
$id = $this->request->param('id');
|
||||
$c = (isset($_REQUEST['c'])) ? $_REQUEST['c'] : null;
|
||||
$s = (isset($_REQUEST['s'])) ? $_REQUEST['s'] : null;
|
||||
$t = (isset($_REQUEST['t'])) ? $_REQUEST['t'] : null;
|
||||
|
||||
$no = ORM::factory('NODE',$id);
|
||||
|
||||
if (! $id OR ! $no->loaded() OR ! $t OR ! $c)
|
||||
return '';
|
||||
|
||||
$result = array();
|
||||
|
||||
$google = GoogleChart::factory($c)
|
||||
->logy(TRUE)
|
||||
->title(sprintf('%s Activity',$t).($s ? sprintf(' for Schedule %s',$s) : ' outside of TSM schedules'));
|
||||
|
||||
foreach ($no->act_bybtype($t) as $aso) {
|
||||
if ($aso->SCHEDULE_NAME != $s)
|
||||
continue;
|
||||
|
||||
$google->pdata($aso->display('START_TIME'),array(
|
||||
'yr'=>array(
|
||||
'BYTES'=>$aso->BYTES,
|
||||
),
|
||||
'yl'=>array(
|
||||
'AFFECTED'=>$aso->AFFECTED,
|
||||
'EXAMINED'=>$aso->EXAMINED,
|
||||
'FAILED'=>$aso->FAILED,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
$this->auto_render = FALSE;
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
$this->response->body($google->json());
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user