summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rwxr-xr-xwww/js/DataModel.js33
-rw-r--r--www/js/DevOptionsCtrl.js18
-rw-r--r--www/js/MenuController.js26
-rw-r--r--www/js/MontageCtrl.js283
-rw-r--r--www/js/MontageHistoryCtrl.js27
-rw-r--r--www/js/PortalLoginCtrl.js2
-rwxr-xr-xwww/js/app.js4
-rw-r--r--www/lang/locale-en.json4
-rw-r--r--www/lang/locale-pl.json9
-rw-r--r--www/templates/devoptions.html2
-rw-r--r--www/templates/menu.html39
-rw-r--r--www/templates/montage.html6
12 files changed, 249 insertions, 204 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 5263d204..8c2ba754 100755
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -334,6 +334,10 @@ angular.module('zmApp.controllers')
var d = $q.defer();
var as = 'undefined';
+ if (!mid && monitors.length > 0) {
+ mid = monitors[0].Monitor.Id;
+ }
+
if (!mid) {
log("Deferring auth key, as monitorId unknown");
d.resolve("undefined");
@@ -948,14 +952,10 @@ angular.module('zmApp.controllers')
if (typeof loginData.disableSimulStreaming == 'undefined') {
- loginData.disableSimulStreaming = false;
-
+ loginData.disableSimulStreaming = ($rootScope.platformOS == 'ios')?true:false;
+
}
- // iOS it is always off, webkit bug
-
- if ($rootScope.platformOS=='ios') {
- loginData.disableSimulStreaming = true;
- }
+
if (typeof loginData.exitOnSleep == 'undefined') {
debug("exitOnSleep does not exist. Setting to false");
@@ -1249,17 +1249,25 @@ angular.module('zmApp.controllers')
},
stopNetwork: function (str) {
+ var d = $q.defer();
var s = "";
if (str) s = str + ":";
if (justResumed) {
// we don't call stop as we did stop on pause
log(s + " Not calling window stop as we just resumed");
+ d.resolve (true);
+ return (d.promise);
} else {
log(s + " stopNework: Calling window.stop()");
- $timeout (function() {window.stop();});
+ $timeout (function() {
+ window.stop();
+ d.resolve(true);
+ return (d.promise);
+ });
}
+ return d.promise;
},
hasLoginInfo: function () {
@@ -2419,10 +2427,12 @@ angular.module('zmApp.controllers')
},
logout: function () {
+
+ var d = $q.defer();
log (loginData.url +"=>Logging out of any existing ZM sessions...");
$rootScope.authSession = "undefined";
- return $http(
+ $http(
{
method: 'POST',
timeout:10000,
@@ -2448,7 +2458,10 @@ angular.module('zmApp.controllers')
action: "logout",
view: "login"
}
- });
+ })
+ .then (function (succ) {d.resolve(true);return d.promise;},
+ function (err) {d.resolve(true);return d.promise;});
+ return d.promise;
}
diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js
index 92c1e2c0..9ae1ba39 100644
--- a/www/js/DevOptionsCtrl.js
+++ b/www/js/DevOptionsCtrl.js
@@ -54,10 +54,18 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
// reset power state on exit as if it is called after we enter another
// state, that effectively overwrites current view power management needs
//------------------------------------------------------------------------
- $scope.$on('$ionicView.enter', function()
+ $scope.$on('$ionicView.beforeEnter', function()
{
//console.log("**VIEW ** DevOptions Ctrl Entered");
$scope.loginData = NVRDataModel.getLogin();
+ $scope.isMultiPort = false;
+
+ NVRDataModel.getZmsMultiPortSupport()
+ .then (function (data) {
+ $scope.isMultiPort = (data == 0) ? false:true;
+ NVRDataModel.debug ("Multiport report:"+$scope.isMultiPort);
+ });
+
NVRDataModel.setAwake(false);
});
@@ -73,8 +81,8 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
};
$scope.checkMultiPortToggle = function() {
- if ($rootScope.platformOS == 'ios')
- $scope.loginData.disableSimulStreaming = true;
+ // if ($rootScope.platformOS == 'ios')
+ // $scope.loginData.disableSimulStreaming = true;
};
//------------------------------------------------------------------
// Perform the login action when the user submits the login form
@@ -113,9 +121,7 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
$scope.loginData.singleImageQuality = zm.safeImageQuality.toString();
}
- if (!$scope.loginData.disableSimulStreaming && $rootScope.platformOS=='ios') {
- $scope.loginData.disableSimulStreaming = true;
- }
+
NVRDataModel.debug("SaveDevOptions: Saving to disk");
NVRDataModel.setLogin($scope.loginData);
NVRDataModel.getMonitors(1);
diff --git a/www/js/MenuController.js b/www/js/MenuController.js
index c7e96604..e353d310 100644
--- a/www/js/MenuController.js
+++ b/www/js/MenuController.js
@@ -2,7 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
-angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', function($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate)
+angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', '$timeout', function($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate, $timeout)
{
$scope.openMenu = function()
{
@@ -13,6 +13,30 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io
// This controller sits along with the main app to bring up
// the language menu from the main menu
//----------------------------------------------------------------
+
+
+
+ $scope.navigateView = function(view,args) {
+
+ if (view == $state.current.name) return;
+ NVRDataModel.debug ("Navigating view to: " + view);
+ $ionicHistory.nextViewOptions({
+ disableBack: true
+ });
+ $state.go(view,args);
+
+ /* $timeout (function() {
+ window.stop();
+ // after window stop executes, in next cycle
+ // this _should_ ensure stop concludes before
+ // exit/entry lifecycles kick in?
+ $timeout (function() {$state.go(view,args);});
+
+ });*/
+
+ };
+
+
$scope.switchLang = function()
{
$scope.lang = NVRDataModel.getLanguages();
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 28f74f04..4d0f24bd 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -30,7 +30,13 @@ angular.module('zmApp.controllers')
var randToAvoidCacheMem;
- var areStreamsStopped = true; // first load snapshot
+ var streamState = {
+ SNAPSHOT:1,
+ ACTIVE:2,
+ STOPPED:3
+ };
+
+ var currentStreamState = streamState.SNAPSHOT; // first load snapshot
$scope.isModalStreamPaused = false; // used in Monitor Modal
//var reloadPage = 30;
@@ -41,6 +47,8 @@ angular.module('zmApp.controllers')
var as = $scope.$on("auth-success", function () {
+ // do nothing, we are reloading here anyway?
+ /*
if ($scope.singleMonitorModalOpen) {
NVRDataModel.debug("Montage: Not creating streams, as modal is open");
return;
@@ -49,7 +57,7 @@ angular.module('zmApp.controllers')
NVRDataModel.debug("Montage Re-auth handler");
- areStreamsStopped = true;
+ //streamState = true;
$timeout(function () { // after render
if (simulStreaming) {
@@ -67,6 +75,7 @@ angular.module('zmApp.controllers')
});
broadcastHandles.push(as);
//console.log (">>>>>>>>>>>>>>>>>>>>>>>>>>>AS="+as);
+ */
});
//--------------------------------------------------------------------------------------
@@ -218,7 +227,7 @@ angular.module('zmApp.controllers')
duration: zm.loadingTimeout
});*/
- areStreamsStopped = true;
+ currentStreamState = streamState.SNAPSHOT;
$scope.areImagesLoading = true;
var progressCalled = false;
@@ -303,10 +312,19 @@ angular.module('zmApp.controllers')
imagesLoaded(elem).on('always', function () {
//console.log ("******** ALL IMAGES LOADED");
// $scope.$digest();
- NVRDataModel.debug("All images loaded, switching to streaming if applicable");
+ NVRDataModel.debug("All images loaded, switching to snapshot...");
$scope.areImagesLoading = false;
- areStreamsStopped = false;
+ currentStreamState = streamState.SNAPSHOT;
+
+ if (simulStreaming) {
+
+ $timeout (function() {
+ NVRDataModel.debug ("Switching mode to active...");
+ currentStreamState = streamState.ACTIVE;
+ },100);
+ }
+
$ionicLoading.hide();
@@ -575,6 +593,7 @@ angular.module('zmApp.controllers')
function randEachTime() {
randToAvoidCacheMem = new Date().getTime();
+
//$scope.randToAvoidCacheMem = "1";
//console.log ("Generating:"+$scope.randToAvoidCacheMem);
}
@@ -585,7 +604,7 @@ angular.module('zmApp.controllers')
function loadNotifications() {
if (simulStreaming) {
- // console.log ("Skipping timer as simulStreaming");
+ // console.log ("Skipping timer as simulStreaming");
return;
}
@@ -613,32 +632,26 @@ angular.module('zmApp.controllers')
}
$scope.cancelReorder = function () {
- areStreamsStopped = false;
$scope.modal.remove();
+ finishReorder();
};
$scope.saveReorder = function () {
NVRDataModel.debug("Saving monitor hide/unhide");
- // redo packery as monitor status has changed
- // DOM may need reloading if you've hidden/unhidden stuff
-
-
- // The montage screens might change here so we need
- // to destroy/re-create
-
$scope.modal.remove();
-
-
- // assign new arrangement
$scope.MontageMonitors = $scope.copyMontage;
+ finishReorder();
+
+ };
+ function finishReorder() {
- // manually recreate connkeys in new copy
for (var i = 0; i < $scope.MontageMonitors.length; i++) {
$scope.MontageMonitors[i].Monitor.connKey = (Math.floor((Math.random() * 999999) + 1)).toString();
}
- areStreamsStopped = false;
+ currentStreamState = streamState.STOPPED;
+ // don't call initPackery - we need to savePackeryOrder
$timeout(function () // after render
{
draggies.forEach(function (drag) {
@@ -651,7 +664,7 @@ angular.module('zmApp.controllers')
pckry.layout();
}, zm.packeryTimer);
- };
+ }
function savePackeryOrder() {
$timeout(function () {
@@ -678,9 +691,25 @@ angular.module('zmApp.controllers')
//$scope.MontageMonitors = angular.copy(NVRDataModel.getMonitorsNow());
//$scope.MontageMonitors = NVRDataModel.getMonitorsNow();
pckry.layout();
+
+
+ $scope.areImagesLoading = false;
+ currentStreamState = streamState.SNAPSHOT;
+
+ if (simulStreaming) {
+
+ $timeout (function() {
+ NVRDataModel.debug ("Switching mode to active...");
+ currentStreamState = streamState.ACTIVE;
+ },100);
+ }
}, 20);
}
+ $scope.isCycleOn = function() {
+ return NVRDataModel.getLogin().cycleMontageProfiles;
+ };
+
$scope.getCycleStatus = function () {
var c = NVRDataModel.getLogin().cycleMontageProfiles;
var str = (c) ? $translate.instant('kOn') : $translate.instant('kOff');
@@ -714,20 +743,34 @@ angular.module('zmApp.controllers')
// make a copy of the current list and work on that
// this is to avoid packery screw ups while you are hiding/unhiding
+ $scope.copyMontage = angular.copy($scope.MontageMonitors);
+
if (simulStreaming) {
NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
- areStreamsStopped = true;
- $timeout(function () {
-
- // remove old monitors
+ currentStreamState = streamState.STOPPED;
+ NVRDataModel.stopNetwork()
+ .then (function (succ) {
for (var i = 0; i < $scope.MontageMonitors.length; i++) {
if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL);
}
+ // in context of timeout
+ $ionicModal.fromTemplateUrl('templates/reorder-modal.html', {
+ scope: $scope,
+ animation: 'slide-in-up',
+ id: 'reorder',
+ })
+ .then(function (modal) {
+ $scope.modal = modal;
+ $scope.reOrderActive = true;
+ $scope.modal.show();
+ });
+
});
- }
- $scope.copyMontage = angular.copy($scope.MontageMonitors);
- $ionicModal.fromTemplateUrl('templates/reorder-modal.html', {
+
+ }
+ else {
+ $ionicModal.fromTemplateUrl('templates/reorder-modal.html', {
scope: $scope,
animation: 'slide-in-up',
id: 'reorder',
@@ -737,6 +780,9 @@ angular.module('zmApp.controllers')
$scope.reOrderActive = true;
$scope.modal.show();
});
+
+ }
+
};
@@ -1063,7 +1109,7 @@ angular.module('zmApp.controllers')
$scope.openModal = function (mid, controllable, controlid, connKey, monitor) {
- areStreamsStopped = true;
+ currentStreamState = streamState.STOPPED;
$scope.isModalStreamPaused = true; // we stop montage and start modal stream in snapshot first
$timeout(function () { // after render
@@ -1213,7 +1259,7 @@ angular.module('zmApp.controllers')
}
// we need to do this as we hide the view for snapshot as well
- //areStreamsStopped = false;
+ //streamState = false;
$timeout(function () // after render
{
initPackery();
@@ -1265,26 +1311,22 @@ angular.module('zmApp.controllers')
broadcastHandles = [];
- areStreamsStopped = true;
-
- $timeout(function () {
- if (!$scope.singleMonitorModalOpen && simulStreaming) {
- NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
-
- if (0 && $rootScope.platformOS == 'ios') {
- NVRDataModel.debug("Webkit hack, hammering window.stop();");
- NVRDataModel.stopNetwork();
- } else {
- for (i = 0; i < $scope.MontageMonitors.length; i++) {
- if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL);
+ currentStreamState = streamState.STOPPED;
+ $timeout(function () {
+ if (!$scope.singleMonitorModalOpen && simulStreaming) {
+ NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
- }
+ for (i = 0; i < $scope.MontageMonitors.length; i++) {
+ if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL);
+
+ }
+
}
+
+ });
+
-
- }
-
- });
+
@@ -1294,6 +1336,7 @@ angular.module('zmApp.controllers')
NVRDataModel.debug("MontageCtrl: onpause called");
viewCleanup();
viewCleaned = true;
+
}
function onResume() {
@@ -1421,16 +1464,18 @@ angular.module('zmApp.controllers')
//console.log ("NEW POS="+ld.packeryPositions);
NVRDataModel.setLogin(ld);
- areStreamsStopped = true;
+
$timeout(function () { // after render
if (simulStreaming) {
-
+ currentStreamState = streamState.STOPPED;
NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
if ($rootScope.platformOS == 'ios') {
+ NVRDataModel.stopNetwork();
+
} else {
for (var i = 0; i < $scope.MontageMonitors.length; i++) {
@@ -1438,14 +1483,28 @@ angular.module('zmApp.controllers')
}
}
- NVRDataModel.regenConnKeys();
- $scope.monitors = NVRDataModel.getMonitorsNow();
- $scope.MontageMonitors = angular.copy($scope.monitors);
- $timeout(function () {
- initPackery();
- }, zm.packeryTimer);
+ // in timeout for iOS as we call stopNetwork
+ $timeout (function() {
+
+ NVRDataModel.regenConnKeys();
+ $scope.monitors = NVRDataModel.getMonitorsNow();
+ $scope.MontageMonitors = angular.copy($scope.monitors);
+ $timeout(function () {
+ initPackery();
+ }, zm.packeryTimer);
+
+ });
+
}
+ else {
+ NVRDataModel.regenConnKeys();
+ $scope.monitors = NVRDataModel.getMonitorsNow();
+ $scope.MontageMonitors = angular.copy($scope.monitors);
+ $timeout(function () {
+ initPackery();
+ }, zm.packeryTimer);
+ }
@@ -1630,77 +1689,47 @@ angular.module('zmApp.controllers')
function getMode() {
- var mode = (simulStreaming && !areStreamsStopped) ? 'jpeg' : 'single';
+ var mode = (simulStreaming && currentStreamState!=streamState.SNAPSHOT && currentStreamState != streamState.STOPPED) ? 'jpeg' : 'single';
//console.log ("mode="+mode);
return mode;
}
- // only for testing
- $scope.killAllImages = function () {
- areStreamsStopped = !areStreamsStopped; // inside timeout, because we need DOM to hide
- $timeout(function () {
- if (simulStreaming && areStreamsStopped) {
- NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
- for (var i = 0; i < $scope.MontageMonitors.length; i++) {
- if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL);
- }
- }
-
- });
-
-
- if (simulStreaming && !areStreamsStopped) {
- NVRDataModel.debug("Re-creating all streams in montage to save memory/nw...");
- NVRDataModel.regenConnKeys();
-
- $scope.monitors = NVRDataModel.getMonitorsNow();
- $scope.MontageMonitors = angular.copy($scope.monitors);
-
- $timeout(function () {
- initPackery();
- }, zm.packeryTimer);
-
-
- }
-
-
-
- };
$scope.constructStream = function (monitor) {
var stream;
- if (areStreamsStopped || monitor.Monitor.listDisplay == 'noshow') return "";
+ if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' || $rootScope.authSession == 'undefined') {
+ // console.log ("STREAM=empty");
+ return "";
+ }
+
stream = monitor.Monitor.streamingURL +
"/nph-zms?mode=" + getMode() +
"&monitor=" + monitor.Monitor.Id +
"&scale=" + $scope.LoginData.montageQuality +
+ "&rand=" + randToAvoidCacheMem +
+ "&buffer=1000" +
$rootScope.authSession +
- "&rand=" + randToAvoidCacheMem;
+ appendConnKey(monitor.Monitor.connKey);
+//"&rand=" + randToAvoidCacheMem;
//"&rand="+$scope.randToAvoidCacheMem +
- appendConnKey(monitor.Monitor.connKey);
- //console.log("STREAM=" + stream);
+
+
+ // console.log("STREAM=" + stream);
return stream;
};
function appendConnKey(ck) {
- if (simulStreaming)
+ if (simulStreaming && currentStreamState != streamState.SNAPSHOT)
return "&connkey=" + ck;
else
return "";
}
- // using connkey in snapshot results in error
- $scope.appendConnKey = function (ck) {
- if (simulStreaming && !areStreamsStopped)
- return "&connkey=" + ck;
- else
- return "";
- };
-
+
$scope.toggleSubMenuFunction = function () {
$scope.toggleSubMenu = !$scope.toggleSubMenu;
@@ -1717,7 +1746,7 @@ angular.module('zmApp.controllers')
broadcastHandles = [];
randToAvoidCacheMem = new Date().getTime();
- areStreamsStopped = true;
+ currentStreamState = streamState.SNAPSHOT;
// NVRDataModel.regenConnKeys();
$scope.monitors = NVRDataModel.getMonitorsNow();
$scope.MontageMonitors = angular.copy($scope.monitors);
@@ -1740,10 +1769,10 @@ angular.module('zmApp.controllers')
//console.log ("****** MULTIPORT="+multiPortZms);
NVRDataModel.debug("Multiport=" + data);
- if ($rootScope.platformOS == 'ios') {
+ /* if ($rootScope.platformOS == 'ios') {
simulStreaming = false;
NVRDataModel.debug("IOS detected, DISABLING simul streaming");
- }
+ }*/
if (ld.disableSimulStreaming) {
simulStreaming = false;
@@ -1777,7 +1806,7 @@ angular.module('zmApp.controllers')
};
$scope.$on('$ionicView.afterEnter', function () {
- NVRDataModel.debug("Setting image mode to snapshot, will change to image when packery is all done");
+ // NVRDataModel.debug("Setting image mode to snapshot, will change to image when packery is all done");
$scope.areImagesLoading = true;
$scope.isDragabillyOn = false;
$scope.reOrderActive = false;
@@ -1875,15 +1904,6 @@ angular.module('zmApp.controllers')
ld = NVRDataModel.getLogin();
- $rootScope.authSession = "undefined";
- $ionicLoading.show({
- template: $translate.instant('kNegotiatingStreamAuth'),
- animation: 'fade-in',
- showBackdrop: true,
- duration: zm.loadingTimeout,
- maxWidth: 300,
- showDelay: 0
- });
NVRDataModel.log("Inside Montage Ctrl:We found " + $scope.monitors.length + " monitors");
@@ -1896,30 +1916,10 @@ angular.module('zmApp.controllers')
}
- $rootScope.validMonitorId = $scope.monitors[0].Monitor.Id;
- NVRDataModel.getAuthKey($rootScope.validMonitorId, (Math.floor((Math.random() * 999999) + 1)).toString())
- .then(function (success) {
- $ionicLoading.hide();
- //console.log(success);
- $rootScope.authSession = success;
- NVRDataModel.log("Stream authentication construction: " +
- $rootScope.authSession);
- $timeout(function () {
- initPackery();
- }, zm.packeryTimer);
-
- },
- function (error) {
-
- $ionicLoading.hide();
- NVRDataModel.debug("MontageCtrl: Error in authkey retrieval " + error);
- //$rootScope.authSession="";
- NVRDataModel.log("MontageCtrl: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession);
- $timeout(function () {
- initPackery();
- }, zm.packeryTimer);
- });
+ $timeout(function () {
+ initPackery();
+ }, zm.packeryTimer);
//console.log("**VIEW ** Montage Ctrl AFTER ENTER");
window.addEventListener("resize", orientationChanged, false);
@@ -1930,21 +1930,10 @@ angular.module('zmApp.controllers')
$scope.$on('$ionicView.beforeLeave', function () {
- if ($rootScope.platformOS == 'ios') {
- // we need to force a window stop thanks to the webkit streaming bug
- areStreamsStopped = true;
- $timeout (function() {NVRDataModel.stopNetwork();viewCleaned = true;});
-
-
- } else {
-
- areStreamsStopped = true;
+ currentStreamState = streamState.STOPPED;
viewCleanup();
viewCleaned = true;
-
- }
-
});
$scope.$on('$ionicView.unloaded', function () {
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js
index e87b63be..5333581e 100644
--- a/www/js/MontageHistoryCtrl.js
+++ b/www/js/MontageHistoryCtrl.js
@@ -794,6 +794,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
NVRDataModel.debug("Montage History View Cleanup was already done, skipping");
return;
}
+
+
$interval.cancel($rootScope.eventQueryInterval);
if (pckry) pckry.destroy();
@@ -802,15 +804,16 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
areStreamsStopped = true;
- $timeout(function () {
-
- NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
- for (i = 0; i < $scope.MontageMonitors.length; i++) {
- if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show' && $scope.MontageMonitors[i].Monitor.eventUrl != 'img/noevent.png') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL,$scope.MontageMonitors[i].Monitor.Name);
+ $timeout(function () {
- }
+ NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
+ for (var i = 0; i < $scope.MontageMonitors.length; i++) {
+ if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show' && $scope.MontageMonitors[i].Monitor.eventUrl != 'img/noevent.png') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL,$scope.MontageMonitors[i].Monitor.Name);
+
+ }
+
+ });
- });
}
function onResume() {
@@ -859,7 +862,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
pckry.destroy();
window.removeEventListener("resize", orientationChanged, false);
//NVRDataModel.log("Forcing a window.stop() here");
- NVRDataModel.stopNetwork("MontageHistory-beforeLeave");
+ //NVRDataModel.stopNetwork("MontageHistory-beforeLeave");
});
$scope.$on('$ionicView.unloaded', function () {});
@@ -1069,7 +1072,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
// $scope.MontageMonitors = message;
- isMultiPort = NVRDataModel.getCurrentServerMultiPortSupported();
+ isMultiPort = NVRDataModel.getCurrentServerMultiPortSupported() && !NVRDataModel.getLogin().disableSimulStreaming;
// don't do this - we are simulstreaming in this view
@@ -1349,7 +1352,9 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
$scope.LoginData = NVRDataModel.getLogin();
$scope.monLimit = $scope.LoginData.maxMontage;
$scope.currentLimit = $scope.LoginData.maxMontage;
- if (!isMultiPort) {
+ ld = NVRDataModel.getLogin();
+
+ if (!isMultiPort || ld.disableSimulStreaming) {
NVRDataModel.log("Limiting montage to 5, thanks to max connection per domain limit");
$scope.currentLimit = 5;
@@ -1359,7 +1364,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
NVRDataModel.log("You have multiport on, so no montage limits");
}
- ld = NVRDataModel.getLogin();
+
$timeout(function () {
// initPackery();
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index bdc3fffe..ef02c99a 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -238,7 +238,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
NVRDataModel.hrsSinceChecked("zmVersion")
.then (function (val) {
- if (val >=24) {
+ if (val >=zm.zmVersionCheckNag) {
NVRDataModel.updateHrsSinceChecked("zmVersion");
$state.go('app.importantmessage',
{
diff --git a/www/js/app.js b/www/js/app.js
index 0d1aa741..1258464f 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -107,7 +107,7 @@ angular.module('zmApp', [
thumbWidth:200,
alarmStatusTime: 10000,
eventServerErrorDelay:5000, // time to wait till I report initial connect errors
-
+ zmVersionCheckNag: 15 * 24 // in hrs
})
@@ -916,7 +916,7 @@ angular.module('zmApp', [
function doLogoutAndLogin(str) {
return NVRDataModel.logout()
- .finally(function(ans) {
+ .then(function(ans) {
doLogin(str);
});
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index 0de81d90..4cb432a3 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -67,8 +67,8 @@
"kDisableNativeSub" :"Enable if the menu is freezing",
"kDisablePush" :"disable APNS/GCM",
"kDisableSamsung" :"If you are on a samsung device and are facing input issues, please temporarily disable auto-correction",
- "kDisableSimulStreaming" :"Disable Montage real-time streaming",
- "kDisableSimulStreamingNote" :"(always disabled in iOS)",
+ "kDisableSimulStreaming" :"Ignore ZM 1.32.0 multi-port",
+ "kDisableSimulStreamingNote" :"(disabling in iOS may cause issues)",
"kDiscovering" :"discovering",
"kDiscoveringAPI" :"discovering api",
"kDiscoveringCGI" :"discovering cgi",
diff --git a/www/lang/locale-pl.json b/www/lang/locale-pl.json
index 44f897ef..bbdad7a9 100644
--- a/www/lang/locale-pl.json
+++ b/www/lang/locale-pl.json
@@ -107,6 +107,7 @@
"kEventRecording" :"Nagrywanie Zdarzenia",
"kEventServer" :"Serwer Zdarzeń",
"kEventServerConfig1" :"Upewnij się, że ustawienia ZM są skonfigurowane i zapisane zanim zaczniesz konfigurować Serwer Zdarzeń",
+ "kEventServerConnErr" :"błąd połączenia serwera Zdarzeń",
"kEventServerNotLoggedIn" :"Nie jesteś zalogowany. Upewnij się, że jesteś poprawnie zalogowany (zapisz dane logowania i upewnij się, że logowanie się powiodło)",
"kEventServerVersionBody1" :"Używasz wersji",
"kEventServerVersionBody2" :"Aktualizuj do",
@@ -165,7 +166,7 @@
"kImpMsg1" :"Ważna Wiadomość",
"kImpMsg2" :"Będę wdzięczny jeśli aktualizujesz ZoneMinder",
"kImpMsg3" :"Działasz na",
- "kImpMsg4" :"posiada ważne poprawki poprawiające pracę API z innymi funkcjami. Jest to niezbędne do działania nowych alarmów API i innych funkcji",
+ "kImpMsg4" :"posiada ważne zmiany poprawiające funkcjonalność, oraz wprowadza poprawki funkcji od których zależy działanie tej wersji zmNinja. Aplikacja będzie nadal pracować, lecz działanie niektórych funkcji może być nieprzewidywalne",
"kImpMsg5" :"Zgłoszona Wersja",
"kImpMsg6" :"Rekomendowana Wersja",
"kImpMsg7" :"Ok, załapałem",
@@ -275,6 +276,7 @@
"kPlaceHolderBasicAuthUser" :"użytkownik zwykłego uwierzytelniania",
"kPlaceHolderZMAuthPass" :"hasło uwierzytelniania ZM",
"kPlaceHolderZMAuthUser" :"użytkownik uwierzytelniania ZM",
+ "kPlay" :"Graj",
"kPlaybackInterval" :"Interwał Odtwarzania",
"kPleaseAuthenticate" :"Uwierzytelnij",
"kPleaseCheckCredentials" :"Sprawdź dane logowania",
@@ -390,9 +392,10 @@
"kUseSSL" :"Użyj SSL",
"kUseVideoControls" :"Użyj przełączników wideo odtwarzacza dla Zdarzeń H264. ZoneMinder jeszcze nie wspiera przełączników zms",
"kUseZmAuth" :"Użyj uwierzytelniania ZM",
+ "kUseBasicAuth" :"użyj prostego uwierzytelniania",
"kUserName" :"nazwa użytkownika",
- "kValidNameBasicAuth" :"Wprowadź włąściwego użytkownika i hasło dla prostego uwierzytelniania",
- "kValidNameZMAuth" :"Wprowadź włąściwego użytkownika i hasło dla uwierzytelniania ZM",
+ "kValidNameBasicAuth" :"Wprowadź właściwego użytkownika i hasło dla prostego uwierzytelniania",
+ "kValidNameZMAuth" :"Wprowadź właściwego użytkownika i hasło dla uwierzytelniania ZM",
"kVersion" :"Wersja",
"kVersionIncompatible" :"Jestem niekompatybilny z wersją Twojego ZoneMinder'a",
"kVibrateOnPush" :"Wibruj przy dotknięciu",
diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html
index 61076042..c7a132d8 100644
--- a/www/templates/devoptions.html
+++ b/www/templates/devoptions.html
@@ -155,7 +155,7 @@
</ion-toggle>
</label>
- <label>
+ <label ng-if="isMultiPort">
<ion-toggle ng-model="loginData.disableSimulStreaming" ng-checked="loginData.disableSimulStreaming"
ng-change="checkMultiPortToggle()" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kDisableSimulStreaming' | translate}}
<p ng-if="$root.platformOS=='ios'">{{'kDisableSimulStreamingNote' | translate}}</p>
diff --git a/www/templates/menu.html b/www/templates/menu.html
index 16b8a138..3337673f 100644
--- a/www/templates/menu.html
+++ b/www/templates/menu.html
@@ -1,3 +1,4 @@
+<div ng-controller="MenuController">
<ion-side-menus delegate-handle="sideMenu" ng-cloak>
<ion-side-menu-content>
<ion-nav-bar class="bar-stable nav-title-slide-ios7">
@@ -14,48 +15,50 @@
<ion-content has-header="true" mouse-wheel-scroll>
<!-- <ion-scroll scrollbar-y="false" style="height:100%" >-->
<ion-list>
- <ion-item href="#/app/montage" menu-close>
+ <ion-item ng-click="navigateView('app.montage')" menu-close>
<!--<span ng-if="$root.runMode=='lowbw'" style="float:right;margin-top:-18px;background-color:#f1c40f;color:#000;font-size:11px;opacity:0.7;width:20px;border-radius: 0px 0px 5px 5px;display:inline-block;text-align:center;">&nbsp;<i class="icon ion-arrow-graph-down-left"></i>&nbsp;</span>-->
<span class=" item-icon-left">
<i class="icon ion-grid"></i>
</span>{{'kMenuMontage'|translate}}
</ion-item>
- <ion-item href="#/app/timeline" menu-close>
+ <ion-item ng-click="navigateView('app.timeline')" menu-close>
<span class=" item-icon-left">
<i class="icon ion-android-time"></i>
</span>{{'kMenuTimeline'|translate}}
</ion-item>
- <ion-item href="#/app/events/0/false" menu-close>
+ <ion-item ng-click="navigateView('app.events', {id:0,playEvent:false})" menu-close>
<span class=" item-icon-left">
<i class="icon ion-ios-calendar-outline"></i>
</span>{{'kMenuEvents'|translate}}
</ion-item>
- <ion-item href="#/app/moment" menu-close>
+ <ion-item ng-click="navigateView('app.moment')" menu-close>
<span class=" item-icon-left">
<i class="icon ion-star"></i>
</span>{{'kMoment24Heading'|translate}}
</ion-item>
- <ion-item href="#/app/montage-history" menu-close>
+ <ion-item ng-click="navigateView('app.montage-history')" menu-close>
<span class=" item-icon-left">
<i class="icon ion-ios-keypad-outline"></i>
</span>{{'kMenuEventMontage'|translate}}
</ion-item>
- <ion-item href="#/app/monitors" menu-close>
+ <ion-item ng-click="navigateView('app.monitors')" menu-close>
<span class=" item-icon-left">
<i class="icon ion-ios-videocam-outline"></i>
</span>{{'kMenuMonitors'|translate}}
</ion-item>
- <ion-item href="#/app/state" menu-close>
+
+ <ion-item ng-click="navigateView('app.state')" menu-close>
<span class=" item-icon-left">
<i class="icon ion-information-circled"></i>
</span> {{'kMenuSystemStatus'|translate}}
</ion-item>
- <ion-item nav-clear menu-close href="#/app/login/false">
+
+ <ion-item nav-clear menu-close ng-click="navigateView('app.login', {wizard:false})" >
<span class=" item-icon-left">
<i class="icon ion-person"></i>
{{'kMenuZMSettings'|translate}}
@@ -65,36 +68,37 @@
<span style="float:right; margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;text-align:center;">&nbsp;{{$root.getProfileName();}}&nbsp;</span>
</span>
</ion-item>
- <ion-item nav-clear menu-close href="#/app/devoptions">
+ <ion-item nav-clear menu-close ng-click="navigateView('app.devoptions')">
<span class=" item-icon-left">
<i class="icon ion-settings"></i>
</span> {{'kMenuDevSettings'|translate}}
</ion-item>
- <div ng-controller="MenuController">
- <ion-item ng-click="switchLang()" nav-clear menu-close href="">
+
+ <ion-item ng-click="switchLang()" nav-clear menu-close>
<span class=" item-icon-left">
<i class="icon ion-earth"></i>
</span> {{'kLanguage'|translate}}
</ion-item>
- </div>
- <ion-item nav-clear menu-close href="#/app/help">
+
+ <ion-item nav-clear menu-close ng-click="navigateView('app.help')" >
<span class=" item-icon-left">
<i class="icon ion-help"></i>
</span> {{'kMenuHelp'|translate}}
</ion-item>
- <ion-item nav-clear menu-close href="#/app/wizard">
+ <ion-item nav-clear menu-close ng-click="navigateView('app.wizard')" >
<span class=" item-icon-left">
<i class="icon ion-wand"></i>
</span> {{'kMenuWizard'|translate}}
</ion-item>
+
<div ng-if="$root.showBlog">
- <ion-item nav-clear menu-close href="#/app/news">
+ <ion-item nav-clear menu-close ng-click="navigateView('app.news')" >
<span class=" item-icon-left">
<i class="icon ion-radio-waves"></i>
</span>{{'kMenuNews'|translate}}<span style="color:#268d3a;"> {{$root.newBlogPost}}</span>
</ion-item>
</div>
- <ion-item nav-clear menu-close href="#/app/log">
+ <ion-item nav-clear menu-close ng-click="navigateView('app.log')" >
<span class=" item-icon-left">
<i class="icon ion-clipboard"></i>
</span> {{'kMenuLogs'|translate}}
@@ -122,4 +126,5 @@
<!--</ion-scroll>-->
</ion-content>
</ion-side-menu>
-</ion-side-menus> \ No newline at end of file
+</ion-side-menus>
+</div>
diff --git a/www/templates/montage.html b/www/templates/montage.html
index 5952ad9e..cc265e84 100644
--- a/www/templates/montage.html
+++ b/www/templates/montage.html
@@ -47,7 +47,7 @@
<a href="" ng-click="squeezeMonitors()"> <i class="ion-android-apps"></i></a>
</li>
- <li ng-if="!isDragabillyOn">
+ <li ng-style="{'background-color': isCycleOn()?'rgba(69, 170, 242,0.7)':'rgba(108, 122, 137, 0.7)'}" ng-if="!isDragabillyOn">
<a href="" ng-click="toggleCycle()"> <i class="ion-android-bicycle"></i>:{{getCycleStatus()}}</a>
</li>
@@ -101,7 +101,7 @@
<figure class="{{dragBorder}}" ng-show="monitor.Monitor.listDisplay!='noshow'">
<!--<div ng-if="!isModalActive" >-->
<!--<div ng-if="$root.authSession!='undefined' && !isBackground() && !areImagesLoading">-->
- <div ng-if="$root.authSession!='undefined' && $root.authSession!=''">
+
<div ng-if = "!minimal" >
<img class="{{monitor.Monitor.selectStyle}}" id="img-{{$index}}" image-spinner-src="{{constructStream(monitor)}}" ng-click="!isDragabillyOn?openModal(monitor.Monitor.Id, monitor.Monitor.Controllable, monitor.Monitor.ControlId, monitor.Monitor.connKey,monitor):toggleSelectItem(monitor.Monitor.Id);" image-spinner-loader="lines" img-spinner-w="{{monitor.Monitor.Width}}" img-spinner-h="{{monitor.Monitor.Height}}" />
@@ -111,7 +111,7 @@
<div ng-if = "minimal">
<img id="img-{{$index}}" image-spinner-src="{{constructStream(monitor)}}" ng-click="!isDragabillyOn?openModal(monitor.Monitor.Id, monitor.Monitor.Controllable, monitor.Monitor.ControlId, monitor.Monitor.connKey,monitor):toggleSelectItem(monitor.Monitor.Id);" image-spinner-loader="lines" img-spinner-w="{{monitor.Monitor.Width}}" img-spinner-h="{{monitor.Monitor.Height}}" />
</div>
- </div>
+