You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2014/02/03 17:52:37 UTC
[2/2] git commit: AMBARI-4507 Out-of-Service mode icon and tooltips.
(ababiichuk)
AMBARI-4507 Out-of-Service mode icon and tooltips. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a127257e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a127257e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a127257e
Branch: refs/heads/trunk
Commit: a127257e718c3a2e3a05b3c23be2e809f3a6b422
Parents: 0de2e01
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Mon Feb 3 18:49:39 2014 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Mon Feb 3 18:52:21 2014 +0200
----------------------------------------------------------------------
ambari-web/app/messages.js | 9 ++++++---
ambari-web/app/models/host.js | 5 ++++-
ambari-web/app/models/host_component.js | 14 ++++++++++++++
ambari-web/app/styles/application.less | 4 ++++
ambari-web/app/templates/main/host/summary.hbs | 12 +++++-------
.../service/info/summary/master_components.hbs | 2 +-
ambari-web/app/views/main/dashboard/service.js | 3 +++
.../app/views/main/dashboard/service/hdfs.js | 3 +++
ambari-web/app/views/main/host/summary.js | 17 +++++++++++++++--
ambari-web/app/views/main/service/info/summary.js | 3 +++
10 files changed, 58 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9f277aa..d872583 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1343,8 +1343,8 @@ Em.I18n.translations = {
'hosts.table.restartComponents.withNames':'Restart {0}',
'hosts.table.restartComponents.withoutNames':'{0} components should be restarted',
- 'hosts.table.componentsInPassiveState.withNames':'{0} in passive state',
- 'hosts.table.componentsInPassiveState.withoutNames':'{0} components in passive state',
+ 'hosts.table.componentsInPassiveState.withNames':'{0} in Out-of-Service mode',
+ 'hosts.table.componentsInPassiveState.withoutNames':'{0} components in Out-of-Service mode',
'hosts.table.menu.l1.selectedHosts':'Selected Hosts',
'hosts.table.menu.l1.filteredHosts':'Filtered Hosts',
@@ -1435,7 +1435,10 @@ Em.I18n.translations = {
'hosts.host.decommissioned':'Decommissioned',
'hosts.host.decommissioning':'Decommissioning...',
-
+ 'hosts.component.passive.implied.host.mode.tooltip':'Cannot Turn Off Out-of-Service mode because Host is in Out-of-Service mode',
+ 'hosts.component.passive.implied.service.mode.tooltip':'Cannot Turn Off Out-of-Service mode because {0} is in Out-of-Service mode',
+ 'hosts.component.passive.mode':'Component is in Out-of-Service mode',
+ 'hosts.host.passive.mode':'Host is in Out-of-Service mode',
'hosts.host.alert.noAlerts':'No alerts',
'hosts.host.alert.noAlerts.message':'There are no alerts for this host.',
'hosts.host.healthStatus.heartBeatNotReceived':'The server has not received a heartbeat from this host for more than 3 minutes.',
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/models/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js
index 297607f..1c72637 100644
--- a/ambari-web/app/models/host.js
+++ b/ambari-web/app/models/host.js
@@ -231,6 +231,9 @@ App.Host = DS.Model.extend({
return item.get('workStatus') !== App.HostComponentStatus.started;
});
var output = '';
+ if (this.get('passiveState') != 'ACTIVE') {
+ return Em.I18n.t('hosts.host.passive.mode');
+ }
switch (this.get('healthClass')){
case 'health-status-DEAD-RED':
hostComponents = hostComponents.filterProperty('isMaster', true);
@@ -254,7 +257,7 @@ App.Host = DS.Model.extend({
break;
}
return output;
- }.property('hostComponents.@each.workStatus')
+ }.property('hostComponents.@each.workStatus','hostComponents.@each.passiveState')
});
App.Host.FIXTURES = [];
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index 3d8384a..f46a1d6 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -156,6 +156,20 @@ App.HostComponent = DS.Model.extend({
* User friendly host component status
* @returns {String}
*/
+ isActive: function() {
+ return (this.get('passiveState') == 'ACTIVE');
+ }.property('passiveState'),
+
+ passiveTooltip: function() {
+ if (!this.get('isActive')) {
+ return Em.I18n.t('hosts.component.passive.mode');
+ }
+ }.property('isActive'),
+
+ statusClass: function() {
+ return this.get('isActive') ? this.get('workStatus') : 'icon-medkit';
+ }.property('workStatus','isActive'),
+
componentTextStatus: function () {
return App.HostComponentStatus.getTextStatus(this.get("workStatus"));
}.property('workStatus','isDecommissioning')
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 22f13a9..9257e8e 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1770,6 +1770,10 @@ width:100%;
color: #666;
font-size: 13px;
+ .icon-medkit {
+ color: black!important;
+ }
+
td.summary-label {
width: 180px;
text-align: right;
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/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 ebdd90b..a27b2c3 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -47,7 +47,7 @@
</a>
{{/if}}
{{else}}
- <span {{bindAttr class="view.statusClass :components-health"}}></span>
+ <span rel='componentHealthTooltip' {{bindAttr class="view.statusClass :components-health" title="view.componentTextStatus"}}></span>
{{/if}}
{{#if component.displayNameAdvanced}}
{{component.displayNameAdvanced}}
@@ -193,23 +193,21 @@
</a>
</li>
{{/if}}
- {{#unless view.isImplied}}
{{#if view.isActive}}
- <li {{bindAttr class="view.noActionAvailable"}}>
- <a href="javascript:void(null)"
+ <li rel='passiveTooltip' {{bindAttr class="view.noActionAvailable" title="view.passiveImpliedTextStatus"}}>
+ <a href="javascript:void(null)" {{bindAttr class="view.isImplied:disabled"}}
data-toggle="modal" {{action "turnOnOffPassiveConfirmation" view.content target="controller"}}>
{{t passiveState.turnOn}}
</a>
</li>
{{else}}
- <li {{bindAttr class="view.noActionAvailable"}}>
- <a href="javascript:void(null)"
+ <li rel='passiveTooltip' {{bindAttr class="view.noActionAvailable" title="view.passiveImpliedTextStatus"}}>
+ <a href="javascript:void(null)" {{bindAttr class="view.isImplied:disabled"}}
data-toggle="modal" {{action "turnOnOffPassiveConfirmation" view.content target="controller"}}>
{{t passiveState.turnOff}}
</a>
</li>
{{/if}}
- {{/unless}}
{{/unless}}
</ul>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/templates/main/service/info/summary/master_components.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary/master_components.hbs b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
index 977fbcc..caf8611 100644
--- a/ambari-web/app/templates/main/service/info/summary/master_components.hbs
+++ b/ambari-web/app/templates/main/service/info/summary/master_components.hbs
@@ -28,7 +28,7 @@
</a>
</td>
<td>
- <span {{bindAttr class="masterComp.workStatus"}}></span>
+ <span rel='healthTooltip' {{bindAttr class="masterComp.statusClass" title="masterComp.passiveTooltip"}}></span>
{{masterComp.componentTextStatus}}
</td>
</tr>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/views/main/dashboard/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service.js b/ambari-web/app/views/main/dashboard/service.js
index b20285a..53508d6 100644
--- a/ambari-web/app/views/main/dashboard/service.js
+++ b/ambari-web/app/views/main/dashboard/service.js
@@ -115,6 +115,9 @@ App.MainDashboardServiceView = Em.View.extend({
}.property('controller.data'),
dashboardMasterComponentView : Em.View.extend({
+ didInsertElement: function() {
+ App.tooltip($('[rel=healthTooltip]'));
+ },
templateName: require('templates/main/service/info/summary/master_components'),
mastersComp : function(){
return this.get('parentView.service.hostComponents').filterProperty('isMaster', true);
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/views/main/dashboard/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js
index 8927a5c..96caf49 100644
--- a/ambari-web/app/views/main/dashboard/service/hdfs.js
+++ b/ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -38,6 +38,9 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
}),
dashboardMasterComponentView: Em.View.extend({
+ didInsertElement: function() {
+ App.tooltip($('[rel=healthTooltip]'));
+ },
templateName: require('templates/main/service/info/summary/master_components'),
mastersComp : function() {
return this.get('parentView.service.hostComponents').filter(function(comp){
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/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 9172fb8..8d5f412 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -224,6 +224,8 @@ App.MainHostSummaryView = Em.View.extend({
ComponentView: Em.View.extend({
content: null,
didInsertElement: function () {
+ App.tooltip($('[rel=componentHealthTooltip]'));
+ App.tooltip($('[rel=passiveTooltip]'));
if (this.get('isInProgress')) {
this.doBlinking();
}
@@ -262,6 +264,9 @@ App.MainHostSummaryView = Em.View.extend({
* Return host component text status
*/
componentTextStatus: function () {
+ if (this.get('content.passiveState') != 'ACTIVE') {
+ return Em.I18n.t('hosts.component.passive.mode');
+ }
var workStatus = this.get("workStatus");
var componentTextStatus = this.get('content.componentTextStatus');
var hostComponent = this.get('hostComponent');
@@ -289,9 +294,17 @@ App.MainHostSummaryView = Em.View.extend({
}
}
return componentTextStatus;
- }.property('workStatus','isDataNodeRecommissionAvailable', 'isDataNodeDecommissioning', 'isNodeManagerRecommissionAvailable',
+ }.property('content.passiveState','workStatus','isDataNodeRecommissionAvailable', 'isDataNodeDecommissioning', 'isNodeManagerRecommissionAvailable',
'isTaskTrackerRecommissionAvailable', 'isRegionServerRecommissionAvailable', 'isRegionServerDecommissioning'),
+ passiveImpliedTextStatus: function() {
+ if(this.get('parentView.content.passiveState') === 'PASSIVE') {
+ return Em.I18n.t('hosts.component.passive.implied.host.mode.tooltip');
+ } else if(this.get('content.service.passiveState') === 'PASSIVE') {
+ return Em.I18n.t('hosts.component.passive.implied.service.mode.tooltip').format(this.get('content.service.serviceName'));
+ }
+ }.property('content.passiveState','parentView.content.passiveState'),
+
statusClass: function () {
//If the component is DataNode
if (this.get('isDataNode')) {
@@ -433,7 +446,7 @@ App.MainHostSummaryView = Em.View.extend({
}.property('content.passiveState'),
isImplied: function() {
- return (this.get('content.passiveState') == "IMPLIED");
+ return (this.get('parentView.content.passiveState') === 'PASSIVE' || this.get('content.service.passiveState') === 'PASSIVE');
}.property('content.passiveState'),
isDecommissioning: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/a127257e/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 26f4141..47fa265 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -55,6 +55,9 @@ App.MainServiceInfoSummaryView = Em.View.extend({
servicesHaveClients: ["OOZIE", "ZOOKEEPER", "HIVE", "MAPREDUCE2", "TEZ"],
sumMasterComponentView : Em.View.extend({
+ didInsertElement: function() {
+ App.tooltip($('[rel=healthTooltip]'));
+ },
templateName: require('templates/main/service/info/summary/master_components'),
mastersComp : function(){
return this.get('parentView.service.hostComponents').filterProperty('isMaster', true);