From 32b40b96839cc4cac11eab00fa9b55482cee7457 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 6 Sep 2020 17:38:39 -0400 Subject: #963 show filter text properly, also indicate selective monitors --- www/js/EventCtrl.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'www/js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 8082396b..75576a0f 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -281,7 +281,13 @@ angular.module('zmApp.controllers') document.addEventListener("pause", onPause, false); //console.log("I got STATE PARAM " + $stateParams.id); $scope.id = parseInt($stateParams.id, 10); - if (isNaN($scope.id)) $scope.id = 0; + if (isNaN($scope.id)) { + $scope.id = 0; + } + + if ($scope.id) + $rootScope.isEventFilterOn = true; + $scope.showEvent = $stateParams.playEvent || false; $scope.monitors = NVR.getMonitorsNow(); @@ -300,6 +306,8 @@ angular.module('zmApp.controllers') //console.log("toString: " + $rootScope.toString); } + + //console.log("BEFORE ENTER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); NVR.log("EventCtrl called with: E/MID=" + $scope.id + " playEvent = " + $scope.showEvent); @@ -1828,12 +1836,20 @@ angular.module('zmApp.controllers') $scope.filterTapped = function () { //console.log("FILTER TAPPED"); - var myFrom = moment($rootScope.fromString).format("MMM/DD/YYYY " + NVR.getTimeFormat()).toString(); - var toString = moment($rootScope.toString).format("MMM/DD/YYYY " + NVR.getTimeFormat()).toString(); + var myFrom = $translate.instant('kAll'); + var toString = $translate.instant('kAll'); + var monString = ''; + + if (moment($rootScope.fromString).isValid()) + myFrom = moment($rootScope.fromString).format("MMM/DD/YYYY " + NVR.getTimeFormat()).toString(); + if (moment($rootScope.toString).isValid()) + toString = moment($rootScope.toString).format("MMM/DD/YYYY " + NVR.getTimeFormat()).toString(); + if ($rootScope.monitorsFilter != '') + monString = $translate.instant('kFilterEventsSelectiveMon'); $rootScope.zmPopup = $ionicPopup.confirm({ title: $translate.instant('kFilterSettings'), - template: $translate.instant('kFilterEventsBetween1') + ':
' + myFrom + " " + $translate.instant('kTo') + " " + toString + '
' + $translate.instant('kFilterEventsBetween2'), + template: $translate.instant('kFilterEventsBetween1') + ':
' + myFrom + " " + $translate.instant('kTo') + " " + toString + ' '+ monString+'
' + $translate.instant('kFilterEventsBetween2'), okText: $translate.instant('kButtonOk'), cancelText: $translate.instant('kButtonCancel'), }); -- cgit v1.2.3