Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DC2ADED7 for ; Thu, 18 Oct 2012 00:27:39 +0000 (UTC) Received: (qmail 46832 invoked by uid 500); 18 Oct 2012 00:27:39 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 46812 invoked by uid 500); 18 Oct 2012 00:27:39 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 46805 invoked by uid 99); 18 Oct 2012 00:27:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 00:27:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 00:27:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5BA7223888FE; Thu, 18 Oct 2012 00:26:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1399490 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/app/controllers/installer/ ambari-web/app/routes/ ambari-web/app/styles/ ambari-web/app/templates/installer/ ambari-web/app/views/installer/ Date: Thu, 18 Oct 2012 00:26:50 -0000 To: ambari-commits@incubator.apache.org From: yusaku@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121018002651.5BA7223888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: yusaku Date: Thu Oct 18 00:26:50 2012 New Revision: 1399490 URL: http://svn.apache.org/viewvc?rev=1399490&view=rev Log: AMBARI-882. Group-based DataNode/TaskTracker/RegionServer overrides. (yusaku) Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/slave_group_hosts.hbs Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step7_controller.js incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step7.hbs incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step7_view.js Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original) +++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Thu Oct 18 00:26:50 2012 @@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes) NEW FEATURES + AMBARI-882. Group-based DataNode/TaskTracker/RegionServer overrides. + (yusaku) + AMBARI-881. Implement Add Hosts Wizard. (yusaku) AMBARI-869. Util to deserialize ExecutionCommand. (jitendra) Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step7_controller.js URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step7_controller.js?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step7_controller.js (original) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer/step7_controller.js Thu Oct 18 00:26:50 2012 @@ -187,8 +187,6 @@ App.SlaveComponentGroupsController = Emb contentBinding: 'App.router.installerStep7Controller.slaveComponentHosts', - slaveComponentGroups: [], - selectedComponentName: function () { switch (App.router.get('installerStep7Controller.selectedService.serviceName')) { case 'HDFS': @@ -203,6 +201,11 @@ App.SlaveComponentGroupsController = Emb }.property('App.router.installerStep7Controller.selectedService'), + selectedSlaveComponent: function () { + var component = this.findProperty('componentName', this.get('selectedComponentName')); + return component; + }.property('selectedComponentName'), + showAddSlaveComponentGroup: function (event) { var componentName = event.context; App.ModalPopup.show({ @@ -219,17 +222,18 @@ App.SlaveComponentGroupsController = Emb addSlaveComponentGroup: function (event) { var componentName = event.context; var component = this.findProperty('componentName', componentName); - var slaveGroups = this.get('slaveComponentGroups'); var newGroupName; - console.log(slaveGroups); - slaveGroups.forEach(function(group) { - - }); - var newGroup = { - groupName: "New Group" - }; - slaveGroups.pushObject(newGroup); - console.log(slaveGroups); + component.groups.setEach('active', false); + var newGroups = component.groups.filterProperty('type', 'new'); + if (newGroups.length === 0) { + component.newGroupIndex = 0; + newGroupName = 'New Group'; + } else { + component.newGroupIndex++; + newGroupName = 'New Group ' + component.newGroupIndex; + } + var newGroup = {groupName: newGroupName, label: 'new_group_' + component.newGroupIndex, type: 'new', active: true}; + component.groups.pushObject(newGroup); }, showEditSlaveComponentGroups: function (event) { @@ -254,16 +258,38 @@ App.SlaveComponentGroupsController = Emb } }.property('@each.hosts', 'selectedComponentName'), - getHostsGroups: function () { - var slaveGroups = this.get('slaveComponentGroups'); - if (slaveGroups.length == 0){ - var defaultGroup = { - groupName: "Default", - label: "default" - }; - slaveGroups.pushObject(defaultGroup); + getGroups: function () { + if (this.get('selectedComponentName') !== null) { + var component = this.findProperty('componentName', this.get('selectedComponentName')); + if (component !== undefined && component !== null) { + if (component.groups === undefined){ + component.groups = []; + var defaultGroup = {groupName: 'Default', label: 'default', type: 'default', active: true}; + component.groups.pushObject(defaultGroup); + } + return component.groups; + } } - return slaveGroups; - }.property('slaveComponentGroups') + }.property('selectedComponentName'), + + showSlaveComponentGroup: function(event){ + var component = this.findProperty('componentName', this.get('selectedComponentName')); + component.groups.setEach('active', false); + var group = component.groups.filterProperty('groupName', event.context.groupName); + group.setEach('active', true); + }, + + removeSlaveComponentGroup: function(event){ + var component = this.findProperty('componentName', this.get('selectedComponentName')); + component.groups.setEach('active', false); +// component.groups.forEach(function (group) { +// if(group.groupName == event.context.groupName) +// delete component.groups[i]; +// }, this); + + var group = component.groups.filterProperty('groupName', event.context.groupName); + component.groups.removeObjects(group); + group.setEach('active', true); + } }); Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js (original) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/routes/installer.js Thu Oct 18 00:26:50 2012 @@ -160,14 +160,6 @@ module.exports = Em.Route.extend({ }, back: Em.Router.transitionTo('step6'), next: Em.Router.transitionTo('step8') -// showSlaveComponentGroup:Em.Router.transitionTo('slaveComponentGroup'), -// slaveComponentGroup:Em.Route.extend({ -// route:'/', -// connectOutlets:function (router, group) { -// router.get('installerController').connectOutlet('slaveComponentGroup', group); -// } -// }) - }), step8: Em.Route.extend({ Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less (original) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/styles/application.less Thu Oct 18 00:26:50 2012 @@ -227,6 +227,12 @@ h1 { .add-slave-component-group { margin-bottom: 20px; } + .slave-group { + display: none; + } + .slave-group.active { + display: block; + } .master-host, .master-hosts, .slave-hosts { padding-top: 5px; line-height: 20px; Added: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/slave_group_hosts.hbs URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/slave_group_hosts.hbs?rev=1399490&view=auto ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/slave_group_hosts.hbs (added) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/slave_group_hosts.hbs Thu Oct 18 00:26:50 2012 @@ -0,0 +1 @@ +{{view.content.groupName}} Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step7.hbs URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step7.hbs?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step7.hbs (original) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/installer/step7.hbs Thu Oct 18 00:26:50 2012 @@ -51,6 +51,11 @@ class="btn add-slave-component-group btn-large" {{action addSlaveComponentGroup category.name target="App.router.slaveComponentGroupsController"}}> {{/view}} + {{#each group in App.router.slaveComponentGroupsController.getGroups}} + {{#view App.SlaveComponentGroupView contentBinding="group" }} + {{group.groupName}} + {{/view}} + {{/each}} {{/if}}
{{#each view.categoryConfigs}} Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step7_view.js URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step7_view.js?rev=1399490&r1=1399489&r2=1399490&view=diff ============================================================================== --- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step7_view.js (original) +++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/installer/step7_view.js Thu Oct 18 00:26:50 2012 @@ -237,26 +237,22 @@ App.AddSlaveComponentGroupButton = Ember App.SlaveComponentGroupsMenu = Em.CollectionView.extend({ - contentBinding: 'App.router.slaveComponentGroupsController.getHostsGroups', - - init: function(){ this._super(); this.activateView(); }, - + contentBinding: 'App.router.slaveComponentGroupsController.getGroups', tagName:'ul', classNames: ["nav", "nav-tabs"], - activateView:function () { - $.each(this._childViews, function () { - this.set('active', (this.get('content.label') == 'default' ? "active" : "")); - }); - }, - itemViewClass:Em.View.extend({ classNameBindings:["active"], - active:"", - template:Ember.Handlebars.compile(' {{unbound view.content.groupName}}') }) - + active:function(){ + return this.get('content.active'); + }.property('content.active'), + template:Ember.Handlebars.compile(' {{unbound view.content.groupName}}') }) }); App.SlaveComponentGroupView = Ember.View.extend({ -// templateName: require('templates/main/service/item') + classNames: ['slave-group'], + classNameBindings:["active"], + active:function(){ + return this.get('content.active'); + }.property('content.active') });