You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/01/09 19:03:52 UTC

[1/2] ambari git commit: AMBARI-9070 Single node cluster has 'Move ...' and "Enable HA" service actions for HDFS and YARN enabled. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk c4d131fbc -> 8c68301d0


AMBARI-9070 Single node cluster has 'Move ...' and "Enable HA" service actions for HDFS and YARN enabled. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 8c68301d0d9c0aeb2a397f9d919d25e21da82ab1
Parents: a9ca6fa
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Jan 9 19:23:21 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Jan 9 19:23:35 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/app.js                           |  9 +++++++++
 ambari-web/app/views/main/service/item.js       |  8 +++++---
 ambari-web/test/views/main/service/item_test.js | 11 +++++++----
 3 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8c68301d/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 3466f28..339224b 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -137,6 +137,15 @@ module.exports = Em.Application.create({
     return Em.get((this.get('currentStackVersion') || this.get('defaultStackVersion')).match(/(.+)-\d.+/), '1');
   }.property('currentStackVersion', 'defaultStackVersion'),
 
+  /**
+   * true if cluster has only 1 host
+   * for now is used to disable move/HA actions
+   * @type {boolean}
+   */
+  isSingleNode: function() {
+    return this.get('allHostNames.length') === 1;
+  }.property('allHostNames.length'),
+
   allHostNames: [],
 
   currentStackVersionNumber: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8c68301d/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 daae98f..857f1a1 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -89,20 +89,22 @@ App.MainServiceItemView = Em.View.extend({
         action: App.get('isHaEnabled') ? 'disableHighAvailability' : 'enableHighAvailability',
         label: App.get('isHaEnabled') ? Em.I18n.t('admin.highAvailability.button.disable') : Em.I18n.t('admin.highAvailability.button.enable'),
         cssClass: App.get('isHaEnabled') ? 'icon-arrow-down' : 'icon-arrow-up',
-        isHidden: (App.get('isHaEnabled') || (/^1.3/.test(App.get('currentStackVersionNumber'))))
+        isHidden: (App.get('isHaEnabled') || (/^1.3/.test(App.get('currentStackVersionNumber')))),
+        disabled: App.get('isSingleNode')
       },
       TOGGLE_RM_HA: {
         action: 'enableRMHighAvailability',
         label: Em.I18n.t('admin.rm_highAvailability.button.enable'),
         cssClass: 'icon-arrow-up',
-        isHidden: App.get('isRMHaEnabled')
+        isHidden: App.get('isRMHaEnabled'),
+        disabled: App.get('isSingleNode')
       },
       MOVE_COMPONENT: {
         action: 'reassignMaster',
         context: '',
         label: Em.I18n.t('services.service.actions.reassign.master'),
         cssClass: 'icon-share-alt',
-        disabled: false
+        disabled: App.get('isSingleNode')
       },
       STARTDEMOLDAP: {
         action: 'startLdapKnox',

http://git-wip-us.apache.org/repos/asf/ambari/blob/8c68301d/ambari-web/test/views/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/item_test.js b/ambari-web/test/views/main/service/item_test.js
index c4e847c..bb08228 100644
--- a/ambari-web/test/views/main/service/item_test.js
+++ b/ambari-web/test/views/main/service/item_test.js
@@ -77,6 +77,7 @@ describe('App.MainServiceItemView', function () {
         {
           serviceName: "HDFS",
           displayName: "HDFS",
+          isSingleNode: true,
           serviceTypes: ["HA_MODE"],
           hostComponents: [
             Em.Object.create({
@@ -103,9 +104,9 @@ describe('App.MainServiceItemView', function () {
           result: [
             {"action": "restartAllHostComponents", "context": "HDFS", "label": "Restart All", "cssClass": "icon-repeat", "disabled": false},
             {"action": "rollingRestart", "label": "Restart DataNodes", "cssClass": "icon-time", "disabled": false, "context": "DATANODE"},
-            {"action": "reassignMaster", "context": "NAMENODE", "label": "Move NameNode", "cssClass": "icon-share-alt", "disabled": false},
-            {"action": "reassignMaster", "context": "SECONDARY_NAMENODE", "label": "Move SNameNode", "cssClass": "icon-share-alt", "disabled": false},
-            {"action": "enableHighAvailability", "label": "Enable NameNode HA", "cssClass": "icon-arrow-up", "isHidden": false},
+            {"action": "reassignMaster", "context": "NAMENODE", "label": "Move NameNode", "cssClass": "icon-share-alt", "disabled": true},
+            {"action": "reassignMaster", "context": "SECONDARY_NAMENODE", "label": "Move SNameNode", "cssClass": "icon-share-alt", "disabled": true},
+            {"action": "enableHighAvailability", "label": "Enable NameNode HA", "cssClass": "icon-arrow-up", "isHidden": false, "disabled": true,},
             {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"},
             {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for HDFS", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false},
             {"action": "rebalanceHdfsNodes", "customCommand": "REBALANCEHDFS", "context": "Rebalance HDFS", "label": "Rebalance HDFS", "cssClass": "icon-refresh", "disabled": false},
@@ -172,7 +173,7 @@ describe('App.MainServiceItemView', function () {
             {"action": "rollingRestart", "label": "Restart NodeManagers", "cssClass": "icon-time", "disabled": false, "context": "NODEMANAGER"},
             {"action": "reassignMaster", "context": "APP_TIMELINE_SERVER", "label": "Move App Timeline Server", "cssClass": "icon-share-alt", "disabled": false},
             {"action": "reassignMaster", "context": "RESOURCEMANAGER", "label": "Move ResourceManager", "cssClass": "icon-share-alt", "disabled": false},
-            {"action": "enableRMHighAvailability", "label": "Enable ResourceManager HA", "cssClass": "icon-arrow-up", "isHidden": false},
+            {"action": "enableRMHighAvailability", "label": "Enable ResourceManager HA", "cssClass": "icon-arrow-up", "isHidden": false, disabled: false},
             {"action": "runSmokeTest", "label": "Run Service Check", "cssClass": "icon-thumbs-up-alt"},
             {"action": "turnOnOffPassive", "context": "Turn On Maintenance Mode for YARN", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", "disabled": false},
             {"action": "downloadClientConfigs", "label": "Download Client Configs", "cssClass": "icon-download-alt", "isHidden": true, "disabled": false, "hasSubmenu": false, "submenuOptions": []}
@@ -330,6 +331,8 @@ describe('App.MainServiceItemView', function () {
 
       sinon.stub(App, 'get', function (k) {
         switch (k) {
+          case 'isSingleNode':
+            return (view.get('controller.content.serviceName') == 'HDFS');
           case 'supports.autoRollbackHA':
           case 'isRMHaEnabled':
           case 'isHaEnabled':


[2/2] ambari git commit: AMBARI-9069 Hosts page: Versions column should show actual version number. (ababiichuk)

Posted by ab...@apache.org.
AMBARI-9069 Hosts page: Versions column should show actual version number. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: a9ca6fac4f364a17f9e1b3abc5b4a6085d01b338
Parents: c4d131f
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Jan 9 18:37:26 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Jan 9 19:23:35 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/styles/application.less |  6 +++---
 ambari-web/app/templates/main/host.hbs | 10 ++++++----
 ambari-web/app/views/main/host.js      | 22 ++++++++++++++++++++--
 3 files changed, 29 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a9ca6fac/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 3410a1b..8a5bac9 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -3606,7 +3606,7 @@ table.graphs {
     .col6,
     td:first-child + td + td + td + td + td + td,
     th:first-child + th + th + th + th + th + th {
-      width: 11%!important;
+      width: 10%!important;
     }
     .col7,
     td:first-child + td + td + td + td + td + td + td,
@@ -3623,13 +3623,13 @@ table.graphs {
     .col9,
     td:first-child + td + td + td + td + td + td + td + td + td,
     th:first-child + th + th + th + th + th + th + th + th + th{
-      width: 10%!important;
+      width: 9%!important;
     }
 
     .col10,
     td:first-child + td + td + td + td + td + td + td + td + td + td,
     th:first-child + th + th + th + th + th + th + th + th + th + th{
-      width: 13%!important;
+      width: 15%!important;
     }
 
     .col11,

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9ca6fac/ambari-web/app/templates/main/host.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host.hbs b/ambari-web/app/templates/main/host.hbs
index 1ae508e..db18f0c 100644
--- a/ambari-web/app/templates/main/host.hbs
+++ b/ambari-web/app/templates/main/host.hbs
@@ -132,10 +132,12 @@
           </td>
 
           <td class="load-avg">{{host.loadAvg}}</td>
-          <td {{bindAttr class="App.supports.stackUpgrade::hidden :host-table-versions"}}>
-            <a href="#" class="expander" {{action toggleVersions target="view"}}>
-              <span {{bindAttr class="view.isVersionsCollapsed:icon-caret-right:icon-caret-down"}}></span>
-              {{view.content.stackVersions.length}} {{pluralize view.content.stackVersions.length singular="t:common.version" plural="t:common.versions"}}
+          <td {{bindAttr class="App.supports.stackUpgrade::hidden view.hasSingleVersion:not-active-link :host-table-versions"}}>
+            <a href="#" class="expander black" {{action toggleVersions target="view"}}>
+              {{#unless view.hasSingleVersion}}
+                <span {{bindAttr class="view.isVersionsCollapsed:icon-caret-right:icon-caret-down"}}></span>
+              {{/unless}}
+              {{view.currentVersion}}
             </a>
             <div class="stack-versions collapsed-list">
               {{{view.versionlabels}}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9ca6fac/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index d85296b..72aeacb 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -585,12 +585,30 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
     }.property('content.hostComponents.length'),
 
     /**
+     * true if host has only one repoversion
+     * in this case expander in version columnn is hidden
+     * @returns {Boolean}
+     */
+    hasSingleVersion: function() {
+      return this.get('content.stackVersions.length') == 1;
+    }.property('content.stackVersions.length'),
+
+    /**
+     * this version is always shown others hidden unless expander is open
+     * @returns {String}
+     */
+    currentVersion: function() {
+      var repoVersion = this.get('content.stackVersions').findProperty('isCurrent');
+      return repoVersion.get('repoVersion') + " (" + repoVersion.get('displayStatus') + ")";
+    }.property('content.stackVersions'),
+
+    /**
      * String with list of host components <code>displayName</code>
      * @returns {String}
      */
     versionlabels: function () {
-      return this.get('content.stackVersions').map(function (version) {
-        return Em.I18n.t('hosts.host.stackVersions.table.labels').format(version.get('version'), version.get('displayStatus'));
+      return this.get('content.stackVersions').filterProperty('isCurrent', false).map(function (version) {
+        return Em.I18n.t('hosts.host.stackVersions.table.labels').format(version.get('repoVersion'), version.get('displayStatus'));
       }).join("<br />");
     }.property('content.stackVersions.length'),