web: print log message only if available
This commit is contained in:
parent
61bd2f41c7
commit
c0b7c2b5fd
@ -22,7 +22,9 @@
|
||||
var source = new EventSource("/log");
|
||||
source.onmessage = function(event) {
|
||||
var j = JSON.parse(event.data);
|
||||
document.getElementById("log").innerHTML += j.message + "<br>";
|
||||
if (j.hasOwnProperty('message')) {
|
||||
document.getElementById("log").innerHTML += j.message + "<br>";
|
||||
}
|
||||
};
|
||||
} else {
|
||||
document.getElementById("log").innerHTML = "Sorry, your browser does not support server-sent events...";
|
||||
|
Loading…
Reference in New Issue
Block a user