From 4fd0116a0d4a27c95091c46c29db24df6490e5e4 Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Thu, 26 Aug 2021 19:12:30 +0200 Subject: [PATCH] Stringify objects on dashboard to avoid [Object object] --- http-ui/public/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/http-ui/public/script.js b/http-ui/public/script.js index b621cd453..e4de86672 100644 --- a/http-ui/public/script.js +++ b/http-ui/public/script.js @@ -60,7 +60,13 @@ $('#query, #filters').on('input', function () { const content = document.createElement('div'); content.classList.add("content"); - content.innerHTML = element[prop]; + + // Stringify Objects and Arrays to avoid [Object object] + if (typeof element[prop] === 'object' && element[prop] !== null) { + content.innerHTML = JSON.stringify(element[prop]); + } else { + content.innerHTML = element[prop]; + } field.appendChild(attribute); field.appendChild(content);