From 519c3a8df3e9efb16cec98f100a0d7ad2acd2679 Mon Sep 17 00:00:00 2001 From: Your Name <10572974+eraiza0816@users.noreply.github.com> Date: Fri, 10 Jul 2026 13:09:41 +0900 Subject: [PATCH] fix: rename local variable to avoid shadowing global translation function --- html/stat.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/html/stat.js b/html/stat.js index 3776531..2709eeb 100644 --- a/html/stat.js +++ b/html/stat.js @@ -114,7 +114,7 @@ function getCounters(port) { const s = JSON.parse(xhttp.responseText); console.log("Counters: ", JSON.stringify(s)); const ptext = document.getElementById('popup_text'); - var t = ""; + var tableHtml = "
" + t('stat_counter') + " " + t('stat_value') + " " + t('stat_counter') + " " + t('stat_value') + "
"; console.log("Counter 0: ", BigInt(s[0]).toString(), " length: ", s.length); var c = 0; for (i = 0; i < mib_counters.length; i += 4) { @@ -125,28 +125,28 @@ function getCounters(port) { } var count = BigInt(s[i/4]); if (mib_counters[i+1] == 8) { - t += ""; + tableHtml += ""; c += 1; } else if (mib_counters[i+1] == 4) { if (mib_counters[i] != "") { - t += ""; + tableHtml += ""; c += 1; } if (c == 2) { - t += ""; + tableHtml += ""; c = 0; } if (mib_counters[i+2] != "") { - t += ""; + tableHtml += ""; c += 1; } } if (c == 2) { - t += ""; + tableHtml += ""; c = 0; } } - ptext.innerHTML = t + "
" + t('stat_counter') + " " + t('stat_value') + " " + t('stat_counter') + " " + t('stat_value') + "
" + mib_counters[i] + "" + count.toString() + "" + mib_counters[i] + "" + count.toString() + "" + mib_counters[i] + "" + (count >> 32n).toString() + "" + mib_counters[i] + "" + (count >> 32n).toString() + "
" + mib_counters[i+2] + "" + (count & 4294967295n).toString() + "" + mib_counters[i+2] + "" + (count & 4294967295n).toString() + "
"; + ptext.innerHTML = tableHtml + ""; popup.style.display = 'flex'; } };