Skip to content

Commit 834a536

Browse files
authored
fix: Correcting issues with predefined timespan (#308)
1 parent b8e6edc commit 834a536

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

js/functions.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ function applyTimespan() {
7373
*/
7474
function applyFilter() {
7575
var strURL = 'syslog.php?tab='+(window.pageTab || '');
76+
7677
strURL += '&header=false';
77-
strURL += '&date1='+$('#date1').val();
78-
strURL += '&date2='+$('#date2').val();
7978
strURL += '&host='+$('#host').val();
8079
strURL += '&rfilter='+base64_encode($('#rfilter').val());
8180
strURL += '&efacility='+$('#efacility').val();
@@ -86,6 +85,14 @@ function applyFilter() {
8685
strURL += '&removal='+$('#removal').val();
8786
strURL += '&refresh='+$('#refresh').val();
8887
strURL += '&grouping=' + ($('#grouping').length ? $('#grouping').val() : '0');
88+
89+
if ($('#predefined_timespan').val() == 0) {
90+
strURL += '&date1='+$('#date1').val();
91+
strURL += '&date2='+$('#date2').val();
92+
} else {
93+
strURL += '&predefined_timespan='+$('#predefined_timespan').val();
94+
}
95+
8996
loadPageNoHeader(strURL);
9097
}
9198

@@ -577,7 +584,7 @@ function initSyslogAutocomplete(formName, callback, onChange) {
577584
var formNameTimer;
578585
var formNameClickTimer;
579586
var formNameOpen = false;
580-
587+
581588
$(function() {
582589
$('#' + formName + '_input').autocomplete({
583590
source: window.location.pathname + '?action=' + callback,
@@ -614,8 +621,8 @@ function initSyslogAutocomplete(formName, callback, onChange) {
614621
}, 200);
615622
}
616623
}).on('mouseleave', function() {
617-
formNameTimer = setTimeout(function() {
618-
$('#' + formName + '_input').autocomplete('close');
624+
formNameTimer = setTimeout(function() {
625+
$('#' + formName + '_input').autocomplete('close');
619626
}, 800);
620627
});
621628

@@ -630,8 +637,8 @@ function initSyslogAutocomplete(formName, callback, onChange) {
630637
$('ul[id^="ui-id"]').on('mouseenter', function() {
631638
clearTimeout(formNameTimer);
632639
}).on('mouseleave', function() {
633-
formNameTimer = setTimeout(function() {
634-
$('#' + formName + '_input').autocomplete('close');
640+
formNameTimer = setTimeout(function() {
641+
$('#' + formName + '_input').autocomplete('close');
635642
}, 800);
636643
});
637644

0 commit comments

Comments
 (0)