From cc68fd22ee02d68b9ac200dd3f02e329ace54314 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 21 Jul 2018 21:08:31 -0400 Subject: nits --- docs/uihelp.md | 0 www/js/MontageCtrl.js | 26 ++++++++++++++++++++++++++ www/js/WizardCtrl.js | 8 +++++++- www/js/app.js | 7 ++++--- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 docs/uihelp.md diff --git a/docs/uihelp.md b/docs/uihelp.md new file mode 100644 index 00000000..e69de29b diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index ee34a1b3..d9eb1409 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -11,6 +11,7 @@ angular.module('zmApp.controllers') // Controller main //--------------------------------------------------------------------- + var timeInMontage = new Date(); var intervalHandleMontage; // image re-load handler var intervalHandleAlarmStatus; // status of each alarm state var intervalHandleMontageCycle; @@ -47,6 +48,30 @@ angular.module('zmApp.controllers') var as = $scope.$on("auth-success", function () { + /* var tnow = new Date(); + var s = Math.round((tnow - timeInMontage) / 1000); + NVRDataModel.debug ("Montage re-auth: time since we are here: " + s + + " seconds"); + if (s >= 20) {// lets not regen connkey if we just got into montage + NVRDataModel.debug ("Montage-reauth: Regenerating connkeys"); + $timeout(function () { // after render + if (simulStreaming) { + NVRDataModel.debug("Re-creating all stream connkeys in montage ..."); + NVRDataModel.regenConnKeys(); + $scope.monitors = NVRDataModel.getMonitorsNow(); + $scope.MontageMonitors = angular.copy($scope.monitors); + $timeout(function () // after render + { + initPackery(); + }, zm.packeryTimer); + + + } + }); + } + else { + NVRDataModel.debug ("Montage re-auth: ignoring as time is only "+s+" seconds"); + }*/ // do nothing, we are reloading here anyway? /* if ($scope.singleMonitorModalOpen) { @@ -1765,6 +1790,7 @@ angular.module('zmApp.controllers') // minimal has to be beforeEnter or header won't hide $scope.$on('$ionicView.beforeEnter', function () { + timeInMontage = new Date(); broadcastHandles = []; randToAvoidCacheMem = new Date().getTime(); currentStreamState = streamState.SNAPSHOT; diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 20029ed1..6ce8ea1b 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -138,10 +138,12 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ // this is actually a success - I might get empty status // or something if (err.status < 300) { - NVRDataModel.log("I am taking this as a cgi-bin success - " + urls[0]); + NVRDataModel.log("A 2xx is a success, I think - " + urls[0]); d.resolve(urls[0]); return d.promise; } + + return findFirstReachableUrl(urls.slice(1), tail); }); } else { @@ -392,6 +394,10 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ // tries to log into the portal and then discover api and cgi-bin //-------------------------------------------------------------------------- + function validateDataNewAPI() { + + } + function validateData() { $rootScope.authSession = 'undefined'; $rootScope.zmCookie = ''; diff --git a/www/js/app.js b/www/js/app.js index ec757b47..87f40674 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -92,9 +92,10 @@ angular.module('zmApp', [ minCycleTime: 5, loginInterval: 1800000, //30m*60s*1000 - ZM auto login after 30 mins - //loginInterval: 20000, + //loginInterval: 60000, // testing 1 min eventPlaybackQueryLowBW: 6000, loginIntervalLowBW: 1800000, //30m login + eventSingleImageQualityLowBW: 70, monSingleImageQualityLowBW: 70, montageQualityLowBW: 50, @@ -1636,8 +1637,8 @@ angular.module('zmApp', [ if ($rootScope.apiValid == false && toState.name != 'app.invalidapi' && toState.data.requireLogin == true) { event.preventDefault(); - $rootScope.dpadState = "invalidapi"; - $state.transitionTo('invalidapi'); + $rootScope.dpadState = "app.invalidapi"; + $state.transitionTo('app.invalidapi'); return; } -- cgit v1.2.3