summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rwxr-xr-xwww/js/DataModel.js14
-rw-r--r--www/js/MontageCtrl.js14
-rwxr-xr-xwww/js/app.js30
3 files changed, 50 insertions, 8 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index efa18634..e138fd72 100755
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -38,6 +38,10 @@ angular.module('zmApp.controllers')
value: 'ar'
},
{
+ text: 'Deutsch',
+ value: 'de'
+ },
+ {
text: 'Español',
value: 'es'
},
@@ -46,16 +50,16 @@ angular.module('zmApp.controllers')
text: 'Français',
value: 'fr'
},
-
- {
- text: 'Deutsch',
- value: 'de'
- },
+
{
text: 'Italiano',
value: 'it'
},
{
+ text:'Magyar',
+ value:'hu'
+ },
+ {
text: 'Nederlands',
value: 'nl'
},
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 027cd052..d1185a8c 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -25,6 +25,11 @@ angular.module('zmApp.controllers')
var ld;
var refreshSec;
+ $rootScope.$on("auth-success", function () {
+ NVRDataModel.debug("REAUTH");
+ console.log ("RETAUTH");
+ NVRDataModel.stopNetwork();
+ });
//--------------------------------------------------------------------------------------
@@ -495,6 +500,12 @@ angular.module('zmApp.controllers')
});
}
+ function randEachTime() {
+ $scope.randToAvoidCacheMem = new Date().getTime();
+ //$scope.randToAvoidCacheMem = "1";
+ console.log ("Generating:"+$scope.randToAvoidCacheMem);
+ }
+
//-----------------------------------------------------------------------
// re-compute rand so snapshot in montage reloads
//-----------------------------------------------------------------------
@@ -502,6 +513,9 @@ angular.module('zmApp.controllers')
function loadNotifications()
{
+ randEachTime();
+ console.log ($scope.randToAvoidCacheMem);
+
if ($scope.areImagesLoading)
{
NVRDataModel.debug("skipping image refresh, packery is still loading");
diff --git a/www/js/app.js b/www/js/app.js
index 86986db2..34e9343e 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -49,7 +49,8 @@ angular.module('zmApp', [
logFile: 'zmNinjaLog.txt',
authoremail: 'pliablepixels+zmNinja@gmail.com',
logFileMaxSize: 20000, // after this limit log gets reset
- loginInterval: 300000, //5m*60s*1000 - ZM auto login after 5 mins
+ //loginInterval: 300000, //5m*60s*1000 - ZM auto login after 5 mins
+ loginInterval: 1800000, //30m*60s*1000 - ZM auto login after 30 mins
//loginInterval: 30000,
updateCheckInterval: 86400000, // 24 hrs
@@ -90,7 +91,7 @@ angular.module('zmApp', [
minCycleTime: 5,
eventPlaybackQueryLowBW: 6000,
- loginIntervalLowBW: 600000, //10m login
+ loginIntervalLowBW: 1800000, //30m login
eventSingleImageQualityLowBW: 70,
monSingleImageQualityLowBW: 70,
montageQualityLowBW: 50,
@@ -592,6 +593,17 @@ angular.module('zmApp', [
// console.log ("No cookie present in " + config.url);
}
+ if ($rootScope.apiAuth)
+ {
+ console.log ("********** API AUTH");
+ if (config.url.indexOf("/api/") > -1 )
+ {
+ config.url = config.url + "&auth="+$rootScope.authSession;
+ console.log ("********** API AUTH muggled to:"+config.url);
+
+ }
+ }
+
if ((config.url.indexOf("/api/states/change/") > -1) ||
(config.url.indexOf("getDiskPercent.json") > -1) ||
(config.url.indexOf("daemonCheck.json") > -1) ||
@@ -610,6 +622,7 @@ angular.module('zmApp', [
// config.timeout = zm.httpTimeout;
}
+
return config;
},
@@ -841,7 +854,17 @@ angular.module('zmApp', [
var d = $q.defer();
var ld = NVRDataModel.getLogin();
+
+ /*$rootScope.authSession = 'Test';
+ $rootScope.apiAuth = true;
+ d.resolve ("Login Success");
+ $rootScope.loggedIntoZm = 1;
+ $rootScope.$emit('auth-success', 'hash API mode');
+
console.log(">>>>>>>>>>> DO LOGIN");
+ if (1) {return (d.promise);}*/
+
+
NVRDataModel.processFastLogin()
@@ -1817,7 +1840,7 @@ angular.module('zmApp', [
//$translateProvider.useLocalStorage();
- $translateProvider.registerAvailableLanguageKeys(['en', 'de', 'es', 'fr', 'it', 'ru', 'ja', 'ko', 'nl', 'pl', 'zh', 'zh_CN', 'zh_TW', 'pt', 'ar', 'hi'], {
+ $translateProvider.registerAvailableLanguageKeys(['en', 'de', 'es', 'fr', 'it', 'ru', 'ja', 'ko', 'nl', 'pl', 'zh', 'zh_CN', 'zh_TW', 'pt', 'ar', 'hi', 'hu'], {
'en_*': 'en',
'de_*': 'de',
'es_*': 'es',
@@ -1831,6 +1854,7 @@ angular.module('zmApp', [
'pl_*': 'pl',
'ar_*': 'ar',
'hi_*': 'hi',
+ 'hu_*':'hu',
'*': 'en' // must be last
});