mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Webui: extend led hardware config + connection lost page (#226)
* split content and js tune leds config * implement connection lost page * split js/html in huebridge * add js action for connection lost * extend led config make connection loss nicer * tune led code add menu entry for grabber * more tuning of webui * switch back to botstrap textarea add v4l to components * add icon * extend schema for jsoneditor * implement ledcolors streaming with 4fps * implement component state
This commit is contained in:
58
assets/webconfig/js/content_grabber.js
Normal file
58
assets/webconfig/js/content_grabber.js
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
/*
|
||||
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',
|
||||
disable_collapse: 'true',
|
||||
form_name_root: 'sa',
|
||||
disable_edit_json: 'true',
|
||||
disable_properties: 'true',
|
||||
no_additional_properties: 'true',
|
||||
schema: {
|
||||
title:' ',
|
||||
properties: {
|
||||
schema_framegrabber,
|
||||
schema_grabberv4l2,
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready( function() {
|
||||
requestServerConfigSchema();
|
||||
|
||||
document.getElementById('submit').addEventListener('click',function() {
|
||||
// Get the value from the editor
|
||||
//console.log(general_conf_editor.getValue());
|
||||
});
|
||||
// $("[type='checkbox']").bootstrapSwitch();
|
||||
});
|
||||
|
Reference in New Issue
Block a user