You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/01/21 19:07:15 UTC
git commit: AMBARI-4371 YARN ATS: implement Hosts/Host Details
changes. (Denys Buzhor via atkach)
Updated Branches:
refs/heads/trunk 6f152614a -> 76e0c5547
AMBARI-4371 YARN ATS: implement Hosts/Host Details changes. (Denys Buzhor via atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76e0c554
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76e0c554
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76e0c554
Branch: refs/heads/trunk
Commit: 76e0c5547f1afccb8f53a4a6ebc92540f8cf55cb
Parents: 6f15261
Author: atkach <at...@hortonworks.com>
Authored: Tue Jan 21 20:07:09 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Tue Jan 21 20:07:09 2014 +0200
----------------------------------------------------------------------
ambari-web/app/config.js | 2 ++
ambari-web/app/controllers/main/host/details.js | 6 ++++++
ambari-web/app/templates/main/host/summary.hbs | 7 +++++++
ambari-web/app/views/main/host/summary.js | 22 +++++++++++---------
4 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/76e0c554/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 8bd445b..5ee5b45 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -39,6 +39,8 @@ App.pageReloadTime=3600000;
App.singleNodeInstall = false;
App.singleNodeAlias = document.location.hostname;
App.reassignableComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER'];
+App.restartableComponents = ['APP_TIMELINE_SERVER'];
+App.deletableComponents = ['SUPERVISOR', 'HBASE_MASTER'];
// experimental features are automatically enabled if running on brunch server
App.enableExperimental = false;
http://git-wip-us.apache.org/repos/asf/ambari/blob/76e0c554/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 f93124a..fa1ef5b 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -360,6 +360,12 @@ App.MainHostDetailsController = Em.Controller.extend({
});
},
+ restartComponent: function(event) {
+ var component = event.context;
+ App.showConfirmationPopup(function(){
+ batchUtils.restartHostComponents([component]);
+ });
+ },
/**
* send command to server to install selected host component
* @param event
http://git-wip-us.apache.org/repos/asf/ambari/blob/76e0c554/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 4cd7158..ecda7f8 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -97,6 +97,13 @@
</a>
</li>
{{/if}}
+ {{#if view.isRestartableComponent}}
+ <li {{bindAttr class="view.isRestartComponentDisabled:disabled"}}>
+ <a href="javascript:void(null)" data-toggle="modal" {{action "restartComponent" view.content target="controller"}}>
+ {{t common.restart}}
+ </a>
+ </li>
+ {{/if}}
{{#unless view.isInstalling}}
{{#unless view.isInMaintenance}}
{{#if view.isStart}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/76e0c554/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 dada7e8..dc3f2a6 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -468,16 +468,9 @@ App.MainHostSummaryView = Em.View.extend({
* Shows whether we need to show Delete button
*/
isDeletableComponent: function () {
- var canDelete = false;
- switch (this.get('content.componentName')) {
- case 'HBASE_MASTER':
- case 'SUPERVISOR':
- canDelete = true;
- break;
- default:
- }
- return canDelete;
+ return App.deletableComponents.contains(this.get('content.componentName'));
}.property('content'),
+
isDeleteComponentDisabled: function () {
return !(this.get('workStatus') == App.HostComponentStatus.stopped || this.get('workStatus') == App.HostComponentStatus.unknown ||
this.get('workStatus') == App.HostComponentStatus.install_failed || this.get('workStatus') == App.HostComponentStatus.upgrade_failed);
@@ -485,7 +478,16 @@ App.MainHostSummaryView = Em.View.extend({
isReassignable: function () {
return App.supports.reassignMaster && App.reassignableComponents.contains(this.get('content.componentName')) && App.Host.find().content.length > 1;
- }.property('content.componentName')
+ }.property('content.componentName'),
+
+ isRestartableComponent: function() {
+ return App.restartableComponents.contains(this.get('content.componentName'));
+ }.property('content'),
+
+ isRestartComponentDisabled: function() {
+ var allowableStates = [App.HostComponentStatus.started];
+ return !allowableStates.contains(this.get('workStatus'));
+ }.property('workStatus')
}),
timeSinceHeartBeat: function () {