summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/EventCtrl.js12
-rw-r--r--www/js/MomentCtrl.js2
-rw-r--r--www/js/MonitorModalCtrl.js4
-rw-r--r--www/js/MontageCtrl.js31
-rw-r--r--www/js/MontageHistoryCtrl.js6
-rw-r--r--www/js/TimelineCtrl.js2
-rw-r--r--www/js/TimelineModalCtrl.js2
-rw-r--r--www/js/WizardCtrl.js2
8 files changed, 39 insertions, 22 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index 77a50a64..e06309aa 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -974,10 +974,10 @@ angular.module('zmApp.controllers')
//$rootScope.zmPopup = $ionicPopup.alert({title: kFrame+':'+fid+'/'+kEvent+':'+e,template:img, cssClass:'popup80'});
- if ($rootScope.authSession != 'undefined') {
+
$scope.imgsrc += $rootScope.authSession;
$scope.fallbackImgSrc += $rootScope.authSession;
- }
+
$scope.imgsrc += NVR.insertBasicAuthToken();
@@ -2316,7 +2316,7 @@ angular.module('zmApp.controllers')
videoURL = event.Event.recordingURL + "/index.php?view=view_video&eid=" + event.Event.Id;
- if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession;
+ videoURL += $rootScope.authSession;
videoURL += NVR.insertBasicAuthToken();
@@ -2965,7 +2965,7 @@ angular.module('zmApp.controllers')
NVR.getSnapshotFrame()+"&eid="+event.Event.Id +
"&width=" + event.Event.thumbWidth * 2 +
"&height=" + event.Event.thumbHeight * 2;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
return stream;
@@ -2979,7 +2979,7 @@ angular.module('zmApp.controllers')
stream = event.Event.recordingURL + "/index.php?view=image" +
"&fid=" + slide.id + $scope.outlineMotionParam;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
@@ -2994,7 +2994,7 @@ angular.module('zmApp.controllers')
stream = event.Event.recordingURL +
"/index.php?view=image&fid=" + alarm.id;
if (motion) stream += $scope.outlineMotionParam;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
// console.log ("alarm:"+stream);
diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js
index 06294a16..b749837a 100644
--- a/www/js/MomentCtrl.js
+++ b/www/js/MomentCtrl.js
@@ -273,7 +273,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
"&width=" + moment.Event.thumbWidth * 2 +
"&height=" + moment.Event.thumbHeight * 2;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
return stream;
diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js
index 4d5f94f2..1279c013 100644
--- a/www/js/MonitorModalCtrl.js
+++ b/www/js/MonitorModalCtrl.js
@@ -1184,11 +1184,9 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
var loginData = NVR.getLogin();
var url = loginData.streamingurl +
'/zms?mode=single&monitor=' + mid;
-
- if ($rootScope.authSession != 'undefined') {
url += $rootScope.authSession;
- }
+
url += NVR.insertBasicAuthToken();
NVR.log("SavetoPhone:Trying to save image from " + url);
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 6b769b21..e6fba792 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -636,11 +636,25 @@ angular.module('zmApp.controllers')
NVR.debug ("Getting event count using:"+apiurl);
$http.get(apiurl)
.then (function (data) {
- // console.log ("EVENTS GOT: "+JSON.stringify(data));
+ console.log ("EVENTS GOT: "+JSON.stringify(data));
var res = data.data;
var mid = monitor.Monitor.Id;
if (res.events.length == 0) res = undefined;
+
monitor.Monitor.lastEvent = res;
+
+ if (monitor.Monitor.lastEvent) {
+ var notes = res.events[0].Event.Notes;
+ if (notes.indexOf('detected:') != -1) {
+ monitor.Monitor.lastEvent.object = true;
+ }
+ else {
+ monitor.Monitor.lastEvent.object = false;
+ }
+
+ }
+
+
if (monitor.Monitor.lastEvent && showMontageSidebars) {
monitor.Monitor.showSidebar = true;
}
@@ -868,7 +882,7 @@ angular.module('zmApp.controllers')
"&monitor=" + item.Monitor.Id +
"&scale=50";
- if ($rootScope.authSession != 'undefined') frame += $rootScope.authSession;
+ frame += $rootScope.authSession;
frame += NVR.insertBasicAuthToken();
return frame;
};
@@ -1908,7 +1922,7 @@ angular.module('zmApp.controllers')
ld.lastEventCheckTimes[mid] = (new moment()).tz(NVR.getTimeZoneNow()).format('YYYY-MM-DD HH:mm:ss');
NVR.debug ("Updating monitor:"+mid+" event check time (server tz) to " + ld.lastEventCheckTimes[mid] );
NVR.setLogin(ld);
- monitor.Monitor.lastEvent = undefined;
+
$http.get(url)
.then ( function (succ) {
@@ -1941,6 +1955,7 @@ angular.module('zmApp.controllers')
});
NVR.log("Cancelling montage timer, opening Modal");
+
// NVR.log("Starting Modal timer");
//console.log ("openModal:Cancelling timer");
$interval.cancel(intervalHandleMontage);
@@ -1969,6 +1984,8 @@ angular.module('zmApp.controllers')
$scope.modalData = {
doRefresh: false
};
+
+ monitor.Monitor.lastEvent = undefined;
$ionicModal.fromTemplateUrl('templates/events-modal.html', {
scope: $scope, // give ModalCtrl access to this scope
animation: 'slide-in-up',
@@ -2013,10 +2030,12 @@ angular.module('zmApp.controllers')
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
// console.log (stream);
+ //console.log ("EVENT="+stream);
return stream;
};
@@ -2024,7 +2043,7 @@ angular.module('zmApp.controllers')
$scope.constructStream = function (monitor) {
var stream;
- if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' || $rootScope.authSession == 'undefined') {
+ if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' ) {
//console.log ("STREAM=empty and auth="+$rootScope.authSession);
return "";
}
@@ -2048,7 +2067,7 @@ angular.module('zmApp.controllers')
//"&rand="+$scope.randToAvoidCacheMem +
- // console.log("STREAM=" + stream);
+ console.log("STREAM=" + stream);
return stream;
};
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js
index 5cf9892b..6f6687e4 100644
--- a/www/js/MontageHistoryCtrl.js
+++ b/www/js/MontageHistoryCtrl.js
@@ -301,7 +301,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
if (eType=='video') {
var videoURL= $scope.MontageMonitors[j].Monitor.baseURL + "/index.php?view=view_video&eid=" + eid;
- if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession;
+ videoURL += $rootScope.authSession;
if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken;
@@ -422,7 +422,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
if (eType=='video') {
var videoURL= $scope.MontageMonitors[i].Monitor.baseURL + "/index.php?view=view_video&eid=" + eid;
- if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession;
+ videoURL += $rootScope.authSession;
if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken;
@@ -892,7 +892,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
var videoURL= m.Monitor.baseURL + "/index.php?view=view_video&eid=" + success.eid;
- if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession;
+ videoURL += $rootScope.authSession;
if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken;
m.Monitor.videoObject = {
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js
index 3e09a24b..78006f37 100644
--- a/www/js/TimelineCtrl.js
+++ b/www/js/TimelineCtrl.js
@@ -1501,7 +1501,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla
stream = event.Event.recordingURL +
"/index.php?view=image&fid=" +
NVR.getSnapshotFrame()+"&eid="+event.Event.Id + "&width=400" ;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
$timeout ( function () {
diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js
index 0753182e..0b7fb5cb 100644
--- a/www/js/TimelineModalCtrl.js
+++ b/www/js/TimelineModalCtrl.js
@@ -52,7 +52,7 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', '
"&fid=" + alarm.id;
- if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession;
+ stream += $rootScope.authSession;
stream += NVR.insertBasicAuthToken();
return stream;
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js
index 5ca0aa25..c1a2ca57 100644
--- a/www/js/WizardCtrl.js
+++ b/www/js/WizardCtrl.js
@@ -678,7 +678,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
function validateData() {
- $rootScope.authSession = 'undefined';
+ $rootScope.authSession = '';
$rootScope.zmCookie = '';
$scope.wizard.portalValidText = "";