Refactor websocket + true receive (#471)

* save it

* ws: multiframe receive now works

* port cfg write with autocorrect to jsonprocessor
cleanup

* cleanup

* cleanup

* add support for image data over ws binary frame
This commit is contained in:
redPanther
2017-09-16 09:08:21 +02:00
committed by GitHub
parent 74ff5c7ada
commit 6f443a48dd
9 changed files with 361 additions and 226 deletions

View File

@@ -421,7 +421,6 @@ $(document).ready(function() {
aceEdt.set(finalLedArray);
$('#collapse4').collapse('show');
});
// create and update editor

View File

@@ -97,6 +97,7 @@ function initWebSocket()
case 1015: reason = "The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."; break;
default: reason = "Unknown reason";
}
console.log("[websocket::onclose] "+reason)
$(hyperion).trigger({type:"close", reason:reason});
watchdog = 10;
connectionLostDetection();
@@ -262,15 +263,7 @@ function requestWriteConfig(config, full)
});
}
var config_str = escape(encode_utf8(JSON.stringify(serverConfig)));
$.post( "/cgi/cfg_set", { cfg: config_str })
.done(function( data ) {
$("html, body").animate({ scrollTop: 0 }, "slow");
})
.fail(function() {
showInfoDialog('error', $.i18n('infoDialog_writeconf_error_title'), $.i18n('infoDialog_writeconf_error_text'));
});
sendToHyperion("config","setconfig", '"config":'+JSON.stringify(serverConfig));
}
function requestWriteEffect(effectName,effectPy,effectArgs)