Simplified history

This commit is contained in:
2023-05-26 13:55:48 +02:00
parent d336f5d18e
commit 9b18a9f42d
7 changed files with 15 additions and 138 deletions

View File

@@ -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();