You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/08/21 20:05:39 UTC
git commit: AMBARI-2976. During agent registration show list of
agents that are registered but do not correspond to any hostnames that are
provided by the user. (Andrii Babiichuk via yusaku)
Updated Branches:
refs/heads/trunk c309d2272 -> 7eddd1c5b
AMBARI-2976. During agent registration show list of agents that are registered but do not correspond to any hostnames that are provided by the user. (Andrii Babiichuk via yusaku)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/7eddd1c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/7eddd1c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/7eddd1c5
Branch: refs/heads/trunk
Commit: 7eddd1c5b55614b0d6915af4c7f4bf93758b340a
Parents: c309d22
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 21 11:05:06 2013 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 21 11:05:06 2013 -0700
----------------------------------------------------------------------
.../app/controllers/wizard/step3_controller.js | 44 ++++++++++++++++++++
ambari-web/app/messages.js | 2 +
ambari-web/app/templates/wizard/step3.hbs | 5 +++
ambari-web/app/views/wizard/step3_view.js | 6 +++
4 files changed, 57 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7eddd1c5/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 50cf574..55dcc92 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -23,6 +23,7 @@ App.WizardStep3Controller = Em.Controller.extend({
hosts: [],
content: [],
bootHosts: [],
+ registeredHosts: [],
registrationStartedAt: null,
registrationTimeoutSecs: 120,
stopBootstrap: false,
@@ -455,6 +456,31 @@ App.WizardStep3Controller = Em.Controller.extend({
}
},
+ hasMoreRegisteredHosts: false,
+
+ getAllRegisteredHosts: function() {
+ App.ajax.send({
+ name: 'wizard.step3.is_hosts_registered',
+ sender: this,
+ success: 'getAllRegisteredHostsCallback'
+ });
+ }.observes('bootHosts.@each.name'),
+
+ getAllRegisteredHostsCallback: function(hosts) {
+ var registeredHosts = [];
+ var addedHosts = this.get('bootHosts').getEach('name');
+ hosts.items.forEach(function(host){
+ (addedHosts.contains(host.Hosts.host_name)) ? null : registeredHosts.push(host.Hosts.host_name);
+ });
+ if(registeredHosts.length) {
+ this.set('hasMoreRegisteredHosts',true);
+ this.set('registeredHosts',registeredHosts);
+ } else {
+ this.set('hasMoreRegisteredHosts',false);
+ this.set('registeredHosts','');
+ }
+ },
+
allHostsComplete: function() {
var result = true;
this.get('bootHosts').forEach(function(host) {
@@ -1085,6 +1111,24 @@ App.WizardStep3Controller = Em.Controller.extend({
})
},
+ registeredHostsPopup: function(){
+ var self = this;
+ App.ModalPopup.show({
+ header: Em.I18n.t('installer.step3.warning.registeredHosts').format(this.get('registeredHosts').length),
+ secondary: null,
+ bodyClass: Ember.View.extend({
+ template: Ember.Handlebars.compile([
+ '<p>{{view.message}}</p>',
+ '<ul>{{#each host in view.registeredHosts}}',
+ '<li>{{host}}</li>',
+ '{{/each}}</ul>'
+ ].join('')),
+ message: Em.I18n.t('installer.step3.registeredHostsPopup'),
+ registeredHosts: self.get('registeredHosts')
+ })
+ })
+ },
+
back: function () {
if (this.get('isInstallInProgress')) {
return;
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7eddd1c5/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f1a58d5..523e667 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -390,6 +390,8 @@ Em.I18n.translations = {
'installer.step3.warnings.updateChecks.success':'Host Checks successfully updated',
'installer.step3.warnings.updateChecks.failed':'Host Checks update failed',
'installer.step3.warnings.missingHosts':'There is no registered host',
+ 'installer.step3.warning.registeredHosts': '{0} Other Registered Hosts',
+ 'installer.step3.registeredHostsPopup': 'These are the hosts that have registered with the server, but do not appear in the list of hosts that you are adding.',
'installer.step3.removeSelected':'Remove Selected',
'installer.step3.retryFailed':'Retry Failed',
'installer.step3.hosts.status.registering':'Registering',
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7eddd1c5/ambari-web/app/templates/wizard/step3.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step3.hbs b/ambari-web/app/templates/wizard/step3.hbs
index d2d3224..0fec41f 100644
--- a/ambari-web/app/templates/wizard/step3.hbs
+++ b/ambari-web/app/templates/wizard/step3.hbs
@@ -114,6 +114,11 @@
</div>
</div>
</div>
+ {{#if hasMoreRegisteredHosts}}
+ <div {{bindAttr class=":alert alert-warn"}}>
+ <a href="#" {{action registeredHostsPopup target="controller"}}>{{view.registeredHostsMessage}}</a>
+ </div>
+ {{/if}}
{{#if isWarningsBoxVisible}}
<div {{bindAttr class=":alert view.status"}}>
{{view.message}}
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7eddd1c5/ambari-web/app/views/wizard/step3_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step3_view.js b/ambari-web/app/views/wizard/step3_view.js
index 3cbb9ef..bbc647a 100644
--- a/ambari-web/app/views/wizard/step3_view.js
+++ b/ambari-web/app/views/wizard/step3_view.js
@@ -32,6 +32,12 @@ App.WizardStep3View = Em.View.extend({
linkText: '',
status: '',
+ registeredHostsMessage: '',
+
+ setRegisteredHosts: function(){
+ this.set('registeredHostsMessage',Em.I18n.t('installer.step3.warning.registeredHosts').format(this.get('controller.registeredHosts').length));
+ }.observes('controller.registeredHosts'),
+
monitorStatuses: function() {
var failedHosts = 0;
var hosts = this.get('controller.bootHosts');