Author: yusaku
Date: Thu Jan 31 00:31:44 2013
New Revision: 1440753
URL: http://svn.apache.org/viewvc?rev=1440753&view=rev
Log:
AMBARI-1311. Host health indicator should have a tooltip showing few details
(refactoring). (Arun Kandregula via yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/models/host.js
incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/host/details.hbs
incubator/ambari/trunk/ambari-web/app/views/main/host.js
incubator/ambari/trunk/ambari-web/app/views/main/host/details.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Jan 31 00:31:44 2013
@@ -36,6 +36,9 @@ Trunk (unreleased changes):
IMPROVEMENTS
+ AMBARI-1311. Host health indicator should have a tooltip showing few details
-
+ refactoring. (Arun Kandregula via yusaku)
+
AMBARI-1303. Remake clearFilters function in app_view. (Arun Kandregula via
yusaku)
Modified: incubator/ambari/trunk/ambari-web/app/models/host.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/host.js?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host.js Thu Jan 31 00:31:44
2013
@@ -144,7 +144,35 @@ App.Host = DS.Model.extend({
}
}
return 'health-status-' + healthStatus;
- }.property('healthStatus', '[email protected]')
+ }.property('healthStatus', '[email protected]'),
+ healthToolTip: function(){
+ var hostComponents = this.get('hostComponents').filter(function(item){
+ if(item.get('workStatus') !== App.HostComponentStatus.started){
+ return true;
+ }
+ });
+ var output = '';
+ switch (this.get('healthClass')){
+ case 'health-status-DEAD':
+ hostComponents = hostComponents.filterProperty('isMaster', true);
+ output = Em.I18n.t('hosts.host.healthStatus.mastersDown');
+ hostComponents.forEach(function(hc, index){
+ output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
+ }, this);
+ break;
+ case 'health-status-DEAD-YELLOW':
+ output = Em.I18n.t('hosts.host.healthStatus.heartBeatNotReceived');
+ break;
+ case 'health-status-DEAD-ORANGE':
+ hostComponents = hostComponents.filterProperty('isSlave', true);
+ output = Em.I18n.t('hosts.host.healthStatus.slavesDown');
+ hostComponents.forEach(function(hc, index){
+ output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
+ }, this);
+ break;
+ }
+ return output;
+ }.property('healthClass')
});
App.Host.FIXTURES = [];
\ No newline at end of file
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs Thu Jan 31
00:31:44 2013
@@ -59,7 +59,7 @@
{{#view view.HostView contentBinding="host"}}
<tr>
<td class="first">
- <span {{bindAttr class="host.healthClass"}} {{bindAttr
title="view.healthToolTip" }}></span>
+ <span {{bindAttr class="host.healthClass"}} {{bindAttr
title="host.healthToolTip" }}></span>
</td>
<td class="name">
<a title="{{unbound host.publicHostName}}" href="#" {{action
"showDetails" host}}>{{unbound host.publicHostNameFormatted}}</a>
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/host/details.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/host/details.hbs?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/host/details.hbs
(original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/host/details.hbs Thu
Jan 31 00:31:44 2013
@@ -17,7 +17,7 @@
}}
<div id="host-details">
- <span {{bindAttr class="view.content.healthClass"}} {{bindAttr
title="view.healthToolTip" }}></span><span class='host-title'>{{unbound
view.content.publicHostName}}</span>
+ <span {{bindAttr class="view.content.healthClass"}} {{bindAttr
title="view.content.healthToolTip" }}></span><span class='host-title'>{{unbound
view.content.publicHostName}}</span>
<div><a href="javascript:void(null)" data-toggle="modal" {{action
backToHostsList}}><i class="icon-arrow-left"></i> Back to Hosts</a></div>
<!-- {{#if App.isAdmin}} -->
<!-- <div class="host-maintenance"> -->
Modified: incubator/ambari/trunk/ambari-web/app/views/main/host.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/host.js?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/host.js Thu Jan 31
00:31:44 2013
@@ -71,35 +71,6 @@ App.MainHostView = Em.View.extend({
HostView:Em.View.extend({
content:null,
- healthToolTip: function(){
- var hostComponents =
this.get('content.hostComponents').filter(function(item){
- if(item.get('workStatus') !== App.HostComponentStatus.started){
- return true;
- }
- });
- var output = '';
- switch (this.get('content.healthClass')){
- case 'health-status-DEAD':
- hostComponents = hostComponents.filterProperty('isMaster', true);
- output = Em.I18n.t('hosts.host.healthStatus.mastersDown');
- hostComponents.forEach(function(hc, index){
- output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
- }, this);
- break;
- case 'health-status-DEAD-YELLOW':
- output = Em.I18n.t('hosts.host.healthStatus.heartBeatNotReceived');
- break;
- case 'health-status-DEAD-ORANGE':
- hostComponents = hostComponents.filterProperty('isSlave', true);
- output = Em.I18n.t('hosts.host.healthStatus.slavesDown');
- hostComponents.forEach(function(hc, index){
- output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
- }, this);
- break;
- }
- return output;
- }.property('content.healthClass'),
-
shortLabels: function() {
var labels = this.get('content.hostComponents').getEach('displayName');
var shortLabels = '';
Modified: incubator/ambari/trunk/ambari-web/app/views/main/host/details.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/host/details.js?rev=1440753&r1=1440752&r2=1440753&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/host/details.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/host/details.js Thu Jan 31
00:31:44 2013
@@ -29,34 +29,5 @@ App.MainHostDetailsView = Em.View.extend
maintenance: function(){
var options = [{action: 'deleteHost', 'label': 'Delete Host'}];
return options;
- }.property('controller.content'),
-
- healthToolTip: function(){
- var hostComponents =
this.get('content.hostComponents').filter(function(item){
- if(item.get('workStatus') !== App.HostComponentStatus.started){
- return true;
- }
- });
- var output = '';
- switch (this.get('content.healthClass')){
- case 'health-status-DEAD':
- hostComponents = hostComponents.filterProperty('isMaster', true);
- output = Em.I18n.t('hosts.host.healthStatus.mastersDown');
- hostComponents.forEach(function(hc, index){
- output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
- }, this);
- break;
- case 'health-status-DEAD-YELLOW':
- output = Em.I18n.t('hosts.host.healthStatus.heartBeatNotReceived');
- break;
- case 'health-status-DEAD-ORANGE':
- hostComponents = hostComponents.filterProperty('isSlave', true);
- output = Em.I18n.t('hosts.host.healthStatus.slavesDown');
- hostComponents.forEach(function(hc, index){
- output += (index == (hostComponents.length-1)) ?
hc.get('displayName') : (hc.get('displayName')+", ");
- }, this);
- break;
- }
- return output;
- }.property('content.healthClass')
+ }.property('controller.content')
});