diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MomentCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/NVR.js | 20 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 2 |
10 files changed, 32 insertions, 26 deletions
diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index 57e7e2fa..c7b50e63 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -96,6 +96,8 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' function saveDevOptions() { NVR.debug("SaveDevOptions: called"); + $scope.loginData.zmNinjaCustomId = $scope.loginData.zmNinjaCustomId.replace(/\s+/g, '_'); + if (parseInt($scope.loginData.cycleMonitorsInterval) < zm.minCycleTime) { $scope.loginData.cycleMonitorsInterval = zm.minCycleTime.toString(); } @@ -142,8 +144,8 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' } $scope.useDefaultCustom = function() { - if ($scope.loginData.zmNinjaHeader=='') { - $scope.loginData.zmNinjaHeader = 'zmNinja version:'+NVR.getAppVersion(); + if ($scope.loginData.zmNinjaCustomId=='') { + $scope.loginData.zmNinjaCustomId = 'zmNinja_'+NVR.getAppVersion(); } diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 967c80d0..9f6277e4 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -980,8 +980,8 @@ angular.module('zmApp.controllers') - $scope.imgsrc += NVR.insertBasicAuthToken(); - $scope.fallbackImgSrc += NVR.insertBasicAuthToken(); + $scope.imgsrc += NVR.insertSpecialTokens(); + $scope.fallbackImgSrc += NVR.insertSpecialTokens(); @@ -2318,7 +2318,7 @@ angular.module('zmApp.controllers') videoURL = event.Event.recordingURL + "/index.php?view=view_video&eid=" + event.Event.Id; videoURL += $rootScope.authSession; - videoURL += NVR.insertBasicAuthToken(); + videoURL += NVR.insertSpecialTokens(); // console.log("************** VIDEO IS " + videoURL); @@ -2986,7 +2986,7 @@ angular.module('zmApp.controllers') "&height=" + event.Event.thumbHeight * 2; stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); return stream; }; @@ -3000,7 +3000,7 @@ angular.module('zmApp.controllers') stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); return stream; @@ -3014,7 +3014,7 @@ angular.module('zmApp.controllers') "/index.php?view=image&fid=" + alarm.id; if (motion) stream += $scope.outlineMotionParam; stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); // console.log ("alarm:"+stream); return stream; diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 6741eecf..f83c5893 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1999,7 +1999,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro "&height=" + 200; if ($rootScope.authSession != 'undefined') frame += $rootScope.authSession; - frame += NVR.insertBasicAuthToken(); + frame += NVR.insertSpecialTokens(); //console.log ("alarm:"+frame); return frame; }; diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js index 915722dd..d2a4936f 100644 --- a/www/js/MomentCtrl.js +++ b/www/js/MomentCtrl.js @@ -276,7 +276,7 @@ var masonry = null; "&height=" + moment.Event.thumbHeight * 2; stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); return stream; }; diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index 14eb4429..732f02b0 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -1197,7 +1197,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ url += $rootScope.authSession; - url += NVR.insertBasicAuthToken(); + url += NVR.insertSpecialTokens(); NVR.log("SavetoPhone:Trying to save image from " + url); @@ -1300,7 +1300,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ //console.log ("STREAM="+stream); - if (stream) stream += NVR.insertBasicAuthToken(); + if (stream) stream += NVR.insertSpecialTokens(); return stream; diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index f03677b7..6841bb1c 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -843,7 +843,7 @@ angular.module('zmApp.controllers') "&scale=50"; frame += $rootScope.authSession; - frame += NVR.insertBasicAuthToken(); + frame += NVR.insertSpecialTokens(); return frame; }; @@ -2043,7 +2043,7 @@ angular.module('zmApp.controllers') stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); // console.log (stream); //console.log ("EVENT="+stream); return stream; @@ -2082,7 +2082,7 @@ angular.module('zmApp.controllers') stream += $rootScope.authSession; stream += appendConnKey(monitor.Monitor.connKey); - if (stream) stream += NVR.insertBasicAuthToken(); + if (stream) stream += NVR.insertSpecialTokens(); //randEachTime(); diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index ef3e07e3..2c0a2300 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -1528,7 +1528,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc //if (monitor.Monitor.isPaused) return ""; stream = monitor.Monitor.eventUrl; //eventUrl already has all the foo - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); // console.log("STREAM=" + stream); return stream; diff --git a/www/js/NVR.js b/www/js/NVR.js index 37a6c816..4b7fe795 100644 --- a/www/js/NVR.js +++ b/www/js/NVR.js @@ -210,7 +210,7 @@ angular.module('zmApp.controllers') 'useAPICaching': true, 'pauseStreams': false, 'liveStreamBuffer': 100, - 'zmNinjaHeader':undefined, // filled in init. custom header + 'zmNinjaCustomId':undefined, // filled in init. custom header }; @@ -235,7 +235,7 @@ angular.module('zmApp.controllers') } // setup custom header - cordova.plugin.http.setHeader('*', 'X-ZmNinja', loginData.zmNinjaHeader); + cordova.plugin.http.setHeader('*', 'X-ZmNinja', loginData.zmNinjaCustomId); if (!loginData.enableStrictSSL) { @@ -1607,8 +1607,8 @@ angular.module('zmApp.controllers') loginData.liveStreamBuffer = 100; } - if ((typeof loginData.zmNinjaHeader == undefined) || (loginData.zmNinjaHeader == '')) { - loginData.zmNinjaHeader = 'zmNinja version:'+zmAppVersion; + if ((typeof loginData.zmNinjaCustomId == undefined) || (loginData.zmNinjaCustomId == '')) { + loginData.zmNinjaCustomId = 'zmNinja_'+zmAppVersion; } loginData.canSwipeMonitors = true; @@ -1680,10 +1680,14 @@ angular.module('zmApp.controllers') return { - insertBasicAuthToken: function () { - - return loginData.insertBasicAuthToken && $rootScope.basicAuthToken ? "&basicauth=" + $rootScope.basicAuthToken : ""; + insertSpecialTokens: function () { + var tokens = ''; + tokens+='&id='+loginData.zmNinjaCustomId; + if (loginData.insertBasicAuthToken && $rootScope.basicAuthToken) { + tokens += "&basicauth=" + $rootScope.basicAuthToken; + } + return tokens; }, setCurrentServerMultiPortSupported: function (val) { @@ -2298,7 +2302,7 @@ angular.module('zmApp.controllers') }, getCustomHeader: function () { - return loginData.zmNinjaHeader; + return loginData.zmNinjaCustomId; }, getAppVersion: function () { diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index d030c131..f098ca2d 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -1579,7 +1579,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla "/index.php?view=image&fid=" + NVR.getSnapshotFrame()+"&eid="+event.Event.Id + "&width=400" ; stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); $timeout ( function () { $scope.thumbData = { diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index 84952c56..6d3619b8 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -54,7 +54,7 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' stream += $rootScope.authSession; - stream += NVR.insertBasicAuthToken(); + stream += NVR.insertSpecialTokens(); return stream; }; |
