mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
New JSON Editor
This commit is contained in:
parent
4f5892bb72
commit
7009aa50ed
@ -7,7 +7,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<form id="generalConfForm"></form>
|
<!--<form id="generalConfForm"></form>-->
|
||||||
|
<div id='editor_holder'></div>
|
||||||
|
<button id='submit'>Submit (console.log)</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -38,8 +40,35 @@
|
|||||||
udpListener = JSON.parse(response.data).result.properties.udpListener;
|
udpListener = JSON.parse(response.data).result.properties.udpListener;
|
||||||
webConfig = JSON.parse(response.data).result.properties.webConfig;
|
webConfig = JSON.parse(response.data).result.properties.webConfig;
|
||||||
|
|
||||||
|
var element = document.getElementById('editor_holder');
|
||||||
|
//JSONEditor.defaults.options.theme = 'bootstrap3';
|
||||||
|
var editor = new JSONEditor(element,{
|
||||||
|
theme: 'bootstrap3',
|
||||||
|
disable_collapse: 'true',
|
||||||
|
form_name_root: 'sa',
|
||||||
|
disable_edit_json: 'true',
|
||||||
|
disable_properties: 'true',
|
||||||
|
no_additional_properties: 'true',
|
||||||
|
schema: {
|
||||||
|
title:' ',
|
||||||
|
properties: {
|
||||||
|
logger,
|
||||||
|
jsonServer,
|
||||||
|
protoServer,
|
||||||
|
boblightServer,
|
||||||
|
udpListener,
|
||||||
|
webConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('form').jsonForm({
|
document.getElementById('submit').addEventListener('click',function() {
|
||||||
|
// Get the value from the editor
|
||||||
|
console.log(editor.getValue());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*$('form').jsonForm({
|
||||||
schema: {
|
schema: {
|
||||||
logger,
|
logger,
|
||||||
jsonServer,
|
jsonServer,
|
||||||
@ -57,7 +86,7 @@
|
|||||||
console.log(values);
|
console.log(values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
<script src="js/lib/underscore.js"></script>
|
<script src="js/lib/underscore.js"></script>
|
||||||
<script src="js/lib/jsonform.js"></script>
|
<script src="js/lib/jsonform.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="js/lib/jsoneditor.min.js"></script>
|
||||||
|
|
||||||
<!--Language Support -->
|
<!--Language Support -->
|
||||||
<script src="js/lib/jquery-lang.js" charset="utf-8" type="text/javascript"></script>
|
<script src="js/lib/jquery-lang.js" charset="utf-8" type="text/javascript"></script>
|
||||||
<script src="js/lib/js.cookie.js"></script>
|
<script src="js/lib/js.cookie.js"></script>
|
||||||
|
859
assets/webconfig/js/lib/jsoneditor.min.js
vendored
Normal file
859
assets/webconfig/js/lib/jsoneditor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/webconfig/js/lib/jsoneditor.min.js.map
Normal file
1
assets/webconfig/js/lib/jsoneditor.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -11,6 +11,7 @@
|
|||||||
{
|
{
|
||||||
"level" :
|
"level" :
|
||||||
{
|
{
|
||||||
|
"type" : "string",
|
||||||
"enum" : ["silent", "warn", "verbose", "debug"],
|
"enum" : ["silent", "warn", "verbose", "debug"],
|
||||||
"title" : "Log-Level"
|
"title" : "Log-Level"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user