Updated Branches:
  refs/heads/trunk 735628b72 -> e17c52989

AMBARI-3235. HDFS Summary "Upgrade Status" and "Safe Mode Status" are always 
shown even when HDFS is down. (xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/e17c5298
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/e17c5298
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/e17c5298

Branch: refs/heads/trunk
Commit: e17c529897a9b512e5e14e26d395cda195d58f1b
Parents: 735628b
Author: Yusaku Sako <[email protected]>
Authored: Fri Sep 13 15:54:34 2013 -0700
Committer: Yusaku Sako <[email protected]>
Committed: Fri Sep 13 15:54:34 2013 -0700

----------------------------------------------------------------------
 .../templates/main/dashboard/service/hdfs.hbs   | 12 ++--------
 .../app/views/main/dashboard/service/hdfs.js    | 23 +++++++++++++++++---
 2 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/e17c5298/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs 
b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
index 2a7928b..7794ffd 100644
--- a/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
+++ b/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
@@ -118,22 +118,14 @@
       <tr>
         <td>{{t services.service.summary.pendingUpgradeStatus}}</td>
         <td>
-          {{#if view.service.upgradeStatus}}
-            {{t services.service.summary.pendingUpgradeStatus.notPending}}
-          {{else}}
-            {{t services.service.summary.pendingUpgradeStatus.pending}}
-          {{/if}}
+          {{view.upgradeStatus}}
         </td>
       </tr>
       <!-- Safe Mode Status -->
       <tr>
         <td>{{t services.service.summary.safeModeStatus}}</td>
         <td>
-          {{#if view.isSafeMode}}
-            {{t services.service.summary.safeModeStatus.inSafeMode}}
-          {{else}}
-            {{t services.service.summary.safeModeStatus.notInSafeMode}}
-          {{/if}}
+          {{view.safeModeStatus}}
         </td>
       </tr>
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/e17c5298/ambari-web/app/views/main/dashboard/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js 
b/ambari-web/app/views/main/dashboard/service/hdfs.js
index 863b807..8d73e35 100644
--- a/ambari-web/app/views/main/dashboard/service/hdfs.js
+++ b/ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -218,8 +218,25 @@ App.MainDashboardServiceHdfsView = 
App.MainDashboardServiceView.extend({
     return App.HostComponent.find().findProperty('componentName', 
'JOURNALNODE');
   }.property(),
 
-  isSafeMode: function () {
+  safeModeStatus: function () {
     var safeMode = this.get('service.safeModeStatus');
-    return safeMode != null && safeMode.length > 0;
-  }.property('service.safeModeStatus')
+    if (safeMode == null) {
+      return Em.I18n.t("services.service.summary.notAvailable");
+    } else if (safeMode.length == 0) {
+      return 
Em.I18n.t("services.service.summary.safeModeStatus.notInSafeMode");
+    } else {
+      return Em.I18n.t("services.service.summary.safeModeStatus.inSafeMode");
+    }
+  }.property('service.safeModeStatus'),
+  upgradeStatus: function () {
+    var upgradeStatus = this.get('service.upgradeStatus');
+    var healthStatus = this.get('service.healthStatus');
+    if (upgradeStatus) {
+      return 
Em.I18n.t('services.service.summary.pendingUpgradeStatus.notPending');
+    } else if (healthStatus == 'green') {
+      return 
Em.I18n.t('services.service.summary.pendingUpgradeStatus.pending');
+    } else {
+      return Em.I18n.t("services.service.summary.notAvailable");
+    }
+  }.property('service.upgradeStatus', 'service.healthStatus')
 });

Reply via email to