mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
refactor
This commit is contained in:
parent
b06126ee28
commit
3fb0ece3a2
@ -20,16 +20,24 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="3">
|
<th colspan="3">
|
||||||
<i class="fa fa-eye fa-fw"></i>
|
<i class="mdi mdi-camera"></i>
|
||||||
<span data-i18n="dashboard_componentbox_label_title">Components</span>
|
<span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="glob_components"></tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td data-i18n="edt_conf_fg_heading_title">Screen Capture</td>
|
||||||
|
<td id="dash_screen_capture" style="text-align:right">unknown</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td data-i18n="edt_conf_v4l2_heading_title">USB Capture</td>
|
||||||
|
<td id="dash_usb_capture" style="text-align:right">unknown</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="table borderless">
|
<table class="table borderless">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -42,17 +50,17 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'conf_cont_proto')" href="#" data-i18n="dashboard_infobox_label_port_proto">proto</a></td>
|
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_protoserver')" href="#" data-i18n="dashboard_infobox_label_port_proto">proto</a></td>
|
||||||
<td id="dash_pbPort" style="text-align:right">unknown</td>
|
<td id="dash_pbPort" style="text-align:right">unknown</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'conf_cont_flatbuf')" href="#" data-i18n="dashboard_infobox_label_port_flat">flat</a></td>
|
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_fbserver')" href="#" data-i18n="dashboard_infobox_label_port_flat">flat</a></td>
|
||||||
<td id="dash_fbPort" style="text-align:right">unknown</td>
|
<td id="dash_fbPort" style="text-align:right">unknown</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'conf_cont_json')" href="#" data-i18n="dashboard_infobox_label_port_json">json</a></td>
|
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_jsonserver')" href="#" data-i18n="dashboard_infobox_label_port_json">json</a></td>
|
||||||
<td id="dash_jsonPort" style="text-align:right">unknown</td>
|
<td id="dash_jsonPort" style="text-align:right">unknown</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -76,9 +76,11 @@ table.input-group{width:100%}
|
|||||||
|
|
||||||
/*table*/
|
/*table*/
|
||||||
table.borderless td,table.borderless th{border: none !important;}
|
table.borderless td,table.borderless th{border: none !important;}
|
||||||
|
table.borderless td:first-child{width: 25px !important;}
|
||||||
.borderless {margin-bottom:0px}
|
.borderless {margin-bottom:0px}
|
||||||
table label{margin:0}
|
table label{margin:0}
|
||||||
table.first_cell_borderless td:first-child,table.first_cell_borderless th:first-child{border: none !important;}
|
table.first_cell_borderless td:first-child,table.first_cell_borderless th:first-child{border: none !important;}
|
||||||
|
table.first_cell_borderless td:first-child{width: 25px !important;}
|
||||||
|
|
||||||
/*Header*/
|
/*Header*/
|
||||||
.navbar-brand{padding-top:4px;padding-bottom:0px;padding-left:2;}
|
.navbar-brand{padding-top:4px;padding-bottom:0px;padding-left:2;}
|
||||||
|
@ -214,7 +214,7 @@
|
|||||||
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
|
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li> <a class="inactive mnava" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
|
<li> <a class="inactive mnava" id="MenuItemGrabber" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
|
||||||
<li> <a class="inactive mnava" id="MenuItemNetwork" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
|
<li> <a class="inactive mnava" id="MenuItemNetwork" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
|
||||||
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
|
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
|
||||||
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
|
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
|
||||||
|
@ -51,36 +51,23 @@ $(document).ready(function () {
|
|||||||
instances_html += '</th></tr></thead>';
|
instances_html += '</th></tr></thead>';
|
||||||
|
|
||||||
var instance_components = "";
|
var instance_components = "";
|
||||||
var global_components = "";
|
|
||||||
for (var idx = 0; idx < components.length; idx++) {
|
for (var idx = 0; idx < components.length; idx++) {
|
||||||
if (components[idx].name != "ALL") {
|
if (components[idx].name != "ALL") {
|
||||||
if (components[idx].name != "FORWARDER" && components[idx].name != "GRABBER" && components[idx].name != "V4L") {
|
if (components[idx].name === "FORWARDER" && window.currentHyperionInstance != 0)
|
||||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
continue;
|
||||||
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') + '">';
|
|
||||||
|
|
||||||
instance_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||||
} else {
|
const general_comp = "general_comp_" + components[idx].name;
|
||||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
var componentBtn = '<input ' +
|
||||||
const general_comp = "general_comp_" + components[idx].name;
|
'id="' + general_comp + '" ' + comp_enabled +
|
||||||
var componentBtn = '<input ' +
|
' type="checkbox" ' +
|
||||||
'id="' + general_comp + '" ' + comp_enabled +
|
'data-toggle="toggle" ' +
|
||||||
' type="checkbox" ' +
|
'data-size="mini" ' +
|
||||||
'data-toggle="toggle" ' +
|
'data-onstyle="success" ' +
|
||||||
'data-size="mini" ' +
|
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||||
'data-onstyle="success" ' +
|
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
|
||||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
|
||||||
|
|
||||||
global_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
instance_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +75,6 @@ $(document).ready(function () {
|
|||||||
instances_html += '</div></div></div>';
|
instances_html += '</div></div></div>';
|
||||||
|
|
||||||
$('.instances').prepend(instances_html);
|
$('.instances').prepend(instances_html);
|
||||||
$('.glob_components').html(global_components);
|
|
||||||
|
|
||||||
updateUiOnInstance(window.currentHyperionInstance);
|
updateUiOnInstance(window.currentHyperionInstance);
|
||||||
updateHyperionInstanceListing();
|
updateHyperionInstanceListing();
|
||||||
@ -113,6 +99,11 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add more info
|
// add more info
|
||||||
|
var screenCapture = window.serverConfig.instCapture.systemEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||||
|
$('#dash_screen_capture').html(screenCapture);
|
||||||
|
var usbCapture = window.serverConfig.instCapture.v4lEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||||
|
$('#dash_usb_capture').html(usbCapture);
|
||||||
|
|
||||||
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
|
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
|
||||||
$('#dash_fbPort').html(fbPort);
|
$('#dash_fbPort').html(fbPort);
|
||||||
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');
|
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');
|
||||||
|
@ -312,7 +312,7 @@ $(document).ready(function () {
|
|||||||
$("#navbar_brand_logo").css("display", "none");
|
$("#navbar_brand_logo").css("display", "none");
|
||||||
else
|
else
|
||||||
$("#navbar_brand_logo").css("display", "");
|
$("#navbar_brand_logo").css("display", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#side-menu li a, #side-menu li ul li a').click(function() {
|
$('#side-menu li a, #side-menu li ul li a').click(function() {
|
||||||
console.log('test');
|
console.log('test');
|
||||||
|
@ -201,7 +201,7 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const comp of components) {
|
for (const comp of components) {
|
||||||
if (comp.name === "ALL")
|
if (comp.name === "ALL" || (comp.name === "FORWARDER" && window.currentHyperionInstance != 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const enable_style = (comp.enabled ? "checked" : "");
|
const enable_style = (comp.enabled ? "checked" : "");
|
||||||
|
@ -205,20 +205,8 @@ bool API::setComponentState(const QString &comp, bool &compState, QString &reply
|
|||||||
|
|
||||||
if (component != COMP_INVALID)
|
if (component != COMP_INVALID)
|
||||||
{
|
{
|
||||||
if (component == COMP_FORWARDER ||
|
QMetaObject::invokeMethod(_hyperion, "compStateChangeRequest", Qt::QueuedConnection, Q_ARG(hyperion::Components, component), Q_ARG(bool, compState));
|
||||||
component == COMP_GRABBER ||
|
return true;
|
||||||
component == COMP_V4L ||
|
|
||||||
component == COMP_FLATBUFSERVER ||
|
|
||||||
component == COMP_PROTOSERVER)
|
|
||||||
{
|
|
||||||
QMetaObject::invokeMethod(_instanceManager, "compStateChangeRequest", Qt::QueuedConnection, Q_ARG(hyperion::Components, component), Q_ARG(bool, compState));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMetaObject::invokeMethod(_hyperion, "compStateChangeRequest", Qt::QueuedConnection, Q_ARG(hyperion::Components, component), Q_ARG(bool, compState));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
replyMsg = QString("Unknown component name: %1").arg(comp);
|
replyMsg = QString("Unknown component name: %1").arg(comp);
|
||||||
return false;
|
return false;
|
||||||
|
@ -90,7 +90,6 @@ bool HyperionIManager::startInstance(quint8 inst, bool block, QObject* caller, i
|
|||||||
connect(hyperion, &Hyperion::videoMode, this, &HyperionIManager::requestVideoMode);
|
connect(hyperion, &Hyperion::videoMode, this, &HyperionIManager::requestVideoMode);
|
||||||
// to Hyperion
|
// to Hyperion
|
||||||
connect(this, &HyperionIManager::newVideoMode, hyperion, &Hyperion::newVideoMode);
|
connect(this, &HyperionIManager::newVideoMode, hyperion, &Hyperion::newVideoMode);
|
||||||
connect(this, &HyperionIManager::compStateChangeRequest, hyperion, &Hyperion::compStateChangeRequest);
|
|
||||||
|
|
||||||
// add to queue and start
|
// add to queue and start
|
||||||
_startQueue << inst;
|
_startQueue << inst;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user