Author: yusaku
Date: Tue Jan 22 21:16:36 2013
New Revision: 1437178
URL: http://svn.apache.org/viewvc?rev=1437178&view=rev
Log:
AMBARI-1235. Host health indicator should have a tooltip showing details.
(yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/messages.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=1437178&r1=1437177&r2=1437178&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Jan 22 21:16:36 2013
@@ -16,6 +16,9 @@ Trunk (unreleased changes):
various hadoop artifacts back to Ambari. (Nate Cole via mahadev)
IMPROVEMENTS
+
+ AMBARI-1235. Host health indicator should have a tooltip showing details.
+ (yusaku)
AMBARI-1234. On Heatmap host hover, including list of components running.
(yusaku)
Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1437178&r1=1437177&r2=1437178&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Tue Jan 22 21:16:36 2013
@@ -283,6 +283,9 @@ Em.I18n.translations = {
'hosts.host.stop.popup.header':'Confirmation',
'hosts.host.start.popup.body':'Are you sure?',
'hosts.host.stop.popup.body':'Are you sure?',
+ 'hosts.host.healthStatus.heartBeatNotReceived':'The server has not received
a heartbeat from this host for more than 3 minutes.',
+ 'hosts.host.healthStatus.mastersDown':"The following master components are
down:\n",
+ 'hosts.host.healthStatus.slavesDown':"The following slave components are
down:\n",
'hosts.decommission.popup.body':'Are you sure?',
'hosts.decommission.popup.header':'Confirmation',
'hosts.delete.popup.body':'Are you sure?',
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=1437178&r1=1437177&r2=1437178&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs Tue Jan 22
21:16:36 2013
@@ -59,7 +59,7 @@
{{#view view.HostView contentBinding="host"}}
<tr>
<td class="first">
- <span {{bindAttr class="host.healthClass"}}></span>
+ <span {{bindAttr class="host.healthClass"}} {{bindAttr
title="view.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=1437178&r1=1437177&r2=1437178&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 Tue
Jan 22 21:16:36 2013
@@ -17,7 +17,7 @@
}}
<div id="host-details">
- <span {{bindAttr class="view.content.healthClass"}}></span><span
class='host-title'>{{unbound view.content.publicHostName}}</span>
+ <span {{bindAttr class="view.content.healthClass"}} {{bindAttr
title="view.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=1437178&r1=1437177&r2=1437178&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/host.js Tue Jan 22
21:16:36 2013
@@ -19,6 +19,7 @@
var App = require('app');
require('utils/data_table');
var filters = require('views/common/filter_view');
+var date = require('utils/date');
App.MainHostView = Em.View.extend({
templateName:require('templates/main/host'),
@@ -69,6 +70,35 @@ 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=1437178&r1=1437177&r2=1437178&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 Tue Jan 22
21:16:36 2013
@@ -17,6 +17,7 @@
*/
var App = require('app');
+var date = require('utils/date');
App.MainHostDetailsView = Em.View.extend({
templateName: require('templates/main/host/details'),
@@ -28,5 +29,34 @@ App.MainHostDetailsView = Em.View.extend
maintenance: function(){
var options = [{action: 'deleteHost', 'label': 'Delete Host'}];
return options;
- }.property('controller.content')
+ }.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')
});