You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/07/24 14:29:36 UTC

git commit: AMBARI-6593. Hide Enable RM HA button and menu option after enabling. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk bb9de63c7 -> 8ec953d69


AMBARI-6593. Hide Enable RM HA button and menu option after enabling. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 8ec953d69009272fe83d0d775dd43ddb9d9ac70b
Parents: bb9de63
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Jul 24 15:27:41 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Jul 24 15:29:07 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/app.js                               | 13 ++++++++++++-
 ambari-web/app/messages.js                          |  3 ++-
 .../app/templates/main/admin/highAvailability.hbs   | 16 +++++++++++-----
 ambari-web/app/views/main/service/item.js           |  2 +-
 4 files changed, 26 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ec953d6/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index de8dc5f..55d7b46 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -77,7 +77,7 @@ module.exports = Em.Application.create({
   }.property('currentStackVersionNumber'),
 
   /**
-   * If High Availability is enabled
+   * If NameNode High Availability is enabled
    * Based on <code>clusterStatus.isInstalled</code>, stack version, <code>SNameNode</code> availability
    *
    * @type {bool}
@@ -88,6 +88,17 @@ module.exports = Em.Application.create({
   }.property('router.clusterController.isLoaded', 'isHadoop2Stack'),
 
   /**
+   * If ResourceManager High Availability is enabled
+   * Based on number of ResourceManager components host components installed
+   *
+   * @type {bool}
+   */
+  isRMHaEnabled: function () {
+    if (!this.get('isHadoop2Stack')) return false;
+    return this.HostComponent.find().filterProperty('componentName', 'RESOURCEMANAGER').length > 1;
+  }.property('router.clusterController.isLoaded', 'isHadoop2Stack'),
+
+  /**
    * Object with utility functions for list of service names with similar behavior
    */
   services: Em.Object.create({

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ec953d6/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 739ea4e..b21b069 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -827,6 +827,7 @@ Em.I18n.translations = {
   'admin.highAvailability.disabled':'NameNode HA is disabled',
   'admin.highAvailability.enabled':'NameNode HA is enabled',
   'admin.rm_highAvailability.disabled':'ResourceManager HA is disabled',
+  'admin.rm_highAvailability.enabled':'ResourceManager HA is enabled',
   'admin.highAvailability.confirmRollbackHeader':'Confirm Rollback',
   'admin.highAvailability.confirmRollbackBody':'This will rollback all operations that were done in HA wizard',
   'admin.highAvailability.confirmManualRollbackBody':'You are in the process of enabling NameNode HA. If you exit now, you must follow manual instructions to revert back to the non-HA setup as documented in the Ambari User Guide\'s <i>Rolling Back NameNode HA</i> section.  Are you sure you want to exit the wizard?',
@@ -999,7 +1000,7 @@ Em.I18n.translations = {
   'admin.rm_highAvailability.wizard.step4.task2.title': 'Reconfigure YARN',
   'admin.rm_highAvailability.wizard.step4.task3.title': 'Start All Services',
   'admin.rm_highAvailability.wizard.step4.notice.inProgress':'Please wait while ResourceManager HA is being deployed.',
-  'admin.rm_highAvailability.wizard.step4.notice.completed':'NameNode HA has been enabled successfully.',
+  'admin.rm_highAvailability.wizard.step4.notice.completed':'ResourceManager HA has been enabled successfully.',
 
   'admin.security.title':'Kerberos security has not been enabled',
   'admin.security.enabled': 'Kerberos security is enabled',

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ec953d6/ambari-web/app/templates/main/admin/highAvailability.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability.hbs b/ambari-web/app/templates/main/admin/highAvailability.hbs
index d40e6a7..444f37e 100644
--- a/ambari-web/app/templates/main/admin/highAvailability.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability.hbs
@@ -40,11 +40,17 @@
     {{/if}}
   {{/if}}
   {{#if App.supports.resourceManagerHighAvailability}}
+    {{#if App.isRMHaEnabled}}
     <div class="rm-ha">
-      <p class="muted">
-        {{t admin.rm_highAvailability.disabled}}
-      </p>
-      <a class="btn btn-padding btn-success ha-btn" {{action enableRMHighAvailability target="controller"}}>{{t admin.rm_highAvailability.button.enable}}</a>
-    </div>
+        <p class="text-success">
+          {{t admin.rm_highAvailability.enabled}}
+        </p>
+    {{else}}
+        <p class="muted">
+          {{t admin.rm_highAvailability.disabled}}
+        </p>
+        <a class="btn btn-padding btn-success ha-btn" {{action enableRMHighAvailability target="controller"}}>{{t admin.rm_highAvailability.button.enable}}</a>
+    {{/if}}
+  </div>
   {{/if}}
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ec953d6/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index cd0bc0a..318c90a 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -78,7 +78,7 @@ App.MainServiceItemView = Em.View.extend({
         action: 'enableRMHighAvailability',
         label: Em.I18n.t('admin.rm_highAvailability.button.enable'),
         cssClass: 'icon-arrow-up',
-        isHidden: !App.get('supports.resourceManagerHighAvailability')
+        isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled')
       },
       MOVE_COMPONENT: {
         action: 'reassignMaster',