From 8968a524a2df044b3f90d1c6fce110993eb8cf85 Mon Sep 17 00:00:00 2001 From: lucas_nz Date: Wed, 30 Sep 2020 18:04:27 +1300 Subject: 1. If scope.id is not zero, we should show "tick" only the filtered monitors on the filter view. 2. Make sure we clear the selections properly too --- www/js/EventCtrl.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'www') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index b770dd7c..be1bf1f9 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -227,6 +227,11 @@ angular.module('zmApp.controllers') $rootScope.fromString = ""; $rootScope.toString = ""; $rootScope.monitorsFilter=""; + for (var i=0; i < $scope.monitors.length; i++) { + if ($scope.monitors[i] != undefined) { + $scope.monitors[i].Monitor.isChecked = undefined; + } + } } }); @@ -550,6 +555,19 @@ angular.module('zmApp.controllers') nolangFrom = moment($rootScope.fromString).locale('en').format("YYYY-MM-DD HH:mm:ss"); if ($rootScope.toString) nolangTo = moment($rootScope.toString).locale('en').format("YYYY-MM-DD HH:mm:ss"); + if ($scope.id) { + $rootScope.monitorsFilter = "/MonitorId =:" + $scope.id; + //console.log("monitors.length: " + $scope.monitors.length); + for (var i=0; i < $scope.monitors.length; i++) { + if ($scope.monitors[i] != undefined) { + if ($scope.monitors[i].Monitor.Id == $scope.id) + $scope.monitors[i].Monitor.isChecked = true; + else + $scope.monitors[i].Monitor.isChecked = false; + } + } + $scope.id = 0; + } NVR.getEvents($scope.id, currEventsPage, "", nolangFrom, nolangTo, false, $rootScope.monitorsFilter) .then(function (data) { @@ -2083,6 +2101,11 @@ angular.module('zmApp.controllers') $scope.id = 0; $scope.showEvent = false; $scope.footerState = ionPullUpFooterState.MINIMIZED; + for (var i=0; i < $scope.monitors.length; i++) { + if ($scope.monitors[i] != undefined) { + $scope.monitors[i].Monitor.isChecked = undefined; + } + } getInitialEvents(); /* -- cgit v1.2.3 From 5fae4b163e54658b623cce4e85811cb785673cf2 Mon Sep 17 00:00:00 2001 From: lucas_nz Date: Wed, 30 Sep 2020 18:05:07 +1300 Subject: if a monitor filter is applied, expand the monitors (so it's easy to see the filter) --- www/js/EventDateTimeFilterCtrl.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'www') diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index 28779310..7867659b 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -29,6 +29,7 @@ angular.module('zmApp.controllers') $scope.$on('$ionicView.beforeEnter', function () { $scope.today = moment().format("YYYY-MM-DD"); $scope.monitors = NVR.getMonitorsNow(); + var countChecked = 0; if (!$scope.monitors.length) { NVR.getMonitors(1) .then (function (data) { @@ -36,6 +37,8 @@ angular.module('zmApp.controllers') for (var i=0; i < $scope.monitors.length; i++) { if ($scope.monitors[i].Monitor.isChecked == undefined) $scope.monitors[i].Monitor.isChecked = true; + if ($scope.monitors[i].Monitor.isChecked == true) + countChecked++; } }); } @@ -43,9 +46,14 @@ angular.module('zmApp.controllers') for (var i=0; i < $scope.monitors.length; i++) { if ($scope.monitors[i].Monitor.isChecked == undefined) $scope.monitors[i].Monitor.isChecked = true; + if ($scope.monitors[i].Monitor.isChecked == true) + countChecked++; } } - $scope.monitorsExpanded = false; + if (countChecked < $scope.monitors.length) + $scope.monitorsExpanded = true; + else + $scope.monitorsExpanded = false; }); $scope.toggleMonitors = function() { -- cgit v1.2.3 From 4b44e857b2d1174dfa2ce2721dbcebba9cdb1708 Mon Sep 17 00:00:00 2001 From: lucas_nz Date: Wed, 30 Sep 2020 18:05:44 +1300 Subject: minor tweak of the html for alarm frames - these were being cut off. --- www/templates/events.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/templates/events.html b/www/templates/events.html index e8f5dfa7..681356ff 100644 --- a/www/templates/events.html +++ b/www/templates/events.html @@ -161,7 +161,7 @@
-

+

-

+
- +
-- cgit v1.2.3