Allow to enable/disable suspend & lock event handling

This commit is contained in:
LordGrey
2023-11-02 20:23:04 +01:00
parent f57c4f84ac
commit 7d3f13c7b5
15 changed files with 604 additions and 115 deletions

View File

@@ -0,0 +1,11 @@
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header"><i class="fa fa-server fa-fw"></i><span data-i18n="main_menu_events">Event Services</span></h3>
<div id="conf_cont">
</div>
</div>
</div>
</div>
<script src="/js/content_events.js"></script>

View File

@@ -192,6 +192,8 @@
"conf_network_tok_intro": "Here you can create and delete tokens for API authentication. Created tokens will only be displayed once.",
"conf_network_tok_lastuse": "Last use",
"conf_network_tok_title": "Token Management",
"conf_system_events_heading_title": "System Events",
"conf_system_events_intro": "Settings related to diffent Operating System events Hyperion can handle",
"conf_webconfig_label_intro": "Webconfiguration settings. Edit wisely.",
"dashboard_active_instance": "Selected instance",
"dashboard_alert_message_confedit": "Your Hyperion configuration has been modified. To apply it, restart Hyperion.",
@@ -475,6 +477,12 @@
"edt_conf_smooth_updateDelay_title": "Output delay",
"edt_conf_smooth_updateFrequency_expl": "The output speed to your LED controller.",
"edt_conf_smooth_updateFrequency_title": "Update frequency",
"edt_conf_system_events_lockEnable_title": "Listen to lock events",
"edt_conf_system_events_lockEnable_expl": "Listen to screen lock/unlock events",
"edt_conf_system_events_suspendEnable_title": "Listen to suspend events",
"edt_conf_system_events_suspendEnable_expl": "Listen to system suspend/resume events",
"edt_conf_system_events_suspendOnLockEnable_title": "Suspend when locked",
"edt_conf_system_events_suspendOnLockEnable_expl": "Suspend when the screen is locked, otherwise go into idle mode",
"edt_conf_v4l2_blueSignalThreshold_expl": "Darkens low blue values (recognized as black)",
"edt_conf_v4l2_blueSignalThreshold_title": "Blue signal threshold",
"edt_conf_v4l2_cecDetection_expl": "If enabled, USB capture will be temporarily disabled when CEC standby event received from HDMI bus.",
@@ -983,6 +991,8 @@
"main_menu_dashboard_token": "Dashboard",
"main_menu_effect_conf_token": "Effects",
"main_menu_effectsconfigurator_token": "Effects Configurator",
"main_menu_events": "Event Services",
"main_menu_event_services_token": "Event Services",
"main_menu_general_conf_token": "General",
"main_menu_grabber_conf_token": "Capturing Hardware",
"main_menu_input_selection_token": "Input Selection",

View File

@@ -280,6 +280,7 @@
<li>
<a class="inactive"><i class="fa fa-industry fa-fw"></i><span data-i18n="main_menu_system_token">System</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li> <a class="inactive mnava" id="MenuItemEventServices" href="#conf_events"><i class="fa fa-server fa-fw"></i><span data-i18n="main_menu_event_services_token">Event Services</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemWeb" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemLogging" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>

View File

@@ -0,0 +1,37 @@
$(document).ready(function () {
performTranslation();
var conf_editor_systemEvents = null;
if (window.showOptHelp) {
//System Events
$('#conf_cont').append(createRow('conf_cont_system_events'));
$('#conf_cont_system_events').append(createOptPanel('fa-laptop', $.i18n("conf_system_events_heading_title"), 'editor_container_system_events', 'btn_submit_system_events', 'panel-system'));
$('#conf_cont_system_events').append(createHelpTable(window.schema.systemEvents.properties, $.i18n("conf_system_events_heading_title")));
}
else {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-laptop', $.i18n("conf_system_events_heading_title"), 'editor_container_system_events', 'btn_submit_system_events'));
}
//System Events
conf_editor_systemEvents = createJsonEditor('editor_container_system_events', {
systemEvents: window.schema.systemEvents
}, true, true);
conf_editor_systemEvents.on('change', function () {
conf_editor_systemEvents.validate().length || window.readOnlyMode ? $('#btn_submit_system_events').prop('disabled', true) : $('#btn_submit_system_events').prop('disabled', false);
});
$('#btn_submit_system_events').off().on('click', function () {
requestWriteConfig(conf_editor_systemEvents.getValue());
});
//create introduction
if (window.showOptHelp) {
createHint("intro", $.i18n('conf_system_events_intro'), "editor_container_system_events");
}
removeOverlay();
});