test_client: add support for "update_response" notification

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-11-21 08:39:45 -05:00
parent 21a7a4e530
commit 4edad1b7a4
1 changed files with 7 additions and 2 deletions

View File

@ -160,8 +160,8 @@ function update_term(msg) {
let start = '<div id="line' + line_count + '">';
$("#term").append(start + msg + "</div>");
line_count++;
if (line_count >= 50) {
let rm = line_count - 50
if (line_count >= 200) {
let rm = line_count - 200
$("#line" + rm).remove();
}
if ($("#cbxAuto").is(":checked")) {
@ -737,6 +737,11 @@ function handle_power_changed(power_status) {
}
json_rpc.register_method("notify_power_changed", handle_power_changed);
function handle_update_response(response) {
update_term(response.message)
}
json_rpc.register_method("notify_update_response", handle_update_response);
function handle_file_list_changed(file_info) {
// This event fires when a client has either added or removed
// a gcode file.