From 8cb2692bbbb695421024ff7eebb57dcdb1b5635f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 13 May 2016 11:09:12 -0400 Subject: [PATCH] pass in the server url into the monitor object to use instead of the portal url --- web/skins/classic/views/js/montage.js | 11 ++++++----- web/skins/classic/views/js/montage.js.php | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/skins/classic/views/js/montage.js b/web/skins/classic/views/js/montage.js index 1367bc8b1..a6c459760 100644 --- a/web/skins/classic/views/js/montage.js +++ b/web/skins/classic/views/js/montage.js @@ -1,10 +1,11 @@ var requestQueue = new Request.Queue( { concurrent: 2 } ); -function Monitor( index, id, connKey ) +function Monitor( index, monitorData ) { this.index = index; - this.id = id; - this.connKey = connKey; + this.id = monitorData.id; + this.connKey = monitorData.connKey; + this.server_url = monitorData.server_url; this.status = null; this.alarmState = STATE_IDLE; this.lastAlarmState = STATE_IDLE; @@ -110,7 +111,7 @@ function Monitor( index, id, connKey ) this.streamCmdReq.send( this.streamCmdParms+"&command="+CMD_QUERY ); } - this.streamCmdReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, onSuccess: this.getStreamCmdResponse.bind( this ), onTimeout: this.streamCmdQuery.bind( this, true ), link: 'cancel' } ); + this.streamCmdReq = new Request.JSON( { url: this.server_url, method: 'get', timeout: AJAX_TIMEOUT, onSuccess: this.getStreamCmdResponse.bind( this ), onTimeout: this.streamCmdQuery.bind( this, true ), link: 'cancel' } ); requestQueue.addRequest( "cmdReq"+this.id, this.streamCmdReq ); } @@ -146,7 +147,7 @@ function initPage() { for ( var i = 0; i < monitorData.length; i++ ) { - monitors[i] = new Monitor( i, monitorData[i].id, monitorData[i].connKey ); + monitors[i] = new Monitor( i, monitorData[i] ); var delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout ); monitors[i].start( delay ); } diff --git a/web/skins/classic/views/js/montage.js.php b/web/skins/classic/views/js/montage.js.php index 80f652fd5..7eaebb75b 100644 --- a/web/skins/classic/views/js/montage.js.php +++ b/web/skins/classic/views/js/montage.js.php @@ -35,7 +35,8 @@ monitorData[monitorData.length] = { 'id': Id() ?>, 'connKey': connKey() ?>, 'width': Width() ?>, - 'height':Height() ?> + 'height':Height() ?>, + 'server_url': 'Server()->Url().$_SERVER['PHP_SELF'] ?>' };