mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Details coming soon.
This commit is contained in:
@@ -22,6 +22,17 @@ var loggingHandlerInstalled = false;
|
||||
var watchdog = 0;
|
||||
var debugMessagesActive = true;
|
||||
var wSess = [];
|
||||
var plugins_installed = {};
|
||||
var plugins_available = {};
|
||||
|
||||
//comps serverinfo lock
|
||||
comps = [];
|
||||
compsInited = false;
|
||||
|
||||
// prios serverinfo lock
|
||||
priosInited = false;
|
||||
// token list
|
||||
tokenList = {}
|
||||
|
||||
function initRestart()
|
||||
{
|
||||
@@ -59,6 +70,7 @@ function connectionLostDetection(type)
|
||||
setInterval(connectionLostDetection, 3000);
|
||||
|
||||
// init websocket to hyperion and bind socket events to jquery events of $(hyperion) object
|
||||
|
||||
function initWebSocket()
|
||||
{
|
||||
if ("WebSocket" in window)
|
||||
@@ -66,8 +78,8 @@ function initWebSocket()
|
||||
if (websocket == null)
|
||||
{
|
||||
jsonPort = (document.location.port == '') ? '80' : document.location.port;
|
||||
websocket = new WebSocket('ws://'+document.location.hostname+":"+document.location.port);
|
||||
console.log(jsonPort)
|
||||
websocket = new WebSocket('ws://'+document.location.hostname+":"+jsonPort);
|
||||
|
||||
websocket.onopen = function (event) {
|
||||
$(hyperion).trigger({type:"open"});
|
||||
|
||||
@@ -108,7 +120,7 @@ function initWebSocket()
|
||||
response = JSON.parse(event.data);
|
||||
success = response.success;
|
||||
cmd = response.command;
|
||||
if (success)
|
||||
if (success || typeof(success) == "undefined")
|
||||
{
|
||||
$(hyperion).trigger({type:"cmd-"+cmd, response:response});
|
||||
}
|
||||
@@ -161,7 +173,7 @@ function sendToHyperion(command, subcommand, msg)
|
||||
// also used for watchdog
|
||||
function requestServerInfo()
|
||||
{
|
||||
sendToHyperion("serverinfo");
|
||||
sendToHyperion("serverinfo","",'"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "effects-update"]');
|
||||
}
|
||||
|
||||
function requestSysInfo()
|
||||
@@ -218,7 +230,7 @@ function requestPriorityClear(prio)
|
||||
|
||||
function requestClearAll()
|
||||
{
|
||||
sendToHyperion("clearall");
|
||||
requestPriorityClear(-1)
|
||||
}
|
||||
|
||||
function requestPlayEffect(effectName, duration)
|
||||
|
Reference in New Issue
Block a user