Refactor of History module #184
93
Frontend/assets/css/tools/mock/r11popup.css
Normal file
93
Frontend/assets/css/tools/mock/r11popup.css
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
.popup-flex:not(.hiddable-container){
|
||||||
|
animation: blur 0.5s ease-in-out ;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
.popup-flex:has(.hiddable-container){
|
||||||
|
animation: deblur 0.3s ease-in-out ;
|
||||||
|
animation-direction: reverse;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
.popup-flex{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 50;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2%;
|
||||||
|
position: fixed;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-body{
|
||||||
|
min-width: 33%;
|
||||||
|
background-color: white;
|
||||||
|
box-shadow: 10px 10px 5px lightblue;
|
||||||
|
min-height: 45%;
|
||||||
|
border-radius: 1em;
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px 15px 15px 15px;
|
||||||
|
color: black;
|
||||||
|
border: 1px #2A93B0 solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-button-close-container{
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 2%;
|
||||||
|
margin-top: 1%;
|
||||||
|
font-size: xx-large;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-button-close{
|
||||||
|
background: padding-box;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-button-close:hover{
|
||||||
|
color: #2A93B0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hiddable-container{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#header-table tr td {
|
||||||
|
border: 1px black solid;
|
||||||
|
padding: 1%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header-table{
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blur {
|
||||||
|
0% {
|
||||||
|
backdrop-filter: blur(0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes deblur {
|
||||||
|
0%{
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
backdrop-filter: blur(0px);
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -470,7 +470,7 @@ function selectMessage(id){
|
|||||||
$('.tile[tileid="'+id+'"]').addClass("active");
|
$('.tile[tileid="'+id+'"]').addClass("active");
|
||||||
|
|
||||||
initializeHistory();
|
initializeHistory();
|
||||||
refreshHeaderTable(innerHTML);
|
refreshHeaderTable(document.innerHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ function loadHistory(dateFrom, dateTo){
|
|||||||
contentType: "application/json"
|
contentType: "application/json"
|
||||||
}).done(function(data){
|
}).done(function(data){
|
||||||
historyJson = data;
|
historyJson = data;
|
||||||
console.log(data);
|
|
||||||
displayHistory();
|
displayHistory();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -37,7 +36,6 @@ function loadHistory(dateFrom, dateTo){
|
|||||||
function getLast24hHistoryData(){
|
function getLast24hHistoryData(){
|
||||||
$.getJSON(host + '/api/event/' + clientUUID + '/' + lastId, function(data){
|
$.getJSON(host + '/api/event/' + clientUUID + '/' + lastId, function(data){
|
||||||
historyJson = data;
|
historyJson = data;
|
||||||
console.log(data);
|
|
||||||
displayHistory();
|
displayHistory();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -51,27 +49,18 @@ function historyToHtml(){
|
|||||||
'<td>' + historyJson[i].dateTimeStamp + '</td>' +
|
'<td>' + historyJson[i].dateTimeStamp + '</td>' +
|
||||||
'<td>' + historyJson[i].httpMethod + '</td>' +
|
'<td>' + historyJson[i].httpMethod + '</td>' +
|
||||||
'<td>' + historyJson[i].requestBody + '</td>' +
|
'<td>' + historyJson[i].requestBody + '</td>' +
|
||||||
'<td>' +
|
'<td> <button id="'+i+'" class="showHeaderButton" onClick="showHeadersHistory(this);"> Show headers </button> </td>' +
|
||||||
'<th> Header Name </th>' +
|
|
||||||
'<th> Header Value </th>' +
|
|
||||||
historyJson[i].headers.forEach(
|
|
||||||
|
|
||||||
)
|
|
||||||
+ '</td>'
|
|
||||||
'<td>' + parseHeaders(historyJson[i].headers) + '</td>' +
|
|
||||||
'</tr>';
|
'</tr>';
|
||||||
}
|
}
|
||||||
return innerHTML;
|
return innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseHeaders(json){
|
function parseHeaders(pos){
|
||||||
console.log(json);
|
parsedJson = new Map();
|
||||||
parsedJson = "";
|
headers = historyJson[pos].headers
|
||||||
Object.keys( json ).forEach(
|
Object.keys( headers ).forEach(
|
||||||
(key) => {
|
(jsonKey) => {
|
||||||
console.log(key);
|
parsedJson.set( jsonKey , headers[jsonKey] );
|
||||||
console.log(json.key)
|
|
||||||
parsedJson += key + " : " + json[key] + "\n";
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return parsedJson;
|
return parsedJson;
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ const historyFilterSwitch = function(){
|
|||||||
$("#optional").click(changeAdvancedVisibility);
|
$("#optional").click(changeAdvancedVisibility);
|
||||||
$('#historyTab').click(showHistory);
|
$('#historyTab').click(showHistory);
|
||||||
$('#btn-history-filter').click(historyFilterSwitch);
|
$('#btn-history-filter').click(historyFilterSwitch);
|
||||||
|
$('.popup-button-close').click(
|
||||||
|
() => {
|
||||||
|
$('.popup-flex').addClass('hiddable-container');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const tabitem = $('.tabitem');
|
const tabitem = $('.tabitem');
|
||||||
@@ -52,8 +56,6 @@ function initializeHistory(){
|
|||||||
getLast24hHistoryData();
|
getLast24hHistoryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function showHeaders(){
|
function showHeaders(){
|
||||||
$('#historyTab').click(showHistory);
|
$('#historyTab').click(showHistory);
|
||||||
tabitem.removeClass('active');
|
tabitem.removeClass('active');
|
||||||
@@ -63,6 +65,23 @@ function showHeaders(){
|
|||||||
$('#headersTab').off('click');
|
$('#headersTab').off('click');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showHeadersHistory(element){
|
||||||
|
historyTable = '';
|
||||||
|
headers = parseHeaders(element.id)
|
||||||
|
headers.forEach(
|
||||||
|
(value,key) => {
|
||||||
|
historyTable +=
|
||||||
|
'<tr>' +
|
||||||
|
'<td>'+ key + '</td>' +
|
||||||
|
'<td>'+ value + '</td>' +
|
||||||
|
'</tr>'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$('.popup-flex').removeClass('hiddable-container');
|
||||||
|
document.getElementById('header-history-table-body').innerHTML = historyTable;
|
||||||
|
}
|
||||||
|
|
||||||
function focusInTip(element){
|
function focusInTip(element){
|
||||||
showTip(element);
|
showTip(element);
|
||||||
focusedField = true;
|
focusedField = true;
|
||||||
|
|||||||
@@ -6,9 +6,35 @@
|
|||||||
<link rel="stylesheet" href="../assets/css/tools/mock/fontello.css" type="text/css">
|
<link rel="stylesheet" href="../assets/css/tools/mock/fontello.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../assets/css/tools/mock/main.css" type="text/css">
|
<link rel="stylesheet" href="../assets/css/tools/mock/main.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../assets/css/tools/mock/common.css" type="text/css">
|
<link rel="stylesheet" href="../assets/css/tools/mock/common.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../assets/css/tools/mock/r11popup.css" type="text/css">
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="popup-flex hiddable-container">
|
||||||
|
<div class="popup-body">
|
||||||
|
<div class="popup-button-close-container">
|
||||||
|
<button type="button" class="popup-button-close"> X </button>
|
||||||
|
</div>
|
||||||
|
<div class="popup-header-table">
|
||||||
|
<table id="header-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Header Name
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th>
|
||||||
|
Header Value
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="header-history-table-body">
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="tool extended">
|
<div class="tool extended">
|
||||||
<div class="tool-context">
|
<div class="tool-context">
|
||||||
@@ -151,7 +177,7 @@
|
|||||||
<th>Timestamp</th>
|
<th>Timestamp</th>
|
||||||
<th>Method</th>
|
<th>Method</th>
|
||||||
<th>Request Body</th>
|
<th>Request Body</th>
|
||||||
<th>Request Headers</th>
|
<th>Headers</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user