mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge branch components into mediafoundation
This commit is contained in:
@@ -13,7 +13,6 @@ $(document).ready(function () {
|
||||
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>'
|
||||
instances_html += '</div></div>';
|
||||
|
||||
|
||||
instances_html += '<div class="panel-body">';
|
||||
instances_html += '<table class="table borderless">';
|
||||
instances_html += '<thead><tr><th style="vertical-align:middle"><i class="mdi mdi-lightbulb-on fa-fw"></i>';
|
||||
@@ -40,7 +39,7 @@ $(document).ready(function () {
|
||||
instances_html += '<span>' + $.i18n('dashboard_infobox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
instances_html += '<tbody><tr><td></td>';
|
||||
instances_html += '<td>' + $.i18n('conf_leds_contr_label_contrtype') + '</td>';
|
||||
instances_html += '<td><a onclick="SwitchToMenuItem(\'MenuItemLeds\')" href="#" style="text-decoration:none">' + $.i18n('conf_leds_contr_label_contrtype') + '</a></td>';
|
||||
instances_html += '<td style="text-align:right">' + window.serverConfig.device.type + '</td>';
|
||||
instances_html += '</tr><tr></tbody></table>';
|
||||
|
||||
@@ -50,28 +49,39 @@ $(document).ready(function () {
|
||||
instances_html += '<span>' + $.i18n('dashboard_componentbox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
|
||||
var tab_components = "";
|
||||
var componentBtn = "";
|
||||
var instance_components = "";
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||
const general_comp = "general_comp_" + components[idx].name;
|
||||
var componentBtn = '<input ' +
|
||||
'id="' + general_comp + '" ' + comp_enabled +
|
||||
' type="checkbox" ' +
|
||||
'data-toggle="toggle" ' +
|
||||
'data-size="mini" ' +
|
||||
'data-onstyle="success" ' +
|
||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||
if (components[idx].name === "FORWARDER" && window.currentHyperionInstance != 0)
|
||||
continue;
|
||||
|
||||
tab_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||
|
||||
if ((components[idx].name === "GRABBER" && !window.serverConfig.instCapture.systemEnable) || (components[idx].name === "V4L" && !window.serverConfig.instCapture.v4lEnable))
|
||||
{
|
||||
componentBtn = '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemGrabber\')" href="#" style="text-decoration: none"></a>';
|
||||
} else {
|
||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||
const general_comp = "general_comp_" + components[idx].name;
|
||||
componentBtn = '<input ' +
|
||||
'id="' + general_comp + '" ' + comp_enabled +
|
||||
' type="checkbox" ' +
|
||||
'data-toggle="toggle" ' +
|
||||
'data-size="mini" ' +
|
||||
'data-onstyle="success" ' +
|
||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||
}
|
||||
|
||||
instance_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
instances_html += '<tbody>' + tab_components + '</tbody></table>';
|
||||
instances_html += '<tbody>' + instance_components + '</tbody></table>';
|
||||
instances_html += '</div></div></div>';
|
||||
|
||||
$('.instances').prepend(instances_html);
|
||||
|
||||
updateUiOnInstance(window.currentHyperionInstance);
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
@@ -83,7 +93,7 @@ $(document).ready(function () {
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle();
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable")
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable");
|
||||
$("#general_comp_" + components[idx].name).change(e => {
|
||||
requestSetComponentState(e.currentTarget.id.split('_')[2], e.currentTarget.checked);
|
||||
});
|
||||
@@ -92,6 +102,11 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
// add more info
|
||||
var screenGrabber = window.serverConfig.instCapture.systemEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||
$('#dash_screen_grabber').html(screenGrabber);
|
||||
var videoGrabber = window.serverConfig.instCapture.v4lEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||
$('#dash_video_grabber').html(videoGrabber);
|
||||
|
||||
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
|
||||
$('#dash_fbPort').html(fbPort);
|
||||
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');
|
||||
|
@@ -24,10 +24,10 @@ $(document).ready(function () {
|
||||
}
|
||||
} else {
|
||||
$('#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_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber'));
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', 'panel-system'));
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber', 'panel-system'));
|
||||
if (VIDEOGRABBER_AVAIL) {
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber'));
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber', 'panel-system'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -307,12 +307,17 @@ $(document).ready(function () {
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
$(window).scroll(function(){
|
||||
$(window).scroll(function() {
|
||||
if ($(window).scrollTop() > 65)
|
||||
$("#navbar_brand_logo").css("display", "none");
|
||||
else
|
||||
$("#navbar_brand_logo").css("display", "");
|
||||
});
|
||||
});
|
||||
|
||||
$('#side-menu li a, #side-menu li ul li a').click(function() {
|
||||
$('#side-menu').find('.active').toggleClass('inactive'); // find all active classes and set inactive;
|
||||
$(this).addClass('active');
|
||||
});
|
||||
});
|
||||
|
||||
function suppressDefaultPwWarning() {
|
||||
@@ -349,7 +354,7 @@ $("#btn_darkmode").off().on("click", function (e) {
|
||||
});
|
||||
|
||||
// Menuitem toggle;
|
||||
function SwitchToMenuItem(target) {
|
||||
function SwitchToMenuItem(target, item) {
|
||||
document.getElementById(target).click(); // Get <a href menu item;
|
||||
let sidebar = $('#side-menu'); // Get sidebar menu;
|
||||
sidebar.find('.active').toggleClass('inactive'); // find all active classes and set inactive;
|
||||
@@ -357,6 +362,21 @@ function SwitchToMenuItem(target) {
|
||||
$('#' + target).removeClass('inactive'); // Remove inactive state by classname;
|
||||
$('#' + target).addClass('active'); // Add active state by classname;
|
||||
let cl_object = $('#' + target).closest('ul'); // Find closest ul sidemenu header;
|
||||
cl_object.addClass('in'); // add class "in" to expand header in sidebar menu;
|
||||
cl_object.addClass('in'); // Add class "in" to expand header in sidebar menu;
|
||||
if (item) { // Jump to div "item" if available. Time limit 3 seconds
|
||||
function scrollTo(counter) {
|
||||
if(counter < 30) {
|
||||
setTimeout(function() {
|
||||
counter++;
|
||||
if ($('#' + item).length)
|
||||
$('#' + item)[0].scrollIntoView();
|
||||
else
|
||||
scrollTo(counter);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
scrollTo(0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -201,7 +201,7 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
for (const comp of components) {
|
||||
if (comp.name === "ALL")
|
||||
if (comp.name === "ALL" || (comp.name === "FORWARDER" && window.currentHyperionInstance != 0))
|
||||
continue;
|
||||
|
||||
const enable_style = (comp.enabled ? "checked" : "");
|
||||
|
@@ -195,10 +195,12 @@ function updateUiOnInstance(inst) {
|
||||
$('#btn_hypinstanceswitch').toggle(true);
|
||||
$('#active_instance_dropdown').prop('disabled', false);
|
||||
$('#active_instance_dropdown').css('cursor', 'pointer');
|
||||
$("#active_instance_dropdown").css("pointer-events", "auto");
|
||||
} else {
|
||||
$('#btn_hypinstanceswitch').toggle(false);
|
||||
$('#active_instance_dropdown').prop('disabled', true);
|
||||
$("#active_instance_dropdown").css('cursor', 'default');
|
||||
$("#active_instance_dropdown").css("pointer-events", "none");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user