2016-09-07 20:10:37 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
function removeAdvanced(obj,searchStack)
|
|
|
|
{
|
|
|
|
searchStack = [];
|
|
|
|
$.each(obj, function(key, val) {
|
|
|
|
if ( typeof(val) == 'object' )
|
|
|
|
{
|
|
|
|
searchStack.push(key);
|
|
|
|
if (! removeAdvanced(val,searchStack) )
|
|
|
|
searchStack.pop();
|
|
|
|
}
|
|
|
|
else if ( key == "advanced" && val == true )
|
|
|
|
{
|
|
|
|
console.log(searchStack);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
$(hyperion).one("cmd-config-getschema", function(event) {
|
|
|
|
parsedConfSchemaJSON = event.response.result;
|
|
|
|
schema = parsedConfSchemaJSON.properties;
|
|
|
|
schema_framegrabber = schema.framegrabber;
|
|
|
|
schema_grabberv4l2 = schema["grabber-v4l2"];
|
|
|
|
|
|
|
|
var element = document.getElementById('editor_container');
|
|
|
|
|
|
|
|
var grabber_conf_editor = new JSONEditor(element,{
|
|
|
|
theme: 'bootstrap3',
|
2016-09-10 23:30:05 +02:00
|
|
|
iconlib: "fontawesome4",
|
2016-09-07 20:10:37 +02:00
|
|
|
disable_collapse: 'true',
|
|
|
|
form_name_root: 'sa',
|
|
|
|
disable_edit_json: 'true',
|
|
|
|
disable_properties: 'true',
|
|
|
|
no_additional_properties: 'true',
|
|
|
|
schema: {
|
2016-09-10 23:30:05 +02:00
|
|
|
title:'',
|
2016-09-07 20:10:37 +02:00
|
|
|
properties: {
|
|
|
|
schema_framegrabber,
|
|
|
|
schema_grabberv4l2,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2016-09-10 23:30:05 +02:00
|
|
|
|
|
|
|
$('#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();
|
|
|
|
|
2016-09-07 20:10:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready( function() {
|
|
|
|
requestServerConfigSchema();
|
|
|
|
|
2016-09-10 19:08:08 +02:00
|
|
|
document.getElementById('btn_submit').addEventListener('click',function() {
|
2016-09-07 20:10:37 +02:00
|
|
|
// Get the value from the editor
|
|
|
|
//console.log(general_conf_editor.getValue());
|
|
|
|
});
|
|
|
|
// $("[type='checkbox']").bootstrapSwitch();
|
|
|
|
});
|
|
|
|
|