The debug log shows the 1024 last characters printed by the esp-link software itself to - its own debug log.
- ++ Refresh +
++ The debug log shows the 1024 last characters printed by the esp-link software itself to + its own debug log. +
+diff --git a/html/console.js b/html/console.js index 4205738..355c797 100644 --- a/html/console.js +++ b/html/console.js @@ -1,11 +1,16 @@ -function fetchText(delay) { +function fetchText(delay, repeat) { el = $("#console"); if (el.textEnd == undefined) { el.textEnd = 0; el.innerHTML = ""; } window.setTimeout(function() { - ajaxJson('GET', console_url + "?start=" + el.textEnd, updateText, retryLoad); + ajaxJson('GET', console_url + "?start=" + el.textEnd, + function(resp) { + var dly = updateText(resp); + if (repeat) fetchText(dly, repeat); + }, + function() { retryLoad(repeat); }); }, delay); } @@ -22,9 +27,9 @@ function updateText(resp) { el.textEnd = resp.start + resp.len; delay = 500; } - fetchText(delay); + return delay; } -function retryLoad() { - fetchText(1000); +function retryLoad(repeat) { + fetchText(1000, repeat); } diff --git a/html/console.tpl b/html/console.tpl index 2486b9f..e45bb63 100644 --- a/html/console.tpl +++ b/html/console.tpl @@ -34,7 +34,7 @@ } window.onload = function() { - fetchText(100); + fetchText(100, true); $("#reset-button").addEventListener("click", function(e) { e.preventDefault(); diff --git a/html/log.tpl b/html/log.tpl index d72d368..3003168 100644 --- a/html/log.tpl +++ b/html/log.tpl @@ -4,9 +4,18 @@
The debug log shows the 1024 last characters printed by the esp-link software itself to - its own debug log.
- ++ Refresh +
++ The debug log shows the 1024 last characters printed by the esp-link software itself to + its own debug log. +
+