summaryrefslogtreecommitdiff
path: root/www/js/NVR.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@users.noreply.github.com>2019-08-20 14:26:41 -0400
committerGitHub <noreply@github.com>2019-08-20 14:26:41 -0400
commitbd93725082aee41a342cd27f6df73dbf289a9608 (patch)
tree66251ee4b16970d5bc991c55263d65eb49ab1ef6 /www/js/NVR.js
parentb36c596f4350ba7e8772044c6601ca5404de1dde (diff)
parentf11b5e9416d808ce92480c164dce389e233609df (diff)
Merge pull request #843 from pliablepixels/what-a-login-mess
What a login mess
Diffstat (limited to 'www/js/NVR.js')
-rw-r--r--www/js/NVR.js39
1 files changed, 31 insertions, 8 deletions
diff --git a/www/js/NVR.js b/www/js/NVR.js
index 0f5a0656..d785683a 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -21,7 +21,7 @@ angular.module('zmApp.controllers')
DO NOT TOUCH zmAppVersion
It is changed by sync_version.sh
*/
- var zmAppVersion = "1.3.074";
+ var zmAppVersion = "1.3.075";
var isBackground = false;
var justResumed = false;
var timeSinceResumed = -1;
@@ -399,7 +399,9 @@ angular.module('zmApp.controllers')
var httpDelay = loginData.enableSlowLoading ? zm.largeHttpTimeout : zm.httpTimeout;
- str = $translate.instant('kAuthenticating');
+ str = "<a style='color:white; text-decoration:none' href='#' ng-click='$root.cancelAuth()' <i class='ion-close-circled'></i>&nbsp;" + $translate.instant('kAuthenticating')+"</a>";
+
+
if (str) {
$ionicLoading.show({
@@ -590,16 +592,23 @@ angular.module('zmApp.controllers')
function loginWebScrape(noBroadcast) {
var d = $q.defer();
+ if ($rootScope.userCancelledAuth) {
+ debug ('NVR loginWebScrape: User cancelled auth, not proceeding');
+ d.reject(true);
+ return d.promise;
+ }
debug("Logging in using old web-scrape method");
$ionicLoading.show({
- template: $translate.instant('kAuthenticatingWebScrape'),
+
+ template: "<a style='color:white; text-decoration:none' href='#' ng-click='$root.cancelAuth()' <i class='ion-close-circled'></i>&nbsp;" + $translate.instant('kAuthenticatingWebScrape')+"</a>",
noBackdrop: true,
duration: httpDelay
});
-
+
+
var httpDelay = loginData.enableSlowLoading ? zm.largeHttpTimeout : zm.httpTimeout;
//NVR.debug ("*** AUTH LOGIN URL IS " + loginData.url);
@@ -1793,8 +1802,12 @@ angular.module('zmApp.controllers')
function findFirstReachableUrl(urls) {
if (urls.length > 0 && $rootScope.userCancelledAuth != true) {
+
+
+
$ionicLoading.show({
- template: $translate.instant('kTrying') + ' ' + urls[0].server
+ template: "<a style='color:white; text-decoration:none' href='#' ng-click='$root.cancelAuth()' <i class='ion-close-circled'></i>&nbsp;" + $translate.instant('kTrying')+ ' ' + urls[0].server+"</a>",
+ noBackdrop: true,
});
log("Reachability test.." + urls[0].url);
@@ -2958,9 +2971,10 @@ angular.module('zmApp.controllers')
}, diff_access * 60 * 1000);
- // console.log ("**************** TOKEN SET="+loginData.accessToken);
+
$rootScope.authSession = '&token='+loginData.accessToken;
d.resolve("Login success via access token");
+ console.log ("**************** TOKEN SET="+$rootScope.authSession);
if (!noBroadcast) $rootScope.$broadcast('auth-success', '' );
return d.promise;
}
@@ -3623,7 +3637,11 @@ angular.module('zmApp.controllers')
logout: function () {
var d = $q.defer();
-
+ if ($rootScope.userCancelledAuth) {
+ debug ('NVR logout: User cancelled auth, not proceeding');
+ d.reject(true);
+ return d.promise;
+ }
// always resolves
if (!loginData.isUseAuth || loginData.isTokenSupported) {
log("No need for logout!");
@@ -3631,8 +3649,13 @@ angular.module('zmApp.controllers')
return d.promise;
}
+
+ // $ionicLoading.show({ template: '<button class="button button-clear" style="line-height: normal; min-height: 0; min-width: 0;" ng-click="$root.cancel()"></button><i class="icon ion-chevron-up"></i> Loading...' });
+
+
$ionicLoading.show({
- template: $translate.instant('kCleaningUp'),
+ //template:$translate.instant('kCleaningUp'),
+ template: "<a style='color:white; text-decoration:none' href='#' ng-click='$root.cancelAuth()' <i class='ion-close-circled'></i>&nbsp;" + $translate.instant('kCleaningUp')+"</a>",
noBackdrop: true,
});