webui: add read/write for all editors (#268)

This commit is contained in:
redPanther
2016-10-10 23:15:50 +02:00
committed by GitHub
parent 37558a983f
commit 102fd611fa
13 changed files with 84 additions and 147 deletions

View File

@@ -2,33 +2,20 @@
var conf_editor = null;
$(hyperion).one("cmd-config-getschema", function(event) {
parsedConfSchemaJSON = event.response.result;
schema = parsedConfSchemaJSON.properties;
conf_editor = createJsonEditor('editor_container', {
framegrabber: schema.framegrabber,
grabberV4L2 : schema.grabberV4L2
}, true);
conf_editor = createJsonEditor('editor_container',
{
title:'',
properties: {
framegrabber: schema.framegrabber,
grabberV4L2 : schema.grabberV4L2
}
});
$('#editor_container .well').css("background-color","white");
$('#editor_container .well').css("border","none");
$('#editor_container .well').css("box-shadow","none");
$('#editor_container .btn').addClass("btn-primary");
$('#editor_container h3').first().remove();
$('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue());
});
});
$(document).ready( function() {
requestServerConfigSchema();
document.getElementById('btn_submit').addEventListener('click',function() {
// Get the value from the editor
console.log(conf_editor.getValue());
});
});