summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/MontageCtrl.js')
-rw-r--r--www/js/MontageCtrl.js36
1 files changed, 32 insertions, 4 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 967decfe..3da303a5 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -592,6 +592,7 @@ angular.module('zmApp.controllers')
// now is server TZ time
var now = ld.lastEventCheckTimes[monitor.Monitor.Id];
+ NVR.debug ("ld.lastEventCheckTimes[id]:" + ld.lastEventCheckTimes[monitor.Monitor.Id]);
apiurl += "/StartTime >:" + now;
}
@@ -615,7 +616,7 @@ angular.module('zmApp.controllers')
apiurl += '.json?sort=StartTime&direction=desc&limit=1'+$rootScope.authSession;
- NVR.debug ("Getting event count ");
+ NVR.debug ("Getting event count for monitor.Monitor.Id: " + monitor.Monitor.Id);
$http.get(apiurl)
.then (function (data) {
// console.log ("EVENTS GOT: "+JSON.stringify(data));
@@ -1706,7 +1707,7 @@ angular.module('zmApp.controllers')
function onResume() {
// we should be going to portal login so no need here
- //NVR.debug ("Montage resume called, regenerating all connkeys");
+ NVR.debug ("Montage resume called, regenerating all connkeys");
//NVR.regenConnKeys();
// $scope.MontageMonitors = NVR.getMonitorsNow();
@@ -2290,9 +2291,29 @@ angular.module('zmApp.controllers')
var stream;
var fps = NVR.getLogin().montageliveFPS;
+ if (!monitor.Monitor.streamingURL) {
+ NVR.debug("monitor.Monitor.streamingURL: " + monitor.Monitor.streamingURL );
+ NVR.debug("monitor.Monitor.MonitorId: " + monitor.Monitor.MonitorId );
+ /*for (var key in monitor.Monitor) {
+ console.log(key + ": " + monitor.Monitor[key]);
+ }
+ return;
+ NVR.log("Reloading view for montage view, recomputing rand");
+ $rootScope.rand = Math.floor((Math.random() * 100000) + 1);
+ $scope.monitors = [];
+ //imageLoadingDataShare.set(0);
+
+ var refresh = NVR.getMonitors(1);
+
+ refresh.then(function (data) {
+ $scope.monitors = data;
+ });
+ return;*/
+ }
if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' ) {
//console.log ("STREAM=empty and auth="+$rootScope.authSession);
//sconsole.log ('EMPTY STREAM');
+ NVR.log("currentStreamState: " + currentStreamState + ", monitor.Monitor.listDisplay: " + monitor.Monitor.listDisplay);
return "";
}
@@ -2300,6 +2321,7 @@ angular.module('zmApp.controllers')
stream = monitor.Monitor.streamingURL +
"/nph-zms?mode=single&scale=10&monitor="+ monitor.Monitor.Id + "&rand=" + randToAvoidCacheMem + monitor.Monitor.Id ;
// console.log(stream);
+ NVR.log("currentStreamState: " + currentStreamState);
} else {
stream = monitor.Monitor.streamingURL +
@@ -2328,6 +2350,7 @@ angular.module('zmApp.controllers')
//console.log("STREAM=" + stream);
+ //NVR.log("STREAM=" + stream);
return stream;
};
@@ -2611,15 +2634,20 @@ angular.module('zmApp.controllers')
var ld = NVR.getLogin();
mid = monitor.Monitor.Id;
// always use server tz to avoid confusion
+ var lastCheckTime = ld.lastEventCheckTimes[mid];
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.debug ("Updating monitor:"+mid+" event check time (server tz) to " + lastCheckTime);
NVR.setLogin(ld);
+ if (!monitor.Monitor.lastEvent) {
+ lastCheckTime = "";
+ }
monitor.Monitor.lastEvent = undefined;
monitor.Monitor.showSidebar = false;
if (!showEvents) return;
$state.go("app.events", {
"id": monitor.Monitor.Id,
- "playEvent": false
+ "playEvent": false,
+ "lastCheckTime": lastCheckTime
});
return;