1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

#60: avoid errors in the web ui when the rx fifo overflows (strange counter ids), add an error log for serial errors

This commit is contained in:
andreas
2024-03-22 18:57:43 +01:00
parent 41b629e17b
commit f99d6ed2eb
4 changed files with 29 additions and 7 deletions

View File

@@ -346,11 +346,15 @@ function createCounterDisplay(parent,label,key,isEven){
}
});
}
function validKey(key){
if (! key) return;
return key.replace(/[^a-z_:A-Z0-9-]/g,'');
}
function updateMsgDetails(key, details) {
forEl('.msgDetails', function (frame) {
if (frame.getAttribute('id') !== key) return;
for (let k in details) {
k=validKey(k);
let el = frame.querySelector("[data-id=\"" + k + "\"] ");
if (!el) {
el = addEl('div', 'row', frame);