T139 Server returns history to client request
This commit is contained in:
		| @@ -101,7 +101,7 @@ | ||||
|                                     <label for="historyTo">To</label> | ||||
|                                     <input type="datetime" name="dateTo" id="historyTo"/> | ||||
|                                 </div> | ||||
|                                 <button>Search</button> | ||||
|                                 <button id="btn-searchHistory">Search</button> | ||||
|                             </div> | ||||
|                             <div> | ||||
|                                 <table id="historyTable" class="simpleTable"> | ||||
| @@ -208,6 +208,6 @@ | ||||
|     <script type="text/javascript" src="/js/modal.js"></script> | ||||
|     <script type="text/javascript" src="/js/uianimation.js"></script> | ||||
|     <script type="text/javascript" src="/js/datatransfer.js"></script> | ||||
|      | ||||
|     <script type="text/javascript" src="/js/historyloader.js"></script> | ||||
| </body> | ||||
| </html> | ||||
| @@ -0,0 +1,26 @@ | ||||
| var historyJson = {}; | ||||
|  | ||||
| function searchHistory(){ | ||||
|     var dateFrom = $('#historyFrom').val(); | ||||
|     var dateTo = $('#historyTo').val(); | ||||
|     var eventRequest = { | ||||
|         clientUUID : json[jsonIndex].clientUUID, | ||||
|         localDateTimeFrom : dateFrom, | ||||
|         localDateTimeTo : dateTo, | ||||
|         mockedResponseId : json[jsonIndex].mockedResponseId | ||||
|     }; | ||||
|     $.ajax({ | ||||
|         url: host + '/api/event', | ||||
|         type: 'POST', | ||||
|         data: JSON.stringify(eventRequest, null, 2), | ||||
|         contentType: "application/json" | ||||
|     }).done(function(data){ | ||||
|         console.log(data); | ||||
|         historyJson = data; | ||||
|     }); | ||||
| } | ||||
|  | ||||
| const startSearch = function(){ | ||||
|     searchHistory(); | ||||
| } | ||||
| $('#btn-searchHistory').click(startSearch); | ||||
		Reference in New Issue
	
	Block a user