Explorar o código

AMBARI-3044 Ambari Suddenly Clears Entry For Services/Components Configuration. (atkach)

atkach %!s(int64=11) %!d(string=hai) anos
pai
achega
c8e2dec2fa

+ 4 - 2
ambari-web/app/controllers/main.js

@@ -89,9 +89,11 @@ App.MainController = Em.Controller.extend({
 
     this.set('reloadTimeOut',
         setTimeout(function () {
-          location.reload()
+          if (App.clusterStatus.get('isInstalled')) {
+            location.reload();
+          }
         }, App.pageReloadTime)
     );
-  }.observes("App.router.location.lastSetURL")
+  }.observes("App.router.location.lastSetURL", "App.clusterStatus.isInstalled")
 
 })

+ 4 - 0
ambari-web/app/models/cluster_states.js

@@ -28,6 +28,10 @@ App.clusterStatus = Ember.Object.create({
   wizardControllerName: null,
   localdb: null,
   key: 'CLUSTER_CURRENT_STATUS',
+  isInstalled: function(){
+    var notInstalledStates = ['CLUSTER_NOT_CREATED_1', 'CLUSTER_DEPLOY_PREP_2', 'CLUSTER_INSTALLING_3', 'SERVICE_STARTING_3'];
+    return !notInstalledStates.contains(this.get('clusterState'));
+  }.property('clusterState'),
   /**
    * get cluster data from server and update cluster status
    * @param isAsync: set this to true if the call is to be made asynchronously.  if unspecified, false is assumed