mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
efe1d92c0d
A Box was added which is shown for 5 seconds if the server responds with "cmd-condig-setconfig"
123 lines
2.9 KiB
JavaScript
123 lines
2.9 KiB
JavaScript
$(document).ready( function() {
|
|
|
|
loadContentTo("#container_connection_lost","connection_lost");
|
|
loadContentTo("#container_restart","restart");
|
|
initWebSocket();
|
|
|
|
$(hyperion).on("cmd-serverinfo",function(event){
|
|
serverInfo = event.response.info;
|
|
// comps
|
|
comps = event.response.info.components
|
|
|
|
$(hyperion).trigger("ready");
|
|
|
|
comps.forEach( function(obj) {
|
|
if (obj.name == "ALL")
|
|
{
|
|
if(obj.enabled)
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
else
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
}
|
|
});
|
|
|
|
if (serverInfo.hyperion.enabled)
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
else
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
|
|
updateSessions();
|
|
}); // end cmd-serverinfo
|
|
|
|
$(hyperion).on("cmd-sessions-update", function(event) {
|
|
serverInfo.sessions = event.response.data;
|
|
updateSessions();
|
|
});
|
|
|
|
$(hyperion).on("cmd-sysinfo", function(event) {
|
|
requestServerInfo();
|
|
sysInfo = event.response.info;
|
|
|
|
currentVersion = sysInfo.hyperion.version;
|
|
});
|
|
|
|
$(hyperion).one("cmd-config-getschema", function(event) {
|
|
serverSchema = event.response.info;
|
|
requestServerConfig();
|
|
|
|
schema = serverSchema.properties;
|
|
});
|
|
|
|
$(hyperion).on("cmd-config-getconfig", function(event) {
|
|
serverConfig = event.response.info;
|
|
requestSysInfo();
|
|
|
|
showOptHelp = serverConfig.general.showOptHelp;
|
|
});
|
|
|
|
$(hyperion).on("cmd-config-setconfig", function(event) {
|
|
if (event.response.success === true) {
|
|
$('#hyperion_config_write_success_notify').fadeIn().delay(5000).fadeOut();
|
|
}
|
|
});
|
|
|
|
$(hyperion).on("error",function(event){
|
|
showInfoDialog("error","Error", event.reason);
|
|
});
|
|
|
|
$(hyperion).on("open",function(event){
|
|
requestServerConfigSchema();
|
|
});
|
|
|
|
$(hyperion).one("ready", function(event) {
|
|
loadContent();
|
|
});
|
|
|
|
$(hyperion).on("cmd-adjustment-update", function(event) {
|
|
serverInfo.adjustment = event.response.data
|
|
});
|
|
|
|
$(hyperion).on("cmd-videomode-update", function(event) {
|
|
serverInfo.videomode = event.response.data.videomode
|
|
});
|
|
|
|
$(hyperion).on("cmd-components-update", function(event) {
|
|
let obj = event.response.data
|
|
|
|
// notfication in index
|
|
if (obj.name == "ALL")
|
|
{
|
|
if(obj.enabled)
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
else
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
}
|
|
|
|
comps.forEach((entry, index) => {
|
|
if (entry.name === obj.name){
|
|
comps[index] = obj;
|
|
}
|
|
});
|
|
// notify the update
|
|
$(hyperion).trigger("components-updated");
|
|
});
|
|
|
|
$(hyperion).on("cmd-effects-update", function(event){
|
|
serverInfo.effects = event.response.data.effects
|
|
});
|
|
|
|
$(".mnava").bind('click.menu', function(e){
|
|
loadContent(e);
|
|
window.scrollTo(0, 0);
|
|
});
|
|
|
|
});
|
|
|
|
$(function(){
|
|
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
|
|
sidebar.delegate('a.inactive','click',function(){
|
|
sidebar.find('.active').toggleClass('active inactive');
|
|
$(this).toggleClass('active inactive');
|
|
});
|
|
});
|