move write config from json api to http post (#363)

* implement config save over http post instead of json

* remove json set config
finish config write thrugh http post

* remove debug code and add failure messages
This commit is contained in:
redPanther
2017-01-14 19:04:58 +01:00
committed by GitHub
parent b2a6366176
commit 8a9d2760ef
17 changed files with 204 additions and 141 deletions

View File

@@ -32,7 +32,7 @@ function initRestart()
function cron()
{
if ( watchdog > 2)
if ( watchdog > 2 )
{
var interval_id = window.setInterval("", 9999); // Get a reference to the last
for (var i = 1; i < interval_id; i++)
@@ -229,8 +229,15 @@ function requestWriteConfig(config)
complete_config[i] = val;
});
var config_str = JSON.stringify(complete_config);
sendToHyperion("config","setconfig", '"config":'+config_str);
var config_str = encode_utf8(JSON.stringify(complete_config));
$.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'));
});
}
function requestWriteEffect(effectName,effectPy,effectArgs)