summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-05-06 14:50:15 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-05-06 14:50:15 -0400
commita5f4780cf4aece0daa211275cd5a7c9acf6ef708 (patch)
treefd4b867062ded3a96ecbd9f33c80fa469f45c09a /www/js
parenta902f47149def68b7c7c4e9d65d8697970d4a643 (diff)
#241 - seems to be working for the most part
Former-commit-id: 975a7a737d99859ad75e643c93ec28e790935572
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DataModel.js2
-rw-r--r--www/js/EventModalCtrl.js50
-rw-r--r--www/js/MontageCtrl.js19
-rw-r--r--www/js/app.js3
4 files changed, 61 insertions, 13 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});
};