T272 history loads last 24h upon click
This commit is contained in:
@@ -40,6 +40,8 @@ function getData(){
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkUuid(){
|
||||
if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
|
||||
clientUUID = json[0].clientUUID;
|
||||
|
||||
@@ -52,6 +52,13 @@ function loadHistory(dateFrom, dateTo){
|
||||
});
|
||||
}
|
||||
|
||||
function getLast24hHistoryData(){
|
||||
$.getJSON(host + '/api/event/' + clientUUID + '/' + lastId, function(data){
|
||||
historyJson = data;
|
||||
displayHistory();
|
||||
});
|
||||
}
|
||||
|
||||
function historyToHtml(){
|
||||
var innerHTML = '';
|
||||
var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations;
|
||||
|
||||
@@ -22,8 +22,9 @@ function changeAdvancedVisibility(){
|
||||
setCookie();
|
||||
}
|
||||
|
||||
const historyFilter = $('#history-filter');
|
||||
const historyFilterSwitch = function(){
|
||||
$('#history-filter').toggleClass('active');
|
||||
historyFilter.toggleClass('active');
|
||||
}
|
||||
|
||||
$("#optional").click(changeAdvancedVisibility);
|
||||
@@ -40,8 +41,16 @@ function showHistory(){
|
||||
$('#history').addClass('active');
|
||||
$('#historyTab').addClass('active');
|
||||
$('#historyTab').off('click');
|
||||
initializeHistory();
|
||||
}
|
||||
|
||||
function initializeHistory(){
|
||||
historyFilter.removeClass('active');
|
||||
getLast24hHistoryData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showHeaders(){
|
||||
$('#historyTab').click(showHistory);
|
||||
tabitem.removeClass('active');
|
||||
|
||||
@@ -40,6 +40,8 @@ function getData(){
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkUuid(){
|
||||
if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
|
||||
clientUUID = json[0].clientUUID;
|
||||
|
||||
@@ -52,6 +52,13 @@ function loadHistory(dateFrom, dateTo){
|
||||
});
|
||||
}
|
||||
|
||||
function getLast24hHistoryData(){
|
||||
$.getJSON(host + '/api/event/' + clientUUID + '/' + lastId, function(data){
|
||||
historyJson = data;
|
||||
displayHistory();
|
||||
});
|
||||
}
|
||||
|
||||
function historyToHtml(){
|
||||
var innerHTML = '';
|
||||
var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations;
|
||||
|
||||
@@ -22,8 +22,9 @@ function changeAdvancedVisibility(){
|
||||
setCookie();
|
||||
}
|
||||
|
||||
const historyFilter = $('#history-filter');
|
||||
const historyFilterSwitch = function(){
|
||||
$('#history-filter').toggleClass('active');
|
||||
historyFilter.toggleClass('active');
|
||||
}
|
||||
|
||||
$("#optional").click(changeAdvancedVisibility);
|
||||
@@ -40,8 +41,16 @@ function showHistory(){
|
||||
$('#history').addClass('active');
|
||||
$('#historyTab').addClass('active');
|
||||
$('#historyTab').off('click');
|
||||
initializeHistory();
|
||||
}
|
||||
|
||||
function initializeHistory(){
|
||||
historyFilter.removeClass('active');
|
||||
getLast24hHistoryData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showHeaders(){
|
||||
$('#historyTab').click(showHistory);
|
||||
tabitem.removeClass('active');
|
||||
|
||||
Reference in New Issue
Block a user