T157 Multiple messages loaded
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
|
||||
var json;
|
||||
function getData(uuid){
|
||||
$.getJSON('http://localhost:8097/mock/json', function(json) {
|
||||
fillMessageList(json);
|
||||
$.getJSON('http://localhost:8097/mock/json', function(data) {
|
||||
json = data;
|
||||
fillMessageList();
|
||||
initializeMock(json, 0)
|
||||
});
|
||||
}
|
||||
@@ -60,13 +61,16 @@ function generateHeaderTable(headers){
|
||||
return innerHTML;
|
||||
}
|
||||
|
||||
function fillMessageList(json){
|
||||
var innerHTML = generateMessageTileHtml(json[0].mockedResponseId, json[0].httpStatus, json[0].mediaType);
|
||||
function fillMessageList(){
|
||||
var innerHTML = '';
|
||||
for(let i=0; i<json.length; i++){
|
||||
innerHTML += generateMessageTileHtml(json[i].mockedResponseId, json[i].httpStatus, json[i].mediaType);
|
||||
}
|
||||
$("#listItems").append(innerHTML);
|
||||
}
|
||||
|
||||
function generateMessageTileHtml(id, httpStatus, mediaType){
|
||||
var innerHTML = '<div class="menuItem">' +
|
||||
var innerHTML = '<div class="menuItem" id="item' + id + '">' +
|
||||
'<table><tr><td>Id: '+ id +'</td></tr>' +
|
||||
// '<tr><td>Content-type: '+mediaType+'</td></tr>' +
|
||||
'<tr><td>Http-status: '+ httpStatus +'</td></tr>' +
|
||||
|
||||
Reference in New Issue
Block a user