You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2013/12/10 19:05:27 UTC
git commit: AMBARI-3967. Config Groups: some fields missing in Select
Group Hosts popup. (onechiporenko)
Updated Branches:
refs/heads/trunk e45779ab3 -> 4f822ca93
AMBARI-3967. Config Groups: some fields missing in Select Group Hosts popup. (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4f822ca9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f822ca9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f822ca9
Branch: refs/heads/trunk
Commit: 4f822ca93421b99593d4f645c795f0a5688fd2af
Parents: e45779a
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Dec 10 19:58:02 2013 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Dec 10 20:03:44 2013 +0200
----------------------------------------------------------------------
ambari-web/app/config.js | 2 +-
ambari-web/app/controllers/wizard.js | 8 ++---
.../app/controllers/wizard/step3_controller.js | 32 +++----------------
.../app/controllers/wizard/step7_controller.js | 15 +++++++--
ambari-web/app/models/host.js | 5 +++
.../wizard/step3_host_warning_popup_footer.hbs | 33 ++++++++++++++++++++
.../wizard/step3_registered_hosts_popup.hbs | 24 ++++++++++++++
ambari-web/app/utils/ajax.js | 2 +-
ambari-web/app/utils/hosts.js | 8 ++---
9 files changed, 89 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index c39c58a..4635265 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -45,7 +45,7 @@ App.enableExperimental = false;
App.supports = {
addServices: false,
hostOverrides: true,
- hostOverridesInstaller: false,
+ hostOverridesInstaller: true,
hostOverridesHost: true,
mirroring: false,
secureCluster: true,
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 51e46e7..d6e6e25 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -523,11 +523,8 @@ App.WizardController = Em.Controller.extend({
App.ModalPopup.show({
header: header,
secondary: false,
- onPrimary: function () {
- this.hide();
- },
bodyClass: Ember.View.extend({
- template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+ template: Ember.Handlebars.compile('<p>{{view.message}}</p>'),
message: message
})
});
@@ -546,6 +543,9 @@ App.WizardController = Em.Controller.extend({
cpu: _host.cpu,
memory: _host.memory,
disk_info: _host.disk_info,
+ os_type: _host.os_type,
+ os_arch: _host.os_arch,
+ ip: _host.ip,
bootStatus: _host.bootStatus,
isInstalled: false
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/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 20604fe..dace005 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -518,11 +518,8 @@ App.WizardStep3Controller = Em.Controller.extend({
App.ModalPopup.show({
header: header,
secondary: false,
- onPrimary: function () {
- this.hide();
- },
bodyClass: Ember.View.extend({
- template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+ template: Ember.Handlebars.compile('<p>{{view.message}}</p>'),
message: message
})
});
@@ -557,6 +554,8 @@ App.WizardStep3Controller = Em.Controller.extend({
_host.memory = ((parseInt(host.Hosts.total_mem))).toFixed(2);
_host.disk_info = host.Hosts.disk_info;
_host.os_type = host.Hosts.os_type;
+ _host.os_arch = host.Hosts.os_arch;
+ _host.ip = host.Hosts.ip;
var context = self.checkHostOSType(host.Hosts.os_type, host.Hosts.host_name);
if(context) {
@@ -649,10 +648,6 @@ App.WizardStep3Controller = Em.Controller.extend({
header: Em.I18n.t('installer.step3.hostLog.popup.header').format(host.get('name')),
secondary: null,
- onPrimary: function () {
- this.hide();
- },
-
bodyClass: Ember.View.extend({
templateName: require('templates/wizard/step3_host_log_popup'),
host: host,
@@ -995,16 +990,7 @@ App.WizardStep3Controller = Em.Controller.extend({
},
footerClass: Ember.View.extend({
- template: Ember.Handlebars.compile([
- '<div class="update-progress pull-left">',
- '{{#if view.isUpdateInProgress}}',
- '<div class="progress-info active progress">',
- '<div class="bar" {{bindAttr style="view.progressWidth"}}></div></div>',
- '{{else}}<label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>',
- '{{/if}}</div>',
- '{{#if view.parentView.secondary}}<button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i> {{view.parentView.secondary}}</button>{{/if}}',
- '{{#if view.parentView.primary}}<button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>{{/if}}'
- ].join('')),
+ templateName: require('templates/wizard/step3_host_warning_popup_footer'),
classNames: ['modal-footer', 'host-checks-update'],
progressWidth: function(){
return 'width:'+App.router.get('wizardStep3Controller.checksUpdateProgress')+'%';
@@ -1145,9 +1131,6 @@ App.WizardStep3Controller = Em.Controller.extend({
hosts: hosts.context,
template: Ember.Handlebars.compile('<ul>{{#each host in view.hosts}}<li>{{host}}</li>{{/each}}</ul>')
}),
- onPrimary: function () {
- this.hide();
- },
secondary: null
});
},
@@ -1226,12 +1209,7 @@ App.WizardStep3Controller = Em.Controller.extend({
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('')),
+ templateName: require('templates/wizard/step3_registered_hosts_popup'),
message: Em.I18n.t('installer.step3.registeredHostsPopup'),
registeredHosts: self.get('registeredHosts')
})
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 2bd85a5..38987f3 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -321,9 +321,6 @@ App.WizardStep7Controller = Em.Controller.extend({
header: Em.I18n.t('installer.step7.ConfigErrMsg.header'),
primary: Em.I18n.t('ok'),
secondary: null,
- onPrimary: function () {
- this.hide();
- },
bodyClass: Ember.View.extend({
message: Em.I18n.t('installer.step7.ConfigErrMsg.message'),
siteProperties: customConfig,
@@ -417,13 +414,25 @@ App.WizardStep7Controller = Em.Controller.extend({
for (var hostName in hosts) {
var host = hosts[hostName];
+ var disksOverallCapacity = 0;
+ var diskFree = 0;
+ host.disk_info.forEach(function(disk) {
+ disksOverallCapacity += parseFloat(disk.size);
+ diskFree += parseFloat(disk.available);
+ });
App.store.load(App.Host,
{
id: host.name,
+ ip: host.ip,
+ os_type: host.os_type,
+ os_arch: host.os_arch,
host_name: host.name,
public_host_name: host.name,
cpu: host.cpu,
memory: host.memory,
+ disk_info: host.disk_info,
+ disk_total: disksOverallCapacity / (1024 * 1024),
+ disk_free: diskFree / (1024 * 1024),
host_components: host.hostComponents
}
)
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/models/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js
index 6c04d2a..a90c554 100644
--- a/ambari-web/app/models/host.js
+++ b/ambari-web/app/models/host.js
@@ -64,6 +64,11 @@ App.Host = DS.Model.extend({
publicHostNameFormatted: function() {
return this.get('publicHostName').length < 43 ? this.get('publicHostName') : this.get('publicHostName').substr(0, 40) + '...';
}.property('publicHostName'),
+
+ disksMounted: function() {
+ return this.get('diskInfo.length');
+ }.property('diskInfo.length'),
+
/**
* API return diskTotal and diskFree. Need to save their different
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/templates/wizard/step3_host_warning_popup_footer.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step3_host_warning_popup_footer.hbs b/ambari-web/app/templates/wizard/step3_host_warning_popup_footer.hbs
new file mode 100644
index 0000000..163374c
--- /dev/null
+++ b/ambari-web/app/templates/wizard/step3_host_warning_popup_footer.hbs
@@ -0,0 +1,33 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF 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 License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="update-progress pull-left">
+ {{#if view.isUpdateInProgress}}
+ <div class="progress-info active progress">
+ <div class="bar" {{bindAttr style="view.progressWidth"}}></div>
+ </div>
+ {{else}}
+ <label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>
+ {{/if}}
+</div>
+{{#if view.parentView.secondary}}
+ <button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i> {{view.parentView.secondary}}</button>
+{{/if}}
+{{#if view.parentView.primary}}
+ <button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>
+{{/if}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/templates/wizard/step3_registered_hosts_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step3_registered_hosts_popup.hbs b/ambari-web/app/templates/wizard/step3_registered_hosts_popup.hbs
new file mode 100644
index 0000000..c5907a7
--- /dev/null
+++ b/ambari-web/app/templates/wizard/step3_registered_hosts_popup.hbs
@@ -0,0 +1,24 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF 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 License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<p>{{view.message}}</p>
+<ul>
+ {{#each host in view.registeredHosts}}
+ <li>{{host}}</li>
+ {{/each}}
+</ul>
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 9a2f1fa..7c98f43 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -1059,7 +1059,7 @@ var urls = {
}
},
'wizard.step3.host_info': {
- 'real': '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env,Hosts/host_name,Hosts/os_type',
+ 'real': '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env,Hosts/host_name,Hosts/os_type,Hosts/os_arch,Hosts/ip',
'mock': '/data/wizard/bootstrap/two_hosts_information.json',
'format': function (data, opt) {
return {
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f822ca9/ambari-web/app/utils/hosts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/hosts.js b/ambari-web/app/utils/hosts.js
index 6f963c3..a3f61f7 100644
--- a/ambari-web/app/utils/hosts.js
+++ b/ambari-web/app/utils/hosts.js
@@ -79,10 +79,10 @@ module.exports = {
Ember.Object.create({id: 'ip', name: 'IP Address', selected: false}),
Ember.Object.create({id: 'cpu', name: 'CPU', selected: false}),
Ember.Object.create({id: 'memory', name: 'RAM', selected: false}),
- Ember.Object.create({id: 'diskUsage', name: 'Disk Usage', selected: false}),
- Ember.Object.create({id: 'loadAvg', name: 'Load Average', selected: false}),
Ember.Object.create({id: 'osArch', name: 'OS Architecture', selected: false}),
- Ember.Object.create({id: 'osType', name: 'OS Type', selected: false})
+ Ember.Object.create({id: 'osType', name: 'OS Type', selected: false}),
+ Ember.Object.create({id: 'diskTotal', name: 'Total Disks Capacity', selected: false}),
+ Ember.Object.create({id: 'disksMounted', name: '# of Disk Mounts', selected: false})
]),
showOnlySelectedHosts: false,
filterComponents: validComponents,
@@ -103,7 +103,7 @@ module.exports = {
var value = ahost.get(filterColumn.id);
host.set('filterColumnValue', value);
if (filterText != null && filterText.length > 0) {
- if ((value == null || !value.match(filterText)) && !host.get('host.publicHostName').match(filterText)) {
+ if ((value == null || !value.toString().match(filterText)) && !host.get('host.publicHostName').match(filterText)) {
skip = true;
}
}