summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorlucas_nz <lucas_nz@outlook.com>2020-08-31 22:09:24 +1200
committerlucas_nz <lucas_nz@outlook.com>2020-08-31 22:09:24 +1200
commitd167ac96958730179cbb0a8245d800e3ce1fbef5 (patch)
treed2c8c249186033d31f6e9cfd2af5288d0040fbf7 /www/js
parent1400c6624de5ec0221fcc4c40d5618d25afd3fb2 (diff)
increment app version
# Conflicts: # package.json # www/js/NVR.js
Diffstat (limited to 'www/js')
-rw-r--r--www/js/EventCtrl.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index a6e89d6c..8da67496 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -1159,6 +1159,54 @@ angular.module('zmApp.controllers')
reload: true
});*/
};
+
+ $scope.nextEventsLoad = function () {
+ NVR.debug("nextEventsLoad called");
+ $scope.nextEvents = false;
+ //$scope.eventsBeingLoaded = true;
+ var lData = NVR.getLogin();
+
+ currEventsPage = 1;
+ maxEventsPage = 1;
+ currentPagePosition = 0;
+ currentPageLength = 0;
+
+ nolangFrom = "";
+ nolangTo = "";
+ if ($rootScope.toString && $rootScope.fromString) {
+ //nolangTo = moment($rootScope.fromString).locale('en').format("YYYY-MM-DD HH:mm:ss");
+ nolangTo = moment($scope.events[$scope.events.length-1].Event.StartTime).subtract(1, 'seconds').locale('en').format("YYYY-MM-DD HH:mm:ss");
+ //$rootScope.fromString = new Date('01/01/2000');
+ nolangFrom = moment(new Date('01/01/2000')).locale('en').format("YYYY-MM-DD HH:mm:ss");
+ }
+
+ //NVR.debug ("GETTING EVENTS USING "+$scope.id+" "+nolangFrom+" "+ nolangTo);
+ NVR.debug("EventCtrl: grabbing events for: id=" + $scope.id + " Date/Time:" + nolangFrom +
+ "-" + nolangTo);
+
+ NVR.getEvents($scope.id, currEventsPage, "", nolangFrom, nolangTo, false, $rootScope.monitorsFilter)
+ .then(function (data) {
+ // console.log(JSON.stringify(data.pagination));
+ if (data.pagination && data.pagination.pageCount)
+ maxEventsPage = data.pagination.pageCount;
+
+ NVR.debug("maxEventsPage: " + maxEventsPage + ", currEventsPage: " + currEventsPage);
+
+ // console.log ("WE GOT EVENTS="+JSON.stringify(data));
+
+ //NVR.debug("EventCtrl: success, got " + data.events.length + " events");
+ loadEvents(data);
+
+ currentPageData = data;
+ //$scope.events = data.events;
+ // we only need to stop the template from loading when the list is empty
+ // so this can be false once we have _some_ content
+ // FIXME: check reload
+ //$scope.eventsBeingLoaded = false;
+ moreEvents = true;
+ });
+ loadMoreTime = Date.now();
+ };
//----------------------------------------------------------------
// Alarm notification handling