mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add Suspend/Resume support (#1535)
* Add Suspend/Resume support * Support Suspend/Resume/Restart via API, UI and Systray * Support screen lock/unlock scenario * Handle idle scenario * Align with fix for #1368 * Update Windows build * Refactor SuspendHandler to maintain state * Do not start BG-Effect, if system goes into suspend mode * Correct Idle and Resume interaction
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
"infoDialog_password_current_text": "Current password",
|
||||
"infoDialog_password_minimum_length": "Passwords must be minimum 8 characters.",
|
||||
"infoDialog_password_new_text": "New password",
|
||||
"InfoDialog_systemSuspend_title": "Suspend",
|
||||
"InfoDialog_systemResume_title": "Resume",
|
||||
"InfoDialog_systemRestart_title": "Restart",
|
||||
"infoDialog_username_text": "Username",
|
||||
"about_3rd_party_licenses": "3rd party licenses",
|
||||
"about_3rd_party_licenses_error": "We had trouble collecting 3rd party licenses information from web. <br />Please follow this link to the GitHub Resource.",
|
||||
|
@@ -213,6 +213,39 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-power-off fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
<li id="btn_systemSuspend">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-stop fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_systemSuspend_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li id="btn_systemResume">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-play fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_systemResume_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_systemRestart">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-refresh fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_systemRestart_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- /.lock-ui -->
|
||||
<li class="dropdown" id="btn_lock_ui" style="display:none">
|
||||
|
@@ -318,6 +318,21 @@ function requestSysInfo()
|
||||
sendToHyperion("sysinfo");
|
||||
}
|
||||
|
||||
function requestSystemSuspend()
|
||||
{
|
||||
sendToHyperion("system","suspend");
|
||||
}
|
||||
|
||||
function requestSystemResume()
|
||||
{
|
||||
sendToHyperion("system","resume");
|
||||
}
|
||||
|
||||
function requestSystemRestart()
|
||||
{
|
||||
sendToHyperion("system","restart");
|
||||
}
|
||||
|
||||
function requestServerConfigSchema()
|
||||
{
|
||||
sendToHyperion("config","getschema");
|
||||
|
@@ -75,6 +75,21 @@ $(document).ready(function () {
|
||||
changePassword();
|
||||
});
|
||||
|
||||
//Suspend Hyperion
|
||||
$('#btn_systemSuspend').off().on('click', function () {
|
||||
requestSystemSuspend();
|
||||
});
|
||||
|
||||
//Resume Hyperion
|
||||
$('#btn_systemResume').off().on('click', function () {
|
||||
requestSystemResume();
|
||||
});
|
||||
|
||||
//Restart Hyperion
|
||||
$('#btn_systemRestart').off().on('click', function () {
|
||||
requestSystemRestart();
|
||||
});
|
||||
|
||||
//Lock Ui
|
||||
$('#btn_lock_ui').off().on('click', function () {
|
||||
removeStorage('loginToken');
|
||||
|
Reference in New Issue
Block a user