Bläddra i källkod

AMBARI-13443. Do not timeout when user is on wizard (rzang)

Richard Zang 9 år sedan
förälder
incheckning
082db1cc29

+ 7 - 1
ambari-web/app/controllers/main.js

@@ -227,7 +227,7 @@ App.MainController = Em.Controller.extend({
   checkActiveness: function() {
   checkActiveness: function() {
     var scope = App.router.get('mainController');
     var scope = App.router.get('mainController');
     //console.error("checkActiveness " + scope.get('lastUserActiveTime') + " : " + Date.now());
     //console.error("checkActiveness " + scope.get('lastUserActiveTime') + " : " + Date.now());
-    if (Date.now() - scope.get('lastUserActiveTime') > scope.get('userTimeOut')) {
+    if (Date.now() - scope.get('lastUserActiveTime') > scope.get('userTimeOut') && !scope.isOnWizard()) {
       scope.set('isUserActive', false);
       scope.set('isUserActive', false);
       //console.error("LOGOUT!");
       //console.error("LOGOUT!");
       scope.unbindActivityEventMonitors();
       scope.unbindActivityEventMonitors();
@@ -241,6 +241,12 @@ App.MainController = Em.Controller.extend({
     this.bindActivityEventMonitors();
     this.bindActivityEventMonitors();
   },
   },
 
 
+  isOnWizard: function() {
+    var isWizard = window.location.href.indexOf('/step') != -1;
+    var isUpgrade = window.location.href.indexOf('/stack/upgrade') != -1;
+    return isWizard || isUpgrade;
+  },
+
   bindActivityEventMonitors: function() {
   bindActivityEventMonitors: function() {
     $(window).bind('mousemove', this.keepActive);
     $(window).bind('mousemove', this.keepActive);
     $(window).bind('keypress', this.keepActive);
     $(window).bind('keypress', this.keepActive);

+ 2 - 2
ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js

@@ -311,8 +311,8 @@ describe('App.MainAdminStackAndUpgradeController', function() {
           value: '2.2',
           value: '2.2',
           label: 'HDP-2.2',
           label: 'HDP-2.2',
           type: 'ROLLING',
           type: 'ROLLING',
-          skipComponentFailures: false,
-          skipSCFailures: false
+          skipComponentFailures: 'false',
+          skipSCFailures: 'false'
         },
         },
         success: "runPreUpgradeCheckSuccess",
         success: "runPreUpgradeCheckSuccess",
         error: "runPreUpgradeCheckError"
         error: "runPreUpgradeCheckError"