mirror of https://github.com/jeelabs/esp-link.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
console_url = "/console/text";
|
|
|
|
onLoad(function() {
|
|
fetchText(100, true);
|
|
|
|
$("#reset-button").addEventListener("click", function(e) {
|
|
e.preventDefault();
|
|
var co = $("#console");
|
|
co.innerHTML = "";
|
|
ajaxSpin('POST', "/console/reset",
|
|
function(resp) { showNotification("uC reset"); co.textEnd = 0; },
|
|
function(s, st) { showWarning("Error resetting uC"); }
|
|
);
|
|
});
|
|
|
|
$("#clear-button").addEventListener("click", function(e) {
|
|
e.preventDefault();
|
|
var co = $("#console");
|
|
co.innerHTML = "";
|
|
});
|
|
|
|
ajaxJson('GET', "/console/baud",
|
|
function(data) { $("#baud-sel").value = data.rate; },
|
|
function(s, st) { showNotification(st); }
|
|
);
|
|
|
|
bnd($("#baud-sel"), "change", function(ev) {
|
|
ev.preventDefault();
|
|
var baud = $("#baud-sel").value;
|
|
ajaxSpin('POST', "/console/baud?rate="+baud,
|
|
function(resp) { showNotification("" + baud + " baud set"); },
|
|
function(s, st) { showWarning("Error setting baud rate: " + st); }
|
|
);
|
|
});
|
|
|
|
consoleSendInit();
|
|
|
|
addClass($('html')[0], "height100");
|
|
addClass($('body')[0], "height100");
|
|
addClass($('#layout'), "height100");
|
|
addClass($('#layout'), "flex-vbox");
|
|
});
|
|
|