diff --git a/public/results.html b/public/results.html index a490530ddfa9443cce5e88b89d6f6e157687f94b..6bbdfac783fd49960457cd847a16b4ac05ee74d8 100644 --- a/public/results.html +++ b/public/results.html @@ -59,7 +59,8 @@ const grpcJsonData = data["grpc"]; document.getElementById('results').replaceChildren(jsonToTable("REST", restJsonData)); document.getElementById('results').appendChild(jsonToTable("gRPC", grpcJsonData)); - document.getElementById('messages').replaceChildren(concatAllMessages(restJsonData, grpcJsonData)); + document.getElementById('messages').replaceChildren(concatAllMessages("REST", restJsonData)); + document.getElementById('messages').appendChild(concatAllMessages("gRPC", grpcJsonData)); } catch (e) { console.error(e); } @@ -98,16 +99,18 @@ return div; } - function concatAllMessages(...jsonData) { + function concatAllMessages(title, jsonData) { const div = document.createElement('div'); - for (const data of jsonData) { - for (const [k, v] of Object.entries(data)) { - const p = document.createElement('p'); - p.textContent = `${k}: ${v["message"]}`; - p.className = v["ok"] ? 'success' : 'fail'; - div.appendChild(p); - } + const h = document.createElement('h2'); + h.textContent = title; + div.appendChild(h); + for (const [k, v] of Object.entries(jsonData)) { + const p = document.createElement('p'); + p.textContent = `${k}: ${v["message"]}`; + p.className = v["ok"] ? 'success' : 'fail'; + div.appendChild(p); } + return div; }