ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [2/2] ambari git commit: AMBARI-10366. Rack: ui cleanup #1 (alexantonenko)
Date Mon, 06 Apr 2015 17:04:54 GMT
AMBARI-10366. Rack: ui cleanup #1 (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 1afb7e6a7fa35912713b905306c35325c727ea9c
Parents: 0de10b7
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Mon Apr 6 18:42:16 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon Apr 6 20:04:48 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         | 11 -------
 ambari-web/app/controllers/main/host/details.js | 11 +++++++
 ambari-web/app/messages.js                      |  7 +++--
 ambari-web/app/styles/application.less          | 28 ++++++++++++++++-
 ambari-web/app/templates/main/host.hbs          |  5 ++-
 ambari-web/app/templates/main/host/summary.hbs  |  4 +--
 ambari-web/app/utils/hosts.js                   | 16 +++++-----
 ambari-web/app/utils/validator.js               |  4 +--
 ambari-web/app/views/main/host.js               | 33 +++++++++++++++++---
 .../test/controllers/main/host/details_test.js  | 29 ++++++++++++++---
 ambari-web/test/controllers/main/host_test.js   | 26 +--------------
 ambari-web/test/utils/validator_test.js         |  1 +
 12 files changed, 111 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 9d8f9c4..aef3205 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -950,17 +950,6 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
   },
 
   /**
-   * Call <code>setRackInfo</code> function to show Set Rack Id popup
-   * @param data
-   */
-  setRackId: function (data) {
-    var rack = data.context.get('rack');
-    var hosts = [data.context];
-    var operationData = {message: Em.I18n.t('hosts.host.details.setRackId')};
-    hostsManagement.setRackInfo(operationData, hosts, rack);
-  },
-
-  /**
    * associations between host property and column index
    * @type {Array}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 40254d6..23b86bc 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -574,6 +574,17 @@ App.MainHostDetailsController = Em.Controller.extend({
   },
 
   /**
+   * Call <code>setRackInfo</code> function to show Set Rack Id popup
+   * @param data
+   */
+  setRackId: function (data) {
+    var rack = data.context.get('rack');
+    var hosts = [data.context];
+    var operationData = {message: Em.I18n.t('hosts.host.details.setRackId')};
+    hostsManagement.setRackInfo(operationData, hosts, rack);
+  },
+
+  /**
    * Call load tags
    * @method checkHiveDone
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 6feaf0b..73691db 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -116,7 +116,8 @@ Em.I18n.translations = {
   'common.ipAddress':'IP Address',
   'common.rack':'Rack',
   'common.cpu':'CPU',
-  'common.cores': 'Cores (CPU)',
+  'common.cores': 'Cores',
+  'common.cores.cpu': 'Cores (CPU)',
   'common.ram':'RAM',
   'common.disk':'Disk',
   'common.diskUsage':'Disk Usage',
@@ -314,7 +315,7 @@ Em.I18n.translations = {
   'hostPopup.setRackId.success': 'Updating rack id to \"{0}\". It may take a few moments
for it to get refreshed.',
   'hostPopup.setRackId.error': 'Updating the rack id failed.',
   'hostPopup.setRackId.invalid': 'Should start with a forward slash it may include alphanumeric
chars, dots, dashes and forward slashes.',
-  'hostPopup.RackId': 'Rack Id',
+  'hostPopup.RackId': 'Rack',
   'hostPopup.recommendation.beforeDecommission': '{0} Maintenance Mode is pre required for
decommissioning.',
 
   'question.sure':'Are you sure?',
@@ -2098,7 +2099,7 @@ Em.I18n.translations = {
   'hosts.host.details.restartAllComponents':'Restart All Components',
   'hosts.host.details.refreshConfigs':'Refresh configs',
   'hosts.host.details.for.postfix':'{0} for host',
-  'hosts.host.details.setRackId':'Set Rack Id',
+  'hosts.host.details.setRackId':'Set Rack',
   'host.host.details.installClients': 'Install clients',
 
   'host.host.componentFilter.master':'Master Components',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index bfed2d9..4e986a8 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2879,8 +2879,22 @@ table.graphs {
         padding-left: 4px;
       }
     }
-	thead {
+	  thead {
       background: none repeat scroll 0 0 #F8F8F8;
+      th {
+        //rack
+        &.sort-view-12 {
+          width: 15% !important;
+        }
+        //cpu
+        &.sort-view-3 {
+          width: 5% !important;
+        }
+        //ram
+        &.sort-view-4 {
+          width: 7% !important;
+        }
+      }
     }
 
     .set-rack-id {
@@ -2993,6 +3007,10 @@ table.graphs {
   }
   .filter-input-width{
     width:65%;
+    
+    &.rack-input {
+      width: 85%;
+    }
   }
   .table {
     input[type="checkbox"] {
@@ -4219,6 +4237,14 @@ ul.inline li {
   th, td {
     border-left-width: 0;
   }
+
+  td {
+    &.rack-id {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+    }
+  }
   .sorting_asc {
     background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEU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8VZerZ645XTt9nX297Yb9jdYeu56WX+x+aem172296XCz/ZbjrY6+BX3n+l37L972un3ljv+dGwOLBvruLr57/17cPel93v3RB6kPXj/Mejj9aP1j7OOiJwpPKp6qP6391fjXZqm99Oyg12DPs4hnj4a4Qy//lfmvT8MFz6nPK0a0RupHrUfPjPmM3Xqx9MXwy4yX0+OFvyn+tveV0auffnf7vWdiycTwa9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6rvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn88ngmbWbm3/eE8/syOll+AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA4klEQVQ4Ee2RPw8BQRDF3x4dCokL0SqUKqVSr/ZRruWTaEnUWgkShwji3yWCwoXQOCKCHXPq24hSmGJ3srvz5vdmga8NIhK1GhW2B8q+M+F/96DRRHE0hUEagegUEyK4VdVoqgv3fL2h3HAMQ3I+sQDLCpRdUlWNUux8prjZltXTRUIQ4X4T6HSRcRwkPxLj7r7ZHPXFSgO7A3xgwQfsncRghJKKzpPMPiBv9pBwDQmhgaTgnRU5zD7S86U3necH2CtQJIyKHkWKyXTGCrFZh4XtxxWt4x6eda9u/+U/gZ+dwBODrVwv7HA8iwAAAABJRU5ErkJggg==)
no-repeat right 50%;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/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 0d1d068..9f3654f 100644
--- a/ambari-web/app/templates/main/host.hbs
+++ b/ambari-web/app/templates/main/host.hbs
@@ -129,8 +129,8 @@
           </td>
           <td class="host-ip">{{host.ip}}</td>
           {{#if App.supports.setRackId}}
-            <td>
-              {{host.rack}} <a class="set-rack-id" {{action setRackId host target="controller"}}><i
class="icon-pencil"></i></a>
+            <td rel="UsageTooltip" {{bindAttr title="host.rack"}} class="rack-id">
+              {{host.rack}}
             </td>
           {{/if}}
           <td class="cores-formatted">{{host.coresFormatted}}</td>
@@ -204,4 +204,3 @@
     </div>
   </div>
 </div>
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/templates/main/host/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/summary.hbs b/ambari-web/app/templates/main/host/summary.hbs
index 58d4cc6..3d72c2f 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -136,13 +136,13 @@
 
                         {{#if App.supports.setRackId}}
                           <dt>{{t common.rack}}:</dt>
-                          <dd>&nbsp;{{view.content.rack}}</dd>
+                          <dd>&nbsp;{{view.content.rack}} <a class="set-rack-id"
{{action setRackId view.content target="controller"}}><i class="icon-pencil"></i></a></dd>
                         {{/if}}
 
                         <dt class="summary-os-label">{{t common.os}}:</dt>
                           <dd class="summary-os-value">&nbsp;{{view.content.osType}}&nbsp;({{view.content.osArch}})</dd>
 
-                        <dt class="summary-cores-label">{{t common.cores}}:</dt>
+                        <dt class="summary-cores-label">{{t common.cores.cpu}}:</dt>
                           <dd class="summary-cores-value">&nbsp;{{view.content.coresFormatted}}</dd>
 
                         <dt class="summary-disk-label">{{t common.disk}}:</dt>

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/utils/hosts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/hosts.js b/ambari-web/app/utils/hosts.js
index f2897a0..c04d519 100644
--- a/ambari-web/app/utils/hosts.js
+++ b/ambari-web/app/utils/hosts.js
@@ -5,9 +5,9 @@
  * licenses this file to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -23,13 +23,13 @@ var validator = require('utils/validator');
 module.exports = {
 
   /**
-   * Launches a dialog to select hosts from the provided available hosts. 
-   * 
-   * Once the user clicks OK or Cancel, the callback is called with the 
+   * Launches a dialog to select hosts from the provided available hosts.
+   *
+   * Once the user clicks OK or Cancel, the callback is called with the
    * array of hosts (App.Host[]) selected. If the dialog was cancelled
    * or closed, <code>null</code> is provided to the callback. Else
    * an array (maybe empty) will be provided to the callback.
-   * 
+   *
    * @param initialHosts  {App.Host[]} List of hosts to pick from
    * @param selectedHosts {App.Host[]} List of hosts already selected from the available
hosts
    * @param selectAtleastOneHost  {boolean} If true atleast one host has to be selected
@@ -190,7 +190,7 @@ module.exports = {
     var hostNames = hosts.mapProperty('hostName');
     return App.ModalPopup.show({
       header: Em.I18n.t('hosts.host.details.setRackId'),
-      disablePrimary: false,
+      disablePrimary: true,
       rackId: rackId,
       bodyClass: Em.View.extend({
         templateName: require('templates/main/host/rack_id_popup'),
@@ -227,4 +227,4 @@ module.exports = {
   errorRackId: function () {
     App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('hostPopup.setRackId.error'));
   }
-};
\ No newline at end of file
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/app/utils/validator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js
index 72b0566..fe7e286 100644
--- a/ambari-web/app/utils/validator.js
+++ b/ambari-web/app/utils/validator.js
@@ -206,7 +206,7 @@ module.exports = {
       return true;
     };
     if (/^[\?\|\*\!,]/.test(value)) return false;
-    return /^((\.\*?)?([\w\s\[\]\?\-_,\|\*\!\{\}]*)?)+(\.\*?)?$/g.test(value) &&
(checkPair(['[',']'])) && (checkPair(['{','}']));
+    return /^((\.\*?)?([\w\s\[\]\/\?\-_,\|\*\!\{\}]*)?)+(\.\*?)?$/g.test(value) &&
(checkPair(['[',']'])) && (checkPair(['{','}']));
   },
 
   /**
@@ -218,7 +218,7 @@ module.exports = {
       // true is there is no host with this component
       return hostComponents.filterProperty("componentName", item["component-name"]).filterProperty("hostName",
item.host).length === 0;
     });
-  }, 
+  },
 
   isValidRackId: function(path) {
     // See app/message.js:hostPopup.setRackId.invalid

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/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 883ea6a..1fee16a 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -362,6 +362,11 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
         break;
     }
 
+    if (operationData.action === 'SET_RACK_INFO') {
+      this.getHostsForBulkOperations(queryParams, operationData, null);
+      return;
+    }
+
     var loadingPopup = App.ModalPopup.show({
       header: Em.I18n.t('jobs.loadingTasks'),
       primary: false,
@@ -370,13 +375,22 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
         template: Ember.Handlebars.compile('<div class="spinner"></div>')
       })
     });
-    var parameters = App.router.get('updateController').computeParameters(queryParams);
-    if (!parameters.length) parameters = '&';
+
+    this.getHostsForBulkOperations(queryParams, operationData, loadingPopup);
+  },
+
+  getHostsForBulkOperations: function (queryParams, operationData, loadingPopup) {
+    var params = App.router.get('updateController').computeParameters(queryParams);
+
+    if (!params.length) {
+      params = '&';
+    }
+
     App.ajax.send({
       name: 'hosts.bulk.operations',
       sender: this,
       data: {
-        parameters: parameters.substring(0, parameters.length - 1),
+        parameters: params.substring(0, params.length - 1),
         operationData: operationData,
         loadingPopup: loadingPopup
       },
@@ -439,7 +453,16 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
     else {
       message = Em.I18n.t('hosts.bulkOperation.confirmation.hosts').format(operationData.message,
hostNames.length);
     }
-    param.loadingPopup.hide();
+
+    if (param.loadingPopup) {
+      param.loadingPopup.hide();
+    }
+
+    if (operationData.action === 'SET_RACK_INFO') {
+      self.get('controller').bulkOperation(operationData, hosts);
+      return;
+    }
+
     App.ModalPopup.show({
       header: Em.I18n.t('hosts.bulkOperation.confirmation.header'),
       hostNames: hostNames.join("\n"),
@@ -853,7 +876,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
    */
   rackFilterView: filters.createTextView({
     column: 12,
-    fieldType: 'filter-input-width',
+    fieldType: 'filter-input-width rack-input',
     onChangeValue: function(){
       this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 5a383a3..19a160b 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -24,6 +24,7 @@ require('models/host_component');
 require('models/host_stack_version');
 var batchUtils = require('utils/batch_scheduled_requests');
 var componentsUtils = require('utils/components');
+var hostsManagement = require('utils/hosts');
 var controller;
 
 describe('App.MainHostDetailsController', function () {
@@ -1702,6 +1703,26 @@ describe('App.MainHostDetailsController', function () {
     });
   });
 
+
+  describe('#setRackId', function () {
+    beforeEach(function () {
+      sinon.stub(hostsManagement, 'setRackInfo', Em.K);
+
+    });
+    afterEach(function () {
+      hostsManagement.setRackInfo.restore();
+    });
+    it('should call setRackInfo with appropriate arguments', function () {
+      var mockedHost = Em.Object.create({
+        rack: 'rackId'
+      });
+      controller.setRackId({
+        context: mockedHost
+      });
+      expect(hostsManagement.setRackInfo.calledWith({message: Em.I18n.t('hosts.host.details.setRackId')},
[mockedHost], 'rackId')).to.be.true;
+    });
+  });
+
   describe('#restartAllStaleConfigComponents()', function () {
 
     beforeEach(function () {
@@ -1911,13 +1932,13 @@ describe('App.MainHostDetailsController', function () {
 
   describe('#_doDeleteHostComponentSuccessCallback()', function () {
     beforeEach(function() {
-      sinon.stub(controller, 'removeHostComponentModel', Em.K);      
+      sinon.stub(controller, 'removeHostComponentModel', Em.K);
     });
-    
+
     afterEach(function() {
-      controller.removeHostComponentModel.restore();      
+      controller.removeHostComponentModel.restore();
     });
-    
+
     it('ZOOKEEPER_SERVER component', function () {
       var data = {
         componentName: 'ZOOKEEPER_SERVER'

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/test/controllers/main/host_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host_test.js b/ambari-web/test/controllers/main/host_test.js
index 8922f9f..54d616f 100644
--- a/ambari-web/test/controllers/main/host_test.js
+++ b/ambari-web/test/controllers/main/host_test.js
@@ -18,7 +18,6 @@
 
 var App = require('app');
 var validator = require('utils/validator');
-var hostsManagement = require('utils/hosts');
 require('utils/batch_scheduled_requests');
 require('controllers/main/host');
 require('mappers/server_data_mapper');
@@ -199,7 +198,7 @@ describe('MainHostController', function () {
         }];
       });
     });
-    
+
     afterEach(function() {
       App.db.getFilterConditions.restore();
       hostController.getRegExp.restore();
@@ -242,27 +241,4 @@ describe('MainHostController', function () {
 
   });
 
-  describe('#setRackId', function () {
-
-    beforeEach(function () {
-      sinon.stub(hostsManagement, 'setRackInfo', Em.K);
-
-    });
-
-    afterEach(function () {
-      hostsManagement.setRackInfo.restore();
-    });
-
-    it('should call setRackInfo with appropriate arguments', function () {
-      var mockedHost = Em.Object.create({
-        rack: 'rackId'
-      });
-      hostController.setRackId({
-        context: mockedHost
-      });
-      expect(hostsManagement.setRackInfo.calledWith({message: Em.I18n.t('hosts.host.details.setRackId')},
[mockedHost], 'rackId')).to.be.true;
-    });
-
-  });
-
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/1afb7e6a/ambari-web/test/utils/validator_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/validator_test.js b/ambari-web/test/utils/validator_test.js
index 93b06cc..bccb820 100644
--- a/ambari-web/test/utils/validator_test.js
+++ b/ambari-web/test/utils/validator_test.js
@@ -393,6 +393,7 @@ describe('validator', function () {
         { value: 'a1[1]asd[1]', expected: true },
         { value: 'a1[1]asd[1][', expected: false },
         { value: 'a1[1|1]asd[1]', expected: true },
+        { value: '/a1[1|1]asd[1]', expected: true },
         { value: 'a1-2!', expected: true },
         { value: '|a1-2', expected: false },
         { value: '[a1', expected: false },


Mime
View raw message