diff options
| -rw-r--r-- | www/js/DataModel.js | 2 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 50 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 19 | ||||
| -rw-r--r-- | www/js/app.js | 3 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 4 | ||||
| -rw-r--r-- | www/templates/events.html | 8 |
6 files changed, 67 insertions, 19 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index f46508f3..253c6926 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -36,7 +36,7 @@ angular.module('zmApp.controllers') 'url': '', // This is the ZM portal path 'apiurl': '', // This is the API path 'eventServer':'', //experimental Event server address - 'maxMontage': "10", //total # of monitors to display in montage + 'maxMontage': "100", //total # of monitors to display in montage 'streamingurl': "", 'maxFPS': "3", // image streaming FPS 'montageQuality': "50", // montage streaming quality in % diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 2aa2a3be..61b61920 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -93,6 +93,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro ZMDataModel.zmDebug("EventModalCtrl: Re-login detected, resetting everything & re-generating connkey"); ZMDataModel.stopNetwork("Auth-Success inside EventModalCtrl"); $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); + //console.log ("********* OFFSET FROM AUTH SUCC"); $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500); //$timeout.cancel(eventQueryHandle); //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); @@ -110,6 +111,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.isPaused = !$scope.isPaused; ZMDataModel.zmDebug ("Paused is " + $scope.isPaused); + sendCommand ( $scope.isPaused? '1':'2',$scope.connKey); }; @@ -149,16 +151,17 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro return (d.promise); } - console.log ("Sending CGI command to " + $scope.commandURL); + var loginData = ZMDataModel.getLogin(); + console.log ("Sending CGI command to " + loginData.url); var rqtoken = rq? rq:"stream"; var myauthtoken = $rootScope.authSession.replace("&auth=",""); //&auth= $http({ method: 'POST', /*timeout: 15000,*/ - url: $scope.commandURL + '/index.php', + url: loginData.url + '/index.php', headers: { 'Content-Type': 'application/x-www-form-urlencoded', //'Accept': '*/*', @@ -227,7 +230,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); var foo = str.join("&"); - //console.log("****SUB RETURNING " + foo); + console.log("****processEvent subcommands RETURNING " + foo); return foo; }, @@ -273,8 +276,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro ZMDataModel.zmDebug("Hmm I found an error " + JSON.stringify(resp)); //window.stop(); $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); + + // console.log (JSON.stringify(resp)); $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500); - ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey); + ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey); //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); } }); @@ -680,8 +685,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro //$scope.singleImageQuality = 100; - $scope.commandURL = $scope.currentEvent.Event.baseURL; - ZMDataModel.zmLog (">>>>>>>>>>>>>>>>>>ZMS url command is " + $scope.commandURL); + + //$scope.commandURL = $scope.currentEvent.Event.baseURL+"/index.php"; + // ZMDataModel.zmLog (">>>>>>>>>>>>>>>>>>ZMS url command is " + $scope.commandURL); currentEvent = $scope.currentEvent; @@ -700,7 +706,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro prepareModalEvent(currentEvent.Event.Id); if (ld.useNphZmsForEvents) { - + $timeout (function() { ZMDataModel.zmLog ("Starting checkAllEvents interval..."); //eventQueryHandle = $timeout (checkEvent(), zm.eventPlaybackQuery); @@ -709,6 +715,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro checkEvent(); // console.log ("Refreshing Image..."); }.bind(this),zm.eventPlaybackQuery); + },5000); } } @@ -743,6 +750,17 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro // Playback speed adjuster $scope.adjustSpeed = function (val) { + if ($scope.defaultVideo !== undefined && $scope.defaultVideo !='' ) + { + + $ionicLoading.show({ + template: "Please use video player controls for H264 events. ZoneMinder doesn't yet support zms controls", + noBackdrop: true, + duration: 3000 + }); + return; + } + var ld = ZMDataModel.getLogin(); if (ld.useNphZmsForEvents) @@ -834,6 +852,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro ZMDataModel.zmDebug("EventModalCtrl: gapless has changed resetting everything & re-generating connkey"); ZMDataModel.stopNetwork("EventModalCtrl-toggle gapless"); + ZMDataModel.zmDebug ("Regenerating connkey as gapless has changed"); + // console.log ("********* OFFSET FROM TOGGLE GAPLESS"); $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500); //$timeout.cancel(eventQueryHandle); @@ -1002,6 +1022,18 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro function jumpToEventZms(connkey, dirn) { + + if ($scope.defaultVideo !== undefined && $scope.defaultVideo !='' ) + { + + $ionicLoading.show({ + template: "Event navigation is not available with video feeds. ZoneMinder doesn't yet support them", + noBackdrop: true, + duration: 3000 + }); + return; + + } var cmd = dirn==1?'13':'12'; $scope.d_eventId = "..."; ZMDataModel.zmDebug ("Sending " + cmd + " to " + connkey); @@ -1012,6 +1044,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro duration: zm.httpTimeout }); + console.log ("Send command connkey: "+connkey); sendCommand ( cmd,connkey) .then ( function (success) @@ -1020,10 +1053,11 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $ionicLoading.hide(); }, function (error) { - + ZMDataModel.zmDebug("Hmm jump error " + JSON.stringify(error)); ZMDataModel.stopNetwork("EventModalCtrl-jumptoEventZms error"); $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); + // console.log ("********* OFFSET FROM JUMPTOEVENTZMS ERROR"); $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500); ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey); //$timeout.cancel(eventQueryHandle); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 0b522eed..3c57d1cf 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -26,6 +26,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' var pckry, draggie; var draggies; $scope.isDragabillyOn = false; + $scope.allImagesLoaded = false; + $scope.gridScale = "grid-item-30"; @@ -263,6 +265,7 @@ function initPackery() imagesLoaded(elem).on('always', function() { //console.log ("******** ALL IMAGES LOADED"); ZMDataModel.zmDebug ("All images loaded"); + $scope.allImagesLoaded = true; $ionicLoading.hide(); @@ -345,7 +348,13 @@ function initPackery() } function loadNotifications() { - + + if (!$scope.allImagesLoaded) + { + ZMDataModel.zmDebug ("skipping image refresh, packery is still loading"); + return; + } + $rootScope.rand = Math.floor((Math.random() * 100000) + 1); //console.log ("Inside Montage timer..."); @@ -353,7 +362,7 @@ function initPackery() } $scope.cancelReorder = function() - { + { $scope.modal.remove(); }; @@ -877,7 +886,11 @@ function initPackery() ZMDataModel.zmDebug ("Detected orientation change, redoing packery resize"); $timeout(function(){pckry.onresize();}); } - + + $scope.$on('$ionicView.beforeEnter', function () { + ZMDataModel.zmDebug ("Setting image mode to snapshot, will change to image when packery is all done"); + $scope.allImagesLoaded = false; + }); $scope.$on('$ionicView.beforeLeave', function () { // console.log("**VIEW ** Montage Ctrl Left, force removing modal"); diff --git a/www/js/app.js b/www/js/app.js index be606515..d5821cd3 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -46,7 +46,7 @@ angular.module('zmApp', [ //loginInterval: 30000, updateCheckInterval: 86400000, // 24 hrs loadingTimeout: 15000, - safeMontageLimit: 10, + safeMontageLimit: 100, safeImageQuality: 10, maxFPS: 30, defaultFPS: 3, @@ -1108,6 +1108,7 @@ angular.module('zmApp', [ }); $rootScope.userCancelledAuth = true; window.stop(); + $state.go("login" ,{"wizard": false}); }; diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index d56d27e2..c768b4e2 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -43,7 +43,7 @@ <!--<div style="color:white">connkey:{{connKey}}</div>--> <div style="width:100vw; height:100vh" > - <img image-spinner-src="{{event.Event.streamingURL}}/nph-zms?source=event&mode=jpeg&event={{eventId}}&frame=1&replay={{currentStreamMode}}&rate=100&connkey={{connKey}}&scale={{singleImageQuality}}{{$root.authSession}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"/> + <img image-spinner-src="{{loginData.streamingurl}}/nph-zms?source=event&mode=jpeg&event={{eventId}}&frame=1&replay={{currentStreamMode}}&rate=100&connkey={{connKey}}&scale={{singleImageQuality}}{{$root.authSession}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"/> <div ng-if="isPaused" style="position:absolute; top:50%; left:50%;white-space:nowrap;overflow:hidden;z-index:999" class="header-paused"> @@ -150,7 +150,7 @@ </span> -<span class="events-modal-gapless-icon"> +<span class="events-modal-gapless-icon" ng-if="defaultVideo==''"> <a ng-class="loginData.gapless? 'button button-small button-stable' : 'button button-small button-assertive' " href="" ng-click="toggleGapless()">gapless: {{loginData.gapless?"on":"off"}}</a> </span> diff --git a/www/templates/events.html b/www/templates/events.html index fc003db3..e85c4d03 100644 --- a/www/templates/events.html +++ b/www/templates/events.html @@ -277,7 +277,7 @@ <div class="list list-inset"> <div class="item item-divider">1 hour summary</div> - <div ng-repeat="hour in hours" id="hour-{{$index}}"> + <div ng-repeat="hour in hours|filter:{ monitor: '!'+'(Unknown)'}" id="hour-{{$index}}"> <span style="color:black"> <a class="item item-icon-right" href="" @@ -292,7 +292,7 @@ <div class="list list-inset"> <div class="item item-divider">1 day summary</div> - <div ng-repeat="day in days" id="day-{{$index}}"> + <div ng-repeat="day in days|filter:{ monitor: '!'+'(Unknown)'}" id="day-{{$index}}"> <span style="color:black"> <a class="item item-icon-right" href="" @@ -308,7 +308,7 @@ <div class="list list-inset"> <div class="item item-divider">1 week summary</div> - <div ng-repeat="week in weeks" id="week-{{$index}}"> + <div ng-repeat="week in weeks|filter:{ monitor: '!'+'(Unknown)'}" id="week-{{$index}}"> <span style="color:black"> <a class="item item-icon-right" href="" @@ -323,7 +323,7 @@ <div class="list list-inset"> <div class="item item-divider">1 month summary</div> - <div ng-repeat="month in months" id="month-{{$index}}"> + <div ng-repeat="month in months|filter:{ monitor: '!'+'(Unknown)'}" id="month-{{$index}}"> <span style="color:black"> <a class="item item-icon-right" href="" |
