Fixed problems when filter by 'Specify time range' and lost filter and not show data

This commit is contained in:
m-lopez-f 2015-03-16 11:58:12 +01:00
parent 93a2d15b2c
commit b58bd83523
2 changed files with 15 additions and 11 deletions

View File

@ -191,8 +191,8 @@ if ($get_module_detail) {
$period = $period;
}
else {
$date = $datetime_from;
$period = $datetime_to - $datetime_from;
$date = $datetime_from + $period;
}
$count = modules_get_agentmodule_data ($module_id, $period,

View File

@ -327,15 +327,19 @@ enterprise_hook('close_meta_frame');
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) {
var params = {};
if (period == -1) {
var f = new Date();
period = $('#period').val();
params.selection_mode = $('input[name=selection_mode]:checked').val();
if(!params.selection_mode){params.selection_mode='fromnow';}
params.date_from = $('#text-date_from').val();
if(!params.date_from){params.date_from = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();}
params.time_from = $('#text-time_from').val();
if(!params.time_from){params.time_from = f.getHours() + ":" + f.getMinutes();}
params.date_to = $('#text-date_to').val();
if(!params.date_to){params.date_to =f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();}
params.time_to = $('#text-time_to').val();
}
if(!params.time_to){params.time_to = f.getHours() + ":" + f.getMinutes();}
params.page = "include/ajax/module";
params.get_module_detail = 1;