webui: some editor style tweaks (#234)

* initial support for leddevice options

* fix schema and editor init

* fix led editor labels and schema

* add some led schemas

* led config: insert current values. not yet perfect, but it works

* tune editor style
This commit is contained in:
redPanther 2016-09-10 23:30:05 +02:00 committed by GitHub
parent 8aff421850
commit 82611afa25
6 changed files with 33 additions and 8 deletions

View File

@ -7,7 +7,7 @@
</div> </div>
<hr> <hr>
<div class="col-lg-12"> <div class="col-lg-12">
<div id='editor_holder'></div> <div id='editor_container'></div>
<button id='btn_submit'>Submit (console.log)</button> <button id='btn_submit'>Submit (console.log)</button>
</div> </div>
</div> </div>

View File

@ -45,13 +45,13 @@
<div id="menu_controller" class="tab-pane fade in active" style="padding-top:10px"> <div id="menu_controller" class="tab-pane fade in active" style="padding-top:10px">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading form-group" style="font-size:90%;white-space:nowrap;"> <div class="panel-heading form-group" style="font-size:90%;white-space:nowrap;">
<button id='btn_submit' class="btn btn-success" style="float:right">Save Settings</button>
<label for="leddevices">Controller Type</label> <label for="leddevices">Controller Type</label>
<select id="leddevices" class="form-control" style="color:black;width:auto;margin-left:10px;display:inline-block" /> <select id="leddevices" class="form-control" style="color:black;width:auto;margin-left:10px;display:inline-block" />
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div id="ledDeviceOptions"> <div id="ledDeviceOptions">
<div id='editor_container'></div> <div id='editor_container'></div>
<button id='btn_submit'>Submit (console.log)</button>
</div> </div>

View File

@ -37,17 +37,18 @@ $(hyperion).one("cmd-config-getschema", function(event) {
udpListener = schema.udpListener; udpListener = schema.udpListener;
webConfig = schema.webConfig; webConfig = schema.webConfig;
var element = document.getElementById('editor_holder'); var element = document.getElementById('editor_container');
var general_conf_editor = new JSONEditor(element,{ var general_conf_editor = new JSONEditor(element,{
theme: 'bootstrap3', theme: 'bootstrap3',
iconlib: "fontawesome4",
disable_collapse: 'true', disable_collapse: 'true',
form_name_root: 'sa', form_name_root: 'sa',
disable_edit_json: 'true', disable_edit_json: 'true',
disable_properties: 'true', disable_properties: 'true',
no_additional_properties: 'true', no_additional_properties: 'true',
schema: { schema: {
title:' ', title:'',
properties: { properties: {
/*blackborderdetector, /*blackborderdetector,
color, color,
@ -66,6 +67,12 @@ $(hyperion).one("cmd-config-getschema", function(event) {
} }
}); });
// $('#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();
//Called everytime a Input Field is changed = No need for save button //Called everytime a Input Field is changed = No need for save button
general_conf_editor.off().on('change',function() { general_conf_editor.off().on('change',function() {
console.log(JSON.stringify(general_conf_editor.getValue())); console.log(JSON.stringify(general_conf_editor.getValue()));

View File

@ -30,19 +30,27 @@ $(hyperion).one("cmd-config-getschema", function(event) {
var grabber_conf_editor = new JSONEditor(element,{ var grabber_conf_editor = new JSONEditor(element,{
theme: 'bootstrap3', theme: 'bootstrap3',
iconlib: "fontawesome4",
disable_collapse: 'true', disable_collapse: 'true',
form_name_root: 'sa', form_name_root: 'sa',
disable_edit_json: 'true', disable_edit_json: 'true',
disable_properties: 'true', disable_properties: 'true',
no_additional_properties: 'true', no_additional_properties: 'true',
schema: { schema: {
title:' ', title:'',
properties: { properties: {
schema_framegrabber, schema_framegrabber,
schema_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();
}); });

View File

@ -130,6 +130,7 @@ $(document).ready(function() {
var grabber_conf_editor = new JSONEditor(element,{ var grabber_conf_editor = new JSONEditor(element,{
theme: 'bootstrap3', theme: 'bootstrap3',
iconlib: "fontawesome4",
disable_collapse: 'true', disable_collapse: 'true',
form_name_root: 'sa', form_name_root: 'sa',
disable_edit_json: 'true', disable_edit_json: 'true',
@ -163,6 +164,12 @@ $(document).ready(function() {
grabber_conf_editor.getEditor("root.specificOptions").setValue( values_specific ); grabber_conf_editor.getEditor("root.specificOptions").setValue( values_specific );
}; };
$('#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();
if ($(this).val() == "philipshue") if ($(this).val() == "philipshue")
{ {
$("#huebridge").show(); $("#huebridge").show();

View File

@ -12,8 +12,11 @@
"default": "newdeveloper" "default": "newdeveloper"
}, },
"lightIds": { "lightIds": {
"type": "integer", "type": "array",
"title":"Light ids" "title":"Light ids",
"items": {
"type" : "integer"
}
}, },
"transitiontime": { "transitiontime": {
"type": "integer", "type": "integer",