Reduced JSON buffer by 1k.

Increased max RAM FX usage on ESP32 to 20k.
Added relay On handling on realtime data if Off (@JDTSmith).
Added UI refreshing via websockets (@korkbaum).
This commit is contained in:
Blaz Kristan
2021-03-18 23:19:17 +01:00
parent e6a99c1d33
commit c59e792178
7 changed files with 832 additions and 821 deletions

View File

@@ -210,6 +210,12 @@ function onLoad()
sl.addEventListener('touchstart', toggleBubble);
sl.addEventListener('touchend', toggleBubble);
}
// Creatte UI update WS handler
var mySocket = new WebSocket('ws://'+loc?locip:window.location.hostname+'/ws');
mySocket.onmessage = function(event) {
requestJson({'v':true},false);
}
}
function updateTablinks(tabI)
@@ -960,8 +966,10 @@ function requestJson(command, rinfo = true, verbose = true, callback = null)
{
d.getElementById('connind').style.backgroundColor = "#a90";
lastUpdate = new Date();
/*
if (refreshTimer) clearTimeout(refreshTimer);
refreshTimer = setTimeout(function(){requestJson({'v':true},false);},15000);
*/
if (!jsonTimeout) jsonTimeout = setTimeout(showErrorToast, 3000);
var req = null;
var e1 = d.getElementById('fxlist');