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){ | ||||
|   | ||||
| @@ -127,25 +127,7 @@ | ||||
|                             <!-- history --> | ||||
|                             <div id="history" class="medium-vertical-margin tabcontent"> | ||||
|                                 <div class="block-display max-width"> | ||||
|                                     <button id="btn-history-filter" class="clickable-text highlight switch"> | ||||
|                                         <span class="toggleIndicator"></span> filter  | ||||
|                                         <button type="button" class="refresh-button" onclick="refreshHistoryRecords();" >↻</button> | ||||
|                                     </button> | ||||
|                                     <div id ="history-filter" class="display-space-between max-width small-vertical-margin hiddable"> | ||||
|                                         <div class="three-fourth-width display-space-evenly"> | ||||
|                                             <div class="block-display half-width with-padding"> | ||||
|                                                 <label for="historyFrom" class="block-label">From</label> | ||||
|                                                 <input id="historyFrom" type="date" class="bordered-field max-width with-padding"> | ||||
|                                                 <input id="historyTimeFrom" type="time" class="small-vertical-margin bordered-field max-width with-padding"> | ||||
|                                             </div> | ||||
|                                             <div class="block-display half-width with-padding"> | ||||
|                                                 <label for="historyTo" class="block-label">To</label> | ||||
|                                                 <input id="historyTo" type="date" class="bordered-field max-width with-padding"> | ||||
|                                                 <input id="historyTimeTo" type="time" class="small-vertical-margin bordered-field max-width with-padding"> | ||||
|                                             </div> | ||||
|                                         </div> | ||||
|                                         <button id="btn-searchHistory" class="quater-width action-button active small-margins">Search</button> | ||||
|                                     </div> | ||||
|                                     <button type="button" class="refresh-button" onclick="refreshHistoryRecords();" >↻</button> | ||||
|                                  | ||||
|                                     <div class="max-width centered-content large-vertical-margin overflowedTableContent"> | ||||
|                                         <table id="historyTable" class="table-default"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user