Repository: ambari Updated Branches: refs/heads/trunk b4e1aed4a -> 1f4d315ce
AMBARI-7369. Clients in INIT or INSTALL FAILED state should have an menu action for installation (Denys Buzhor via alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f4d315c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f4d315c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f4d315c Branch: refs/heads/trunk Commit: 1f4d315ce2c9be2e3077fb4c264b1a10e1cc11d8 Parents: b4e1aed Author: Alex Antonenko <hiv...@gmail.com> Authored: Wed Sep 17 19:45:40 2014 +0300 Committer: Alex Antonenko <hiv...@gmail.com> Committed: Wed Sep 17 19:45:40 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 9 ++++++++- ambari-web/app/messages.js | 1 + ambari-web/app/templates/main/host/summary.hbs | 8 ++++++++ ambari-web/app/views/main/host/summary.js | 11 +++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/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 a9b7d76..39d9086 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -1592,6 +1592,13 @@ App.MainHostDetailsController = Em.Controller.extend({ componentName: event.context.get('componentName'), displayName: event.context.get('displayName') }); - } + }, + reinstallClients: function(event) { + var clientsToInstall = event.context.filter(function(component) { + return ['INIT', 'INSTALL_FAILED'].contains(component.get('workStatus')); + }); + if (!clientsToInstall.length) return; + this.sendComponentCommand(clientsToInstall, Em.I18n.t('host.host.details.installClients'), 'INSTALLED'); + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index d1f7afd..5c330b4 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1695,6 +1695,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', + 'host.host.details.installClients': 'Install clients', 'host.host.componentFilter.master':'Master Components', 'host.host.componentFilter.slave':'Slave Components', http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/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 df2a02f..1c363ee 100644 --- a/ambari-web/app/templates/main/host/summary.hbs +++ b/ambari-web/app/templates/main/host/summary.hbs @@ -72,6 +72,9 @@ <div class="span7"> {{#each component in view.clients}} {{component.displayName}} + {{#if component.isInstallFailed}} + <span class="health-status-installed icon-warning-sign"></span> + {{/if}} {{#if component.staleConfigs}} <span class="text-warning icon-refresh"></span> {{/if}} @@ -97,6 +100,11 @@ {{t hosts.host.details.refreshConfigs}} </a> </li> + <li> + <a href="javscript:void(null)" {{bindAttr class="view.areClientsInstallFailed::disabled" }} data-toggle="modal" {{action reinstallClients view.clients target="controller"}}> + {{t host.host.details.installClients}} + </a> + </li> </ul> </div> {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/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 90ce1e7..e67be32 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -182,11 +182,22 @@ App.MainHostSummaryView = Em.View.extend({ clients[clients.length - 1].set('isLast', false); } component.set('isLast', true); + if (['INSTALL_FAILED', 'INIT'].contains(component.get('workStatus'))) { + component.set('isInstallFailed', true); + } clients.push(component); } }, this); return clients; }.property('content.hostComponents.length'), + /** + * Check if some clients not installed or started + * + * @type {bool} + **/ + areClientsInstallFailed: function() { + return this.get('clients').someProperty('isInstallFailed', true); + }.property('clients.@each.workStatus'), /** * Check if some clients have stale configs