diff --git a/app.js b/app.js index 15a7c00691799c0488be07204433609c24f38bf5..a0257d733ec9ee11cba67f30586837adcbd8f2ad 100644 --- a/app.js +++ b/app.js @@ -157,13 +157,21 @@ function checkButtonStatus() { let datas = {}; function renderData() { - let html = "<table><tr><th>Data</th><th>Count</th>"; + let html = "<table><tr><th>Data</th><th>Count</th><th>Buttons</th></tr>"; const keys = Object.keys(datas); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const val = datas[key]; - html += `<tr><td>${key}</td><td>${val}</td></tr>`; + let buttons = []; + for (let i = 0; i < Object.keys(qr).length; i++) { + const k = Object.keys(qr)[i]; + if (qr[k]) { + buttons.push(k); + } + } + + html += `<tr><td>${key}</td><td>${val}</td><td>${buttons}</td></tr>`; } html += "</table>";