Author: yusaku
Date: Fri Jan 11 01:57:12 2013
New Revision: 1431804

URL: http://svn.apache.org/viewvc?rev=1431804&view=rev
Log:
AMBARI-1115. Host component live status is broken. (Srimanth Gunturi via yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/models/host_component.js
    incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1431804&r1=1431803&r2=1431804&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Jan 11 01:57:12 2013
@@ -675,6 +675,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1115. Host component live status is broken. (Srimanth Gunturi via
+  yusaku)
+
   AMBARI-1113. Install Wizard: Confirm host stuck at Preparing stage.
   (Arun Kandregula via yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/models/host_component.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/host_component.js?rev=1431804&r1=1431803&r2=1431804&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host_component.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host_component.js Fri Jan 11 
01:57:12 2013
@@ -90,6 +90,8 @@ App.HostComponent.Status = {
   starting: "STARTING",
   stopped: "INSTALLED",
   stopping: "STOPPING",
+  stop_failed: "STOP_FAILED",
+  start_failed: "START_FAILED",
 
   getKeyName:function(value){
     switch(value){
@@ -101,6 +103,10 @@ App.HostComponent.Status = {
         return 'installed';
       case this.stopping:
         return 'stopping';
+      case this.stop_failed:
+        return 'stop_failed';
+      case this.start_failed:
+        return 'start_failed';
     }
     return 'none';
   }

Modified: incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js?rev=1431804&r1=1431803&r2=1431804&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/host/summary.js Fri Jan 11 
01:57:12 2013
@@ -122,7 +122,23 @@ App.MainHostSummaryView = Em.View.extend
 
   ComponentView: Em.View.extend({
     content: null,
-
+    hostComponent: function(){
+      var hostComponent = null;
+      var serviceComponent = this.get('content');
+      var host = App.router.get('mainHostDetailsController.content');
+      if(host){
+        var hostComponent = 
host.get('hostComponents').findProperty('componentName', 
serviceComponent.get('componentName'));
+      }
+      return hostComponent;
+    }.property('content', 'App.router.mainHostDetailsController.content'),
+    workStatus: function(){
+      var workStatus = this.get('content.workStatus');
+      var hostComponent = this.get('hostComponent');
+      if(hostComponent){
+        workStatus = hostComponent.get('workStatus');
+      }
+      return workStatus;
+    }.property('content.workStatus', 'hostComponent.workStatus'),
     statusClass: function(){
       var statusClass = null;
       if(this.get('isDataNode')){
@@ -131,24 +147,24 @@ App.MainHostSummaryView = Em.View.extend
           return 'health-status-DEAD-ORANGE';
         }
       }
-      return 'health-status-' + 
App.Component.Status.getKeyName(this.get('content.workStatus'));
-    }.property('content.workStatus'),
+      return 'health-status-' + 
App.Component.Status.getKeyName(this.get('workStatus'));
+    }.property('workStatus'),
     /**
      * Disable element while component is starting/stopping
      */
     disabledClass:function(){
-      var workStatus = this.get('content.workStatus');
+      var workStatus = this.get('workStatus');
       if([App.Component.Status.starting, 
App.Component.Status.stopping].contains(workStatus) ){
         return 'disabled';
       } else {
         return '';
       }
-    }.property('content.workStatus'),
+    }.property('workStatus'),
     /**
      * Do blinking for 1 minute
      */
     doBlinking : function(){
-      var workStatus = this.get('content.workStatus');
+      var workStatus = this.get('workStatus');
       var self = this;
       var pulsate = [ App.Component.Status.starting, 
App.Component.Status.stopping ].contains(workStatus);
       if (!pulsate && this.get('isDataNode')) {
@@ -167,11 +183,11 @@ App.MainHostSummaryView = Em.View.extend
      */
     startBlinking:function(){
       this.doBlinking();
-    }.observes('content.workStatus'),
+    }.observes('workStatus'),
 
     isStart : function() {
-      return (this.get('content.workStatus') === App.Component.Status.started 
|| this.get('content.workStatus') === App.Component.Status.starting);
-    }.property('content.workStatus'),
+      return (this.get('workStatus') === App.Component.Status.started || 
this.get('workStatus') === App.Component.Status.starting);
+    }.property('workStatus'),
     /**
      * Shows whether we need to show Decommision/Recomission buttons
      */


Reply via email to