2017-02-08 14:36:28 +01:00
|
|
|
$(document).ready( function() {
|
|
|
|
performTranslation();
|
2019-07-18 22:32:06 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
var conf_editor = null;
|
2019-07-18 22:32:06 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_webc_heading_title"), 'editor_container', 'btn_submit'));
|
2019-06-05 18:19:08 +02:00
|
|
|
if(window.showOptHelp)
|
2017-01-17 21:53:35 +01:00
|
|
|
{
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont').append(createHelpTable(window.schema.webConfig.properties, $.i18n("edt_conf_webc_heading_title")));
|
2017-01-17 21:53:35 +01:00
|
|
|
}
|
2019-07-18 22:32:06 +02:00
|
|
|
|
2016-12-08 23:39:41 +01:00
|
|
|
conf_editor = createJsonEditor('editor_container', {
|
2019-06-05 18:19:08 +02:00
|
|
|
webConfig : window.schema.webConfig
|
2017-01-04 10:55:10 +01:00
|
|
|
}, true, true);
|
2016-12-08 23:39:41 +01:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
conf_editor.on('change',function() {
|
|
|
|
conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
2019-07-18 22:32:06 +02:00
|
|
|
});
|
2017-01-17 21:53:35 +01:00
|
|
|
|
2016-12-08 23:39:41 +01:00
|
|
|
$('#btn_submit').off().on('click',function() {
|
2019-07-18 22:32:06 +02:00
|
|
|
// store the last webui port for correct reconnect url (connection_lost.html)
|
|
|
|
var val = conf_editor.getValue();
|
|
|
|
window.fastReconnect = true;
|
|
|
|
window.jsonPort = val.webConfig.port;
|
|
|
|
requestWriteConfig(val);
|
2016-12-08 23:39:41 +01:00
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
if(window.showOptHelp)
|
2017-02-08 14:36:28 +01:00
|
|
|
createHint("intro", $.i18n('conf_webconfig_label_intro'), "editor_container");
|
2019-07-18 22:32:06 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
removeOverlay();
|
2016-12-08 23:39:41 +01:00
|
|
|
});
|