Updated Branches: refs/heads/trunk b3f7fa6ec -> 9b0af755d
AMBARI-3666. Add "Move" option to Actions menu on the host details page. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/9b0af755 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/9b0af755 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/9b0af755 Branch: refs/heads/trunk Commit: 9b0af755db8ffe34f06c6fc48c74c3c274ae5789 Parents: b3f7fa6 Author: Aleksandr Kovalenko <[email protected]> Authored: Fri Nov 1 16:13:52 2013 +0200 Committer: Aleksandr Kovalenko <[email protected]> Committed: Fri Nov 1 16:13:52 2013 +0200 ---------------------------------------------------------------------- ambari-web/app/config.js | 1 + ambari-web/app/controllers/main/host/details.js | 14 ++++++++++++++ ambari-web/app/messages.js | 1 + ambari-web/app/templates/main/host/summary.hbs | 7 +++++++ ambari-web/app/views/main/host/summary.js | 4 ++++ ambari-web/app/views/main/service/item.js | 3 +-- 6 files changed, 28 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/ambari-web/app/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index 3be03fa..834efaf 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -37,6 +37,7 @@ App.maxRunsForAppBrowser = 500; App.pageReloadTime=3600000; App.singleNodeInstall = false; App.singleNodeAlias = document.location.hostname; +App.reassignableComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER']; // experimental features are automatically enabled if running on brunch server App.enableExperimental = false; http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/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 596eaba..87fc0df 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -870,6 +870,20 @@ App.MainHostDetailsController = Em.Controller.extend({ App.showConfirmationPopup(function() { }); + }, + /** + * open Reassign Master Wizard with selected component + * @param event + */ + moveComponent: function (event) { + App.showConfirmationPopup(function() { + var component = event.context; + var reassignMasterController = App.router.get('reassignMasterController'); + reassignMasterController.saveComponentToReassign(component); + reassignMasterController.getSecurityStatus(); + reassignMasterController.setCurrentStep('1'); + App.router.transitionTo('services.reassign'); + }); } }); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index eb0e755..11b109f 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -151,6 +151,7 @@ Em.I18n.translations = { 'common.tags': 'Tags', 'common.important': 'Important', 'common.allServices':'All Services', + 'common.move':'Move', 'requestInfo.installComponents':'Install Components', 'requestInfo.installServices':'Install Services', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/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 688f22c..80179e7 100644 --- a/ambari-web/app/templates/main/host/summary.hbs +++ b/ambari-web/app/templates/main/host/summary.hbs @@ -126,6 +126,13 @@ </a> </li> {{/if}} + {{#if view.isReassignable}} + <li {{bindAttr class="view.noActionAvailable"}}> + <a href="javascript:void(null)" data-toggle="modal" {{action "moveComponent" view.content target="controller"}}> + {{t common.move}} + </a> + </li> + {{/if}} {{/unless}} </ul> </div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/ambari-web/app/views/main/host/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js index 5373269..33079a9 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -438,6 +438,10 @@ App.MainHostSummaryView = Em.View.extend({ this.get('workStatus') == App.HostComponentStatus.install_failed || this.get('workStatus') == App.HostComponentStatus.upgrade_failed); }.property('workStatus'), + isReassignable: function () { + return App.supports.reassignMaster && App.reassignableComponents.contains(this.get('content.componentName')) && App.Host.find().content.length > 1; + }.property('content.componentName') + }), timeSinceHeartBeat: function () { var d = this.get('content.lastHeartBeatTime'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/9b0af755/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 a75a975..76d0712 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -25,7 +25,6 @@ App.MainServiceItemView = Em.View.extend({ var service = this.get('controller.content'); var hosts = App.Host.find().content.length; var allMasters = this.get('controller.content.hostComponents').filterProperty('isMaster').mapProperty('componentName').uniq(); - var reassignableMasters = ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER']; var disabled = this.get('controller.isStopDisabled'); switch (service.get('serviceName')) { case 'GANGLIA': @@ -36,7 +35,7 @@ App.MainServiceItemView = Em.View.extend({ case 'MAPREDUCE': if (App.supports.reassignMaster && hosts > 1) { allMasters.forEach(function (hostComponent) { - if (reassignableMasters.contains(hostComponent)) { + if (App.reassignableComponents.contains(hostComponent)) { options.push({action: 'reassignMaster', context: hostComponent, 'label': Em.I18n.t('services.service.actions.reassign.master').format(App.format.role(hostComponent)), disabled: false}); }
