From 986006947c3a6ac404d6868c113a03aaf202dcc2 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 9 Oct 2016 10:42:28 -0400 Subject: simplifying event montage - select X hrs ago too Former-commit-id: eac8812d33320d75e049da131c3fee631d0ad7f1 --- www/js/MontageHistoryCtrl.js | 26 +++++++++---- www/lang/locale-en.json | 5 ++- www/templates/montage-history.html | 80 ++++++++++++++++++++------------------ 3 files changed, 66 insertions(+), 45 deletions(-) (limited to 'www') diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index abe1f984..c0188d2d 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -49,8 +49,20 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc return moment(str).format(NVRDataModel.getTimeFormat() + ' on MMMM Do YYYY'); }; + $scope.dateChanged = function() + { + console.log ("DATE CHANGED"); + $scope.datetimeValueFrom.hrs = Math.round(moment.duration(moment().diff(moment($scope.datetimeValueFrom.value))).asHours()); + }; + $scope.hrsChanged = function() + { + $scope.datetimeValueFrom.value = moment().subtract($scope.datetimeValueFrom.hrs,'hours').toDate(); + timefrom.toDate(); + + }; + function orientationChanged() { NVRDataModel.debug("Detected orientation change, redoing packery resize"); @@ -321,12 +333,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc } - $scope.dateChanged = function () { - // window.stop(); - // console.log (">>>>>>>>>>>>>>>>>>>>>>>>>>>>> BAD BAD"); - footerCollapse(); - }; - + //-------------------------------------------------------------- // Used to control zms for a connkey. If ndx is not -1, @@ -1198,6 +1205,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc $rootScope.rand = Math.floor((Math.random() * 100000) + 1); $scope.monitors = []; imageLoadingDataShare.set(0); + var refresh = NVRDataModel.getMonitors(1); @@ -1216,6 +1224,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var intervalHandle; $scope.isModalActive = false; var modalIntervalHandle; + $scope.hrsAgo = 4; window.addEventListener("resize", orientationChanged, false); @@ -1258,13 +1267,16 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc //tdatetimeValueFrom.setDate(tdatetimeValueFrom.getDate()-1); $scope.datetimeValueFrom = { - value: "" + value: "", + hrs:"" }; $scope.datetimeValueTo = { value: "" }; $scope.datetimeValueFrom.value = timefrom.toDate(); + $scope.datetimeValueFrom.hrs = Math.round(moment.duration(moment().diff(moment($scope.datetimeValueFrom.value))).asHours()); + $scope.datetimeValueTo.value = timeto.toDate(); $rootScope.eventQueryInterval = ""; diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 995aa926..8557256c 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -355,5 +355,8 @@ "kZMSettingsFor" :"ZoneMinder settings for", "kZMStopped" :"stopped", "kZMUndetermined" :"undetermined", - "kZMUpgradeNeeded" :"ZoneMinder upgrade needed" + "kZMUpgradeNeeded" :"ZoneMinder upgrade needed", + "kEventHistShowFrom" :"Show from", + "kEventHistHrs" :"hours ago" + } diff --git a/www/templates/montage-history.html b/www/templates/montage-history.html index 9895d5cf..3a4cbd86 100644 --- a/www/templates/montage-history.html +++ b/www/templates/montage-history.html @@ -14,10 +14,10 @@ - + - + @@ -29,7 +29,7 @@ - +
- {{'kFrom' | translate}}:{{prettifyDateTimeFirst(datetimeValueFrom.value)}} ({{humanizeTime(datetimeValueFrom.value)}}) + {{'kFrom' | translate}}:{{prettifyDateTimeFirst(datetimeValueFrom.value)}} ({{humanizeTime(datetimeValueFrom.value)}}) +
({{'kChromeMax' | translate}})
@@ -92,49 +93,46 @@
-      - {{monitor.Monitor.Name}}  - -
- - {{prettifyDateTimeFirst(monitor.Monitor.eventUrlTime)}} ({{humanizeTime(monitor.Monitor.eventUrlTime)}})  -
+      {{monitor.Monitor.Name}}  + +
+ {{prettifyDateTimeFirst(monitor.Monitor.eventUrlTime)}} ({{humanizeTime(monitor.Monitor.eventUrlTime)}})  +
+ +
+ + + + + - - - - - - - - - - - - - - - - -
- - -
- + + + + + +
+ + +
+ @@ -195,14 +193,22 @@ - +
{{'kTimeline' | translate}}
+
+ {{'kEventHistShowFrom'|translate}}:  + +  {{'kEventHistHrs' | translate}} +
+ -
+
{{'kFrom' | translate }}: {{datetimeValueFrom.value | date: timeFormat}} -
({{humanizeTime(datetimeValueFrom.value)}}) +
({{humanizeTime(datetimeValueFrom.value)}})
-- cgit v1.2.3