diff options
| author | lucas_nz <lucas_nz@outlook.com> | 2020-08-29 21:29:07 +1200 |
|---|---|---|
| committer | lucas_nz <lucas_nz@outlook.com> | 2020-08-31 22:17:03 +1200 |
| commit | 0e5779874010cd8730ee4f788ff4420f70dd2ad2 (patch) | |
| tree | 7fd88366aa0ac14543d71d3316be516c3caea76e /www | |
| parent | e02255edfba2f055d7a35dea5f6442eeb149632e (diff) | |
when click notification in montage, filter event view to only display events since last notification click
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventDateTimeFilterCtrl.js | 17 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 36 | ||||
| -rwxr-xr-x | www/js/app.js | 2 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 2 | ||||
| -rw-r--r-- | www/templates/menu.html | 4 |
5 files changed, 51 insertions, 10 deletions
diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index e2d7b22e..689b800d 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -63,6 +63,7 @@ angular.module('zmApp.controllers') $rootScope.toTime = ""; $rootScope.fromString = ""; $rootScope.toString = ""; + $rootScope.monitorsFilter = ''; // if you come here via the events pullup // you are looking at a specific monitor ID @@ -100,6 +101,8 @@ angular.module('zmApp.controllers') // don't root. //-------------------------------------------------------------------------- $scope.saveFilters = function () { + // only reset date/time if at least one of them is set. + if ($rootScope.fromDate || $rootScope.toDate || $rootScope.fromTime || $rootScope.toTime) { if (!$rootScope.fromDate) { //console.log("RESET fromDate"); $rootScope.fromDate = new Date(); @@ -131,11 +134,21 @@ angular.module('zmApp.controllers') $rootScope.fromDate = $rootScope.toDate; $rootScope.toDate = t; } - - $rootScope.isEventFilterOn = true; + $rootScope.fromString = moment($rootScope.fromDate).format("YYYY-MM-DD") + " " + moment($rootScope.fromTime).format("HH:mm:ss"); $rootScope.toString = moment($rootScope.toDate).format("YYYY-MM-DD") + " " + moment($rootScope.toTime).format("HH:mm:ss"); + } + else { + $rootScope.fromDate = null; + $rootScope.toDate = null; + $rootScope.fromTime = null; + $rootScope.toTime = null; + $rootScope.fromString = null; + $rootScope.toString = null; + } + + $rootScope.isEventFilterOn = true; //console.log("CONCAT DATES " + temp); // 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; diff --git a/www/js/app.js b/www/js/app.js index f84673a5..8799784d 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -2388,7 +2388,7 @@ angular.module('zmApp', [ } }, cache: false, - url: "/events/:id/:playEvent", + url: "/events/:id/:playEvent/:lastCheckTime", templateUrl: "templates/events.html", controller: 'zmApp.EventCtrl', diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 0410273d..088f21b3 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -334,7 +334,7 @@ "kReconfirmPin" :"Reconfirm PIN", "kRecordingProgress" :"recording in progress", "kReflow" :"reflow", - "kRefresh" :"refresh", + "kRefresh" :"Refresh", "kRefreshedView" :"refreshed view", "kReportEvents" :"report events", "kReportedVersion" :"Reported Version", diff --git a/www/templates/menu.html b/www/templates/menu.html index f00578b3..2a78bb6e 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -42,8 +42,8 @@ </span>{{'kMenuTimeline'|translate}} </ion-item> - <!--<ion-item ng-click="navigateView('app.events', {id:0,playEvent:false})" menu-close>--> - <ion-item id="testaut_menu_events" href="#/app/events/0/false" ng-click="go('/app/events/0/false')"> + <!--<ion-item ng-click="navigateView('app.events', {id:0,playEvent:false,lastCheckTime:''})" menu-close>--> + <ion-item id="testaut_menu_events" href="#/app/events/0/false/" ng-click="go('/app/events/0/false/')"> <span class=" item-icon-left"> <i class="icon ion-ios-calendar-outline"></i> </span>{{'kMenuEvents'|translate}} |
