fixed undefined error in saimod log stats
This commit is contained in:
parent
7f3b7e0308
commit
faa295662e
@ -43,26 +43,62 @@ function load_visualisation(){
|
||||
var name = $('#vis_filter_type').val();;
|
||||
var filter = $('#vis_filter_time').val();
|
||||
var db = $('#stats_tabs li.active').attr('db');
|
||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=stats&name='+name+'&filter='+filter+'&db='+db,function(json){
|
||||
if(!json || json.status != true || !json.result){
|
||||
$('img#loader').hide();
|
||||
return;
|
||||
/*$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=stats&name='+name+'&filter='+filter+'&db='+db,function(json){
|
||||
|
||||
});*/
|
||||
$.ajax({
|
||||
async: true,
|
||||
url: this.endpoint,
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: {
|
||||
sai_mod: '.SYSTEM.SAI.saimod_sys_log',
|
||||
action: 'stats',
|
||||
name: name,
|
||||
filter: filter,
|
||||
db: db
|
||||
},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
var json = data.result;
|
||||
var gdata = new google.visualization.DataTable();
|
||||
first = true;
|
||||
$.each(json[0], function(key, value){
|
||||
if(first){
|
||||
gdata.addColumn('datetime',key);
|
||||
first = false;
|
||||
} else {
|
||||
gdata.addColumn('number',key);
|
||||
}
|
||||
});
|
||||
$.each(json, function(key, value){
|
||||
first = true;
|
||||
gdata.addRow($.map(value, function(v) {
|
||||
if(first){
|
||||
first=false;
|
||||
return [new Date(v)];
|
||||
} else {
|
||||
return [(v == null || parseFloat(v) <= 0) ? parseFloat(0) : parseFloat(v)];
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
var options = { title: name,
|
||||
aggregationTarget: 'category',
|
||||
selectionMode: 'multiple',
|
||||
curveType: 'function',
|
||||
/*focusTarget: 'category',*/
|
||||
chartArea: {left:100,top:40},
|
||||
vAxis: {logScale: true},
|
||||
interpolateNulls: false,
|
||||
width: "1200",
|
||||
height: "500"};
|
||||
new google.visualization.LineChart(document.getElementById('vis')).draw(gdata, options);
|
||||
}
|
||||
$('img#loader').hide();
|
||||
},
|
||||
error: function(){
|
||||
alert('Something happend - try again!');
|
||||
}
|
||||
json = json.result;
|
||||
$('img#loader').hide();
|
||||
var data = new google.visualization.DataTable();
|
||||
first = true;
|
||||
$.each(json[0], function(key, value){
|
||||
if(first){
|
||||
data.addColumn('datetime',key);
|
||||
first = false;
|
||||
} else {
|
||||
data.addColumn('number',key);
|
||||
}
|
||||
});
|
||||
$.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? parseFloat(0) : parseFloat(v)];}}));});
|
||||
|
||||
var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:100,top:40}, vAxis:{logScale: true}, interpolateNulls: false, width: "1200", height: "500"};
|
||||
new google.visualization.LineChart(document.getElementById('vis')).draw(data, options);
|
||||
});
|
||||
}
|
||||
@ -74,7 +74,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_CLASS_SYSTEM::QA(array($filter));
|
||||
@ -108,7 +108,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_other($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_other($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_CLASS_OTHER::QA(array($filter));
|
||||
@ -138,7 +138,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_basic($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_basic($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_CLASS_BASIC::QA(array($filter));
|
||||
@ -170,7 +170,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_basic($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_basic($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_UNIQUE_BASIC::QA(array($filter));
|
||||
@ -200,7 +200,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_request($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_request($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_UNIQUE_REQUEST::QA(array($filter));
|
||||
@ -231,7 +231,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_exception($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_exception($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_UNIQUE_EXCEPTION::QA(array($filter));
|
||||
@ -261,7 +261,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_referer($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_unique_referer($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_UNIQUE_REFERER::QA(array($filter));
|
||||
@ -292,7 +292,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_visitor($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_visitor($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_BASIC_VISITOR::QA(array($filter));
|
||||
@ -321,7 +321,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_sucess($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_sucess($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_BASIC_SUCCESS::QA(array($filter));
|
||||
@ -364,7 +364,7 @@ class saimod_sys_log extends \SYSTEM\SAI\sai_module {
|
||||
* @param string $db DB to operate on
|
||||
* @return json Returns json with data
|
||||
*/
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_querytime($filter,$db){
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_basic_querytime($filter,$db=null){
|
||||
$result = array();
|
||||
if(!$db){
|
||||
$result = \SYSTEM\SQL\SYS_SAIMOD_LOG_BASIC_QUERYTIME::QA(array($filter));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user