Skip to content

Commit 798c057

Browse files
authored
Predefined timespan (#309)
* fix: Correcting issues with predefined timespan * QA: Additional fixes for timespan work
1 parent 834a536 commit 798c057

2 files changed

Lines changed: 268 additions & 265 deletions

File tree

js/functions.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ function applyFilter() {
8585
strURL += '&removal='+$('#removal').val();
8686
strURL += '&refresh='+$('#refresh').val();
8787
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-
}
88+
strURL += '&predefined_timespan='+$('#predefined_timespan').val();
89+
strURL += '&date1='+$('#date1').val();
90+
strURL += '&date2='+$('#date2').val();
9591

9692
loadPageNoHeader(strURL);
9793
}
@@ -174,6 +170,8 @@ function initSyslogMain(config) {
174170
var pageTab = config.pageTab || '';
175171
var hostTerm = '';
176172
var placeHolder = config.placeHolder || '';
173+
var origDate1 = $('#date1').val();
174+
var origDate2 = $('#date2').val();
177175

178176
// Make pageTab global for other functions
179177
window.pageTab = pageTab;
@@ -322,20 +320,28 @@ function initSyslogMain(config) {
322320
stepMinute: 1,
323321
showAnim: 'slideDown',
324322
numberOfMonths: 1,
325-
timeFormat: 'HH:mm',
323+
timeFormat: 'HH:mm:ss',
326324
dateFormat: 'yy-mm-dd',
327325
showButtonPanel: false
326+
}).on('change', function() {
327+
if ($('#date1').val() != origDate1) {
328+
$('#predefined_timespan').val(0).selectmenu('refresh');
329+
}
328330
});
329331

330332
$('#date2').datetimepicker({
331333
minuteGrid: 10,
332334
stepMinute: 1,
333335
showAnim: 'slideDown',
334336
numberOfMonths: 1,
335-
timeFormat: 'HH:mm',
337+
timeFormat: 'HH:mm:ss',
336338
dateFormat: 'yy-mm-dd',
337339
showButtonPanel: false
338-
});
340+
}).on('change', function() {
341+
if ($('#date2').val() != origDate2) {
342+
$('#predefined_timespan').val(0).selectmenu('refresh');
343+
}
344+
});;
339345
});
340346
}
341347

0 commit comments

Comments
 (0)