Improvements to SSL classes
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
// @todo This "module" menu items should belong in the module dir.
|
||||
protected $secure_actions = array(
|
||||
'ajaxlist'=>FALSE, // @todo To Change
|
||||
'ajaxlist'=>TRUE,
|
||||
'ajaxjson_traffic'=>TRUE,
|
||||
'adslstat'=>TRUE,
|
||||
'list'=>TRUE,
|
||||
'listbycheckout'=>TRUE,
|
||||
@@ -45,6 +46,23 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
$this->response->body(json_encode(array_values($return)));
|
||||
}
|
||||
|
||||
public function action_ajaxjson_traffic() {
|
||||
$return = array();
|
||||
$svs = ORM::factory('service')->list_bylistgroup('ADSL');
|
||||
$data = $this->consoltraffic($svs,time());
|
||||
|
||||
$google = GoogleChart::factory('ComboChart');
|
||||
|
||||
foreach ($data['data'] as $key => $values)
|
||||
$google->data(array('yl'=>$key),array($key=>$values));
|
||||
|
||||
$google->data(array('yr'=>'services'),array('services'=>$data['svs']));
|
||||
|
||||
$this->auto_render = FALSE;
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
$this->response->body($google->json());
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a list of services
|
||||
*/
|
||||
@@ -179,8 +197,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
$svs = ORM::factory('service')->list_bylistgroup('ADSL');
|
||||
$data = $this->consoltraffic($svs,time());
|
||||
|
||||
$google = GoogleChart::factory('Legacy')
|
||||
->type('vertical_bar')
|
||||
$google = GoogleChart::factory('ComboChart')
|
||||
->title(sprintf('ADSL traffic as at %s',date('Y-m-d',strtotime('yesterday'))));
|
||||
|
||||
foreach ($data['data'] as $key => $values)
|
||||
@@ -189,9 +206,6 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
$google->data(array('yr'=>'services'),array('services'=>$data['svs']));
|
||||
|
||||
Block::add(array('body'=>(string)$google));
|
||||
Block::add(array('body'=>$google->table(FALSE,array(
|
||||
'table'=>'style="border: 1px solid #bebcb7; padding: 5px 5px; background: none repeat scroll 0% 0% #f8f7f5; font-size: 70%;"',
|
||||
))));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('ADSL Services'),
|
||||
|
Reference in New Issue
Block a user