2016-09-06 10:14:54 +02:00
|
|
|
$(document).ready( function() {
|
2016-12-21 18:24:03 +01:00
|
|
|
|
2016-09-06 10:14:54 +02:00
|
|
|
loadContentTo("#container_connection_lost","connection_lost");
|
2017-01-17 21:53:35 +01:00
|
|
|
loadContentTo("#container_restart","restart");
|
2016-09-06 10:14:54 +02:00
|
|
|
initWebSocket();
|
2016-09-07 20:10:37 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-serverinfo",function(event){
|
|
|
|
window.serverInfo = event.response.info;
|
2019-01-01 19:47:07 +01:00
|
|
|
// comps
|
2019-06-05 18:19:08 +02:00
|
|
|
window.comps = event.response.info.components
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).trigger("ready");
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
window.comps.forEach( function(obj) {
|
2019-01-01 19:47:07 +01:00
|
|
|
if (obj.name == "ALL")
|
|
|
|
{
|
|
|
|
if(obj.enabled)
|
|
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
|
|
else
|
|
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
|
|
}
|
|
|
|
});
|
2016-09-14 13:51:28 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
if (window.serverInfo.hyperion.enabled)
|
2017-04-07 21:33:40 +02:00
|
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
2018-12-27 23:11:32 +01:00
|
|
|
else
|
|
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
2016-11-26 22:46:16 +01:00
|
|
|
|
2018-12-27 23:11:32 +01:00
|
|
|
updateSessions();
|
2016-09-06 10:14:54 +02:00
|
|
|
}); // end cmd-serverinfo
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-sessions-update", function(event) {
|
|
|
|
window.serverInfo.sessions = event.response.data;
|
2018-12-27 23:11:32 +01:00
|
|
|
updateSessions();
|
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-sysinfo", function(event) {
|
2017-03-18 00:05:04 +01:00
|
|
|
requestServerInfo();
|
2019-06-05 18:19:08 +02:00
|
|
|
window.sysInfo = event.response.info;
|
2017-04-07 21:33:40 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
window.currentVersion = window.sysInfo.hyperion.version;
|
2017-03-04 22:17:42 +01:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).one("cmd-config-getschema", function(event) {
|
|
|
|
window.serverSchema = event.response.info;
|
2016-10-10 23:15:50 +02:00
|
|
|
requestServerConfig();
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
window.schema = window.serverSchema.properties;
|
2016-10-10 23:15:50 +02:00
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-config-getconfig", function(event) {
|
|
|
|
window.serverConfig = event.response.info;
|
2017-03-18 00:05:04 +01:00
|
|
|
requestSysInfo();
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
window.showOptHelp = window.serverConfig.general.showOptHelp;
|
2016-09-10 19:08:08 +02:00
|
|
|
});
|
2019-02-07 00:59:52 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-config-setconfig", function(event) {
|
2019-02-07 00:59:52 +01:00
|
|
|
if (event.response.success === true) {
|
|
|
|
$('#hyperion_config_write_success_notify').fadeIn().delay(5000).fadeOut();
|
|
|
|
}
|
|
|
|
});
|
2016-09-10 19:08:08 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("error",function(event){
|
2016-10-27 23:42:24 +02:00
|
|
|
showInfoDialog("error","Error", event.reason);
|
2016-09-06 10:14:54 +02:00
|
|
|
});
|
2016-09-10 19:08:08 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("open",function(event){
|
2016-09-10 19:08:08 +02:00
|
|
|
requestServerConfigSchema();
|
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).one("ready", function(event) {
|
2017-02-08 14:36:28 +01:00
|
|
|
loadContent();
|
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-adjustment-update", function(event) {
|
|
|
|
window.serverInfo.adjustment = event.response.data
|
2018-12-27 23:11:32 +01:00
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-videomode-update", function(event) {
|
|
|
|
window.serverInfo.videomode = event.response.data.videomode
|
2018-12-27 23:11:32 +01:00
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-components-update", function(event) {
|
2018-12-27 23:11:32 +01:00
|
|
|
let obj = event.response.data
|
|
|
|
|
|
|
|
// notfication in index
|
|
|
|
if (obj.name == "ALL")
|
|
|
|
{
|
2019-01-01 19:47:07 +01:00
|
|
|
if(obj.enabled)
|
2018-12-27 23:11:32 +01:00
|
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
|
|
else
|
|
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
|
|
}
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
window.comps.forEach((entry, index) => {
|
2018-12-27 23:11:32 +01:00
|
|
|
if (entry.name === obj.name){
|
2019-06-05 18:19:08 +02:00
|
|
|
window.comps[index] = obj;
|
2018-12-27 23:11:32 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
// notify the update
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).trigger("components-updated");
|
2018-12-27 23:11:32 +01:00
|
|
|
});
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
$(window.hyperion).on("cmd-effects-update", function(event){
|
|
|
|
window.serverInfo.effects = event.response.data.effects
|
2018-12-27 23:11:32 +01:00
|
|
|
});
|
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
$(".mnava").bind('click.menu', function(e){
|
2017-02-08 14:36:28 +01:00
|
|
|
loadContent(e);
|
2017-02-28 17:53:41 +01:00
|
|
|
window.scrollTo(0, 0);
|
2017-02-08 14:36:28 +01:00
|
|
|
});
|
|
|
|
|
2016-09-06 10:14:54 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
$(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');
|
|
|
|
});
|
|
|
|
});
|