Refactor of History module #184

Merged
bema merged 25 commits from widlam/refactor/issue#162 into master 2023-05-19 13:10:48 +02:00
Showing only changes of commit 585067bc5f - Show all commits

View File

@@ -88,10 +88,13 @@ async function formatJSON(json) {
var result = await fetch(request).then(response => {
return response.text().then(function (text) {
return JSON.parse(text);
var json = JSON.parse(text);
json.status = response.status;
return json;
});
});
console.log(result);
return result;
}
@@ -127,8 +130,14 @@ function showRequestBody(element){
switch(historyJson[element.id].headers["content-type"]){
case "application/json":{
formatJSON(historyRequestBody).then(function(result) {
popupContent.innerText = result.data;
highlightSyntax('code-highlight-content');
if (result.status == "200") {
popupContent.innerText = result.data;
highlightSyntax('code-highlight-content');
}
else {
popupContent.innerText = historyRequestBody;
}
});
break;
}