summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@users.noreply.github.com>2019-05-28 16:12:18 -0400
committerGitHub <noreply@github.com>2019-05-28 16:12:18 -0400
commit572d19af26f07d78b99f8e2a0603a57ca066b326 (patch)
tree0628ef7a8467cd1124245cf28a59ed5bfda3ad17 /www/js/MontageCtrl.js
parentadb63ae77e1318a1c42dd0fe8ce31cfa7584194b (diff)
parent5bf531cfd5aa6812dd96bb3aa887187f71f3f560 (diff)
Merge pull request #819 from pliablepixels/api-tokens
Api tokens
Diffstat (limited to 'www/js/MontageCtrl.js')
-rw-r--r--www/js/MontageCtrl.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index a8b5b49d..4834d9e7 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -631,15 +631,16 @@ angular.module('zmApp.controllers')
apiurl += '/\'' + interval + '\' HOUR_SECOND';
}*/
- apiurl += '.json?sort=StartTime&direction=desc&limit=1';
+ apiurl += '.json?sort=StartTime&direction=desc&limit=1'+$rootScope.authSession;
- NVR.debug ("Getting event count using:"+apiurl);
+ NVR.debug ("Getting event count");
$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;
+ if (!res || !res.events) res = undefined;
+ else if (res.events.length == 0) res = undefined;
monitor.Monitor.lastEvent = res;
@@ -656,7 +657,16 @@ angular.module('zmApp.controllers')
if (monitor.Monitor.lastEvent && showMontageSidebars) {
- monitor.Monitor.showSidebar = true;
+
+ if (ld.objectDetectionFilter) {
+ if (monitor.Monitor.lastEvent.object) {
+ monitor.Monitor.showSidebar = true;
+ }
+ }
+ else {
+ monitor.Monitor.showSidebar = true;
+ }
+
}
},
@@ -721,7 +731,7 @@ angular.module('zmApp.controllers')
var apiurl = NVR.getLogin().apiurl;
//console.log ("ALARM CALLED WITH " +JSON.stringify(monitor));
- var alarmurl = apiurl + "/monitors/alarm/id:" + monitor.Monitor.Id + "/command:status.json";
+ var alarmurl = apiurl + "/monitors/alarm/id:" + monitor.Monitor.Id + "/command:status.json?"+$rootScope.authSession;
// console.log("Alarm Check: Invoking " + alarmurl);
$http.get(alarmurl)
@@ -1916,7 +1926,7 @@ angular.module('zmApp.controllers')
var ld = NVR.getLogin();
var url = ld.apiurl;
var eid = monitor.Monitor.lastEvent.events[0].Event.Id;
- url += '/events/'+monitor.Monitor.lastEvent.events[0].Event.Id+'.json';
+ url += '/events/'+monitor.Monitor.lastEvent.events[0].Event.Id+'.json?'+$rootScope.authSession;
var mid = monitor.Monitor.Id;
ld.lastEventCheckTimes[mid] = (new moment()).tz(NVR.getTimeZoneNow()).format('YYYY-MM-DD HH:mm:ss');
@@ -2442,7 +2452,7 @@ angular.module('zmApp.controllers')
}
$scope.squeezeMonitors = function () {
- console.log ("squeezing");
+ NVR.debug ("squeezing");
pckry.once('layoutComplete', resizeComplete);
$timeout(function () {
pckry.layout();