mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Webui save - fix white space writing (#364)
* 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 * fix save issue with white spaces
This commit is contained in:
parent
8a9d2760ef
commit
281b1c8ea5
@ -229,7 +229,7 @@ function requestWriteConfig(config)
|
||||
complete_config[i] = val;
|
||||
});
|
||||
|
||||
var config_str = encode_utf8(JSON.stringify(complete_config));
|
||||
var config_str = escape(encode_utf8(JSON.stringify(complete_config)));
|
||||
|
||||
$.post( "/cgi/cfg_set", { cfg: config_str })
|
||||
.done(function( data ) {
|
||||
|
@ -94,7 +94,7 @@ void CgiHandler::cmd_cfg_set()
|
||||
QJsonParseError error;
|
||||
if (data.contains("cfg"))
|
||||
{
|
||||
QJsonDocument hyperionConfig = QJsonDocument::fromJson(data["cfg"], &error);
|
||||
QJsonDocument hyperionConfig = QJsonDocument::fromJson(QByteArray::fromPercentEncoding(data["cfg"]), &error);
|
||||
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
{
|
||||
@ -103,6 +103,7 @@ void CgiHandler::cmd_cfg_set()
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug(_log, "error while saving: %s", error.errorString()).toLocal8bit.constData());
|
||||
_reply->appendRawData (QString("Error while validating json: "+error.errorString()).toUtf8());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user