mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
fix(webui): hide v4l2 if not available (#782)
* fix(webui): hide v4l2 if not available * Whups
This commit is contained in:
parent
884c68b239
commit
e79615534c
@ -3,6 +3,7 @@ $(document).ready( function() {
|
|||||||
var conf_editor_v4l2 = null;
|
var conf_editor_v4l2 = null;
|
||||||
var conf_editor_fg = null;
|
var conf_editor_fg = null;
|
||||||
var conf_editor_instCapt = null;
|
var conf_editor_instCapt = null;
|
||||||
|
var V4L2_AVAIL = window.serverInfo.grabbers.available.includes("v4l2");
|
||||||
|
|
||||||
// Dynamic v4l2 enum schema
|
// Dynamic v4l2 enum schema
|
||||||
var v4l2_dynamic_enum_schema = {
|
var v4l2_dynamic_enum_schema = {
|
||||||
@ -157,15 +158,19 @@ $(document).ready( function() {
|
|||||||
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
||||||
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
||||||
|
|
||||||
// V4L2
|
// V4L2 - hide if not available
|
||||||
|
if(V4L2_AVAIL){
|
||||||
$('#conf_cont').append(createRow('conf_cont_v4l'));
|
$('#conf_cont').append(createRow('conf_cont_v4l'));
|
||||||
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
||||||
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#conf_cont').addClass('row');
|
$('#conf_cont').addClass('row');
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
||||||
|
if(V4L2_AVAIL){
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instance Capture
|
// Instance Capture
|
||||||
@ -194,6 +199,7 @@ $(document).ready( function() {
|
|||||||
requestWriteConfig(conf_editor_fg.getValue());
|
requestWriteConfig(conf_editor_fg.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(V4L2_AVAIL){
|
||||||
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
||||||
grabberV4L2 : window.schema.grabberV4L2
|
grabberV4L2 : window.schema.grabberV4L2
|
||||||
}, true, true);
|
}, true, true);
|
||||||
@ -250,13 +256,16 @@ $(document).ready( function() {
|
|||||||
|
|
||||||
requestWriteConfig(v4l2Options);
|
requestWriteConfig(v4l2Options);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
//create introduction
|
//create introduction
|
||||||
if(window.showOptHelp) {
|
if(window.showOptHelp) {
|
||||||
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
||||||
|
if(V4L2_AVAIL){
|
||||||
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideEl(el) {
|
function hideEl(el) {
|
||||||
|
Loading…
Reference in New Issue
Block a user