Simplified history
This commit is contained in:
@@ -1,38 +1,7 @@
|
||||
var historyJson = {};
|
||||
const maxIterations = 200;
|
||||
|
||||
function filterHistory(){
|
||||
var dateFrom = new Date($('#historyFrom').val() + 'T' + $('#historyTimeFrom').val());
|
||||
|
||||
var dateTo = new Date($('#historyTo').val() + 'T' + $('#historyTimeTo').val());
|
||||
|
||||
loadHistory(dateFrom, dateTo);
|
||||
}
|
||||
|
||||
const startSearch = function(){
|
||||
filterHistory();
|
||||
}
|
||||
$('#btn-searchHistory').click(startSearch);
|
||||
|
||||
function loadHistory(dateFrom, dateTo){
|
||||
|
||||
var eventRequest = {
|
||||
clientUUID : json.clientUUID,
|
||||
localDateTimeFrom : dateFrom,
|
||||
localDateTimeTo : dateTo,
|
||||
};
|
||||
$.ajax({
|
||||
url: host + '/api/event',
|
||||
type: 'POST',
|
||||
data: JSON.stringify(eventRequest, null, 2),
|
||||
contentType: "application/json"
|
||||
}).done(function(data){
|
||||
historyJson = data;
|
||||
displayHistory();
|
||||
});
|
||||
}
|
||||
|
||||
function getLast24hHistoryData(){
|
||||
function getHistoryData(){
|
||||
$.getJSON(host + '/api/event/' + clientUUID, function(data){
|
||||
historyJson = data;
|
||||
displayHistory();
|
||||
|
||||
@@ -48,7 +48,7 @@ function showHistory(){
|
||||
|
||||
function initializeHistory(){
|
||||
historyFilter.removeClass('active');
|
||||
getLast24hHistoryData();
|
||||
getHistoryData();
|
||||
}
|
||||
|
||||
function showHeaders(){
|
||||
@@ -176,7 +176,7 @@ function focusOutTip(element){
|
||||
}
|
||||
|
||||
function refreshHistoryRecords(){
|
||||
getLast24hHistoryData();
|
||||
getHistoryData();
|
||||
}
|
||||
|
||||
function hidTip(element){
|
||||
|
||||
Reference in New Issue
Block a user