T139 Filter switch removed

This commit is contained in:
2021-03-18 16:20:10 +01:00
parent a1ff300c8c
commit 8d3fc63777
6 changed files with 2 additions and 80 deletions

View File

@@ -279,13 +279,9 @@ input:focus {
} }
#historyFunction { #historyFunction {
margin-top: 10px; margin-top: 30px;
margin-bottom: 30px; margin-bottom: 30px;
width: 670px; width: 670px;
display: none;
}
#historyFunction.active {
display: flex; display: flex;
align-content: space-between; align-content: space-between;
} }
@@ -306,23 +302,5 @@ input:focus {
margin-right: 15px; margin-right: 15px;
} }
#historyFilterSwitch {
width: 100%;
font-size: 18px;
cursor: pointer;
border: 0;
padding: 0;
background: 0;
outline: 0;
text-align: left;
margin-top: 30px;
margin-bottom: 30px;
margin-left: 15px;
}
#historyFilterSwitch:hover {
color: orange;
}

View File

@@ -91,7 +91,6 @@
</table> </table>
</div> </div>
<div id="history" style="display:none;"> <div id="history" style="display:none;">
<button id="historyFilterSwitch">>Filters</button>
<div id="historyFunction"> <div id="historyFunction">
<div> <div>
<label for="historyFrom">From</label> <label for="historyFrom">From</label>

View File

@@ -1,10 +1,5 @@
var historyJson = {}; var historyJson = {};
const maxIterations = 30; const maxIterations = 30;
var filters = false;
var defaultTo = new Date();
defaultTo.setDate(defaultTo.getDate + 1);
var defaultFrom = new Date();
defaultFrom.setDate(defaultFrom.getDate - 30);
function filterHistory(){ function filterHistory(){
var dateFrom = $('#historyFrom').val(); var dateFrom = $('#historyFrom').val();
@@ -17,10 +12,6 @@ const startSearch = function(){
} }
$('#btn-searchHistory').click(startSearch); $('#btn-searchHistory').click(startSearch);
const filterSwitch = function(){
$('#historyFunction').toggleClass("active");
}
$('#historyFilterSwitch').click(filterSwitch); $('#historyFilterSwitch').click(filterSwitch);
function loadHistory(dateFrom, dateTo){ function loadHistory(dateFrom, dateTo){
@@ -37,14 +28,12 @@ function loadHistory(dateFrom, dateTo){
data: JSON.stringify(eventRequest, null, 2), data: JSON.stringify(eventRequest, null, 2),
contentType: "application/json" contentType: "application/json"
}).done(function(data){ }).done(function(data){
// TODO: Add display function
historyJson = data; historyJson = data;
displayHistory(); displayHistory();
}); });
} }
function historyToHtml(){ function historyToHtml(){
console.log('generating history');
var innerHTML = ''; var innerHTML = '';
var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations; var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations;
for(let i=0; i<iterations; i++){ for(let i=0; i<iterations; i++){
@@ -53,14 +42,9 @@ function historyToHtml(){
'<td>' + historyJson[i].interfaceName + '</td>' + '<td>' + historyJson[i].interfaceName + '</td>' +
'</tr>'; '</tr>';
} }
console.log('history generated');
return innerHTML; return innerHTML;
} }
const displayHistory = function(){ const displayHistory = function(){
console.log('Setting history...');
$('#historyTable tbody').html(historyToHtml()); $('#historyTable tbody').html(historyToHtml());
console.log('History set');
} }
$(document).ready(loadHistory(defaultFrom, defaultTo));

View File

@@ -279,13 +279,9 @@ input:focus {
} }
#historyFunction { #historyFunction {
margin-top: 10px; margin-top: 30px;
margin-bottom: 30px; margin-bottom: 30px;
width: 670px; width: 670px;
display: none;
}
#historyFunction.active {
display: flex; display: flex;
align-content: space-between; align-content: space-between;
} }
@@ -306,23 +302,5 @@ input:focus {
margin-right: 15px; margin-right: 15px;
} }
#historyFilterSwitch {
width: 100%;
font-size: 18px;
cursor: pointer;
border: 0;
padding: 0;
background: 0;
outline: 0;
text-align: left;
margin-top: 30px;
margin-bottom: 30px;
margin-left: 15px;
}
#historyFilterSwitch:hover {
color: orange;
}

View File

@@ -91,7 +91,6 @@
</table> </table>
</div> </div>
<div id="history" style="display:none;"> <div id="history" style="display:none;">
<button id="historyFilterSwitch">>Filters</button>
<div id="historyFunction"> <div id="historyFunction">
<div> <div>
<label for="historyFrom">From</label> <label for="historyFrom">From</label>

View File

@@ -1,10 +1,5 @@
var historyJson = {}; var historyJson = {};
const maxIterations = 30; const maxIterations = 30;
var filters = false;
var defaultTo = new Date();
defaultTo.setDate(defaultTo.getDate + 1);
var defaultFrom = new Date();
defaultFrom.setDate(defaultFrom.getDate - 30);
function filterHistory(){ function filterHistory(){
var dateFrom = $('#historyFrom').val(); var dateFrom = $('#historyFrom').val();
@@ -17,10 +12,6 @@ const startSearch = function(){
} }
$('#btn-searchHistory').click(startSearch); $('#btn-searchHistory').click(startSearch);
const filterSwitch = function(){
$('#historyFunction').toggleClass("active");
}
$('#historyFilterSwitch').click(filterSwitch); $('#historyFilterSwitch').click(filterSwitch);
function loadHistory(dateFrom, dateTo){ function loadHistory(dateFrom, dateTo){
@@ -37,14 +28,12 @@ function loadHistory(dateFrom, dateTo){
data: JSON.stringify(eventRequest, null, 2), data: JSON.stringify(eventRequest, null, 2),
contentType: "application/json" contentType: "application/json"
}).done(function(data){ }).done(function(data){
// TODO: Add display function
historyJson = data; historyJson = data;
displayHistory(); displayHistory();
}); });
} }
function historyToHtml(){ function historyToHtml(){
console.log('generating history');
var innerHTML = ''; var innerHTML = '';
var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations; var iterations = historyJson.length <= maxIterations ? historyJson.length : maxIterations;
for(let i=0; i<iterations; i++){ for(let i=0; i<iterations; i++){
@@ -53,14 +42,9 @@ function historyToHtml(){
'<td>' + historyJson[i].interfaceName + '</td>' + '<td>' + historyJson[i].interfaceName + '</td>' +
'</tr>'; '</tr>';
} }
console.log('history generated');
return innerHTML; return innerHTML;
} }
const displayHistory = function(){ const displayHistory = function(){
console.log('Setting history...');
$('#historyTable tbody').html(historyToHtml()); $('#historyTable tbody').html(historyToHtml());
console.log('History set');
} }
$(document).ready(loadHistory(defaultFrom, defaultTo));