You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/02/06 23:39:08 UTC

svn commit: r1443250 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/main/host.js ambari-web/app/models/host.js ambari-web/app/templates/main/host.hbs ambari-web/app/templates/main/host/details.hbs

Author: jaimin
Date: Wed Feb  6 22:39:08 2013
New Revision: 1443250

URL: http://svn.apache.org/viewvc?rev=1443250&view=rev
Log:
AMBARI-1352. Host-level alert badges should only show the total number

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/host.js
    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

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1443250&r1=1443249&r2=1443250&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Feb  6 22:39:08 2013
@@ -255,6 +255,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1352. Host-level alert badges should only show the total number
+ of CRIT and WARN alerts for the host excluding OK. (jaimin)
+
  AMBARI-1355. Inconsistent casing and component name for alert title. (jaimin)
 
  AMBARI-1354. "No alerts" badge on the Host Detail page should be green, not red. (jaimin)

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/host.js?rev=1443250&r1=1443249&r2=1443250&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/host.js Wed Feb  6 22:39:08 2013
@@ -26,7 +26,7 @@ App.MainHostController = Em.ArrayControl
   comeWithFilter: false,
 
   hostsWithAlerts: function () {
-    return App.Alert.find().mapProperty('hostName').uniq();
+    return App.router.get('clusterController.alerts').filterProperty('isOk', false).mapProperty('hostName').uniq();
   }.property('App.router.clusterController.alerts.length'),
 
   /**
@@ -113,7 +113,7 @@ App.MainHostController = Em.ArrayControl
         hostAlerts: function () {
           var allAlerts = App.router.get('clusterController.alerts');
           if (host) {
-            return allAlerts.filterProperty('hostName', host.get('hostName'));
+            return allAlerts.filterProperty('hostName', host.get('hostName')).filterProperty('isOk', false);
           }
           return 0;
         }.property('App.router.clusterController.alerts'),

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=1443250&r1=1443249&r2=1443250&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host.js Wed Feb  6 22:39:08 2013
@@ -52,8 +52,8 @@ App.Host = DS.Model.extend({
   loadFive:DS.attr('number'),
   loadFifteen:DS.attr('number'),
 
-  alertsCount: function () {
-    return App.Alert.find().filterProperty('hostName', this.get('hostName')).length;
+  criticalAlertsCount: function () {
+    return App.router.get('clusterController.alerts').filterProperty('hostName', this.get('hostName')).filterProperty('isOk', false).length;
   }.property('App.router.clusterController.alerts.length'),
 
   publicHostNameFormatted: function() {

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=1443250&r1=1443249&r2=1443250&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/host.hbs Wed Feb  6 22:39:08 2013
@@ -63,8 +63,8 @@
       </td>
       <td class="name">
         <a title="{{unbound host.publicHostName}}" href="#" {{action "showDetails" host}}>{{unbound host.publicHostNameFormatted}}</a>
-        {{#if host.alertsCount}}
-          <span class="label label-important alerts-count" {{action "showAlertsPopup" host target="controller"}}>{{host.alertsCount}}</span>
+        {{#if host.criticalAlertsCount}}
+          <span class="label label-important alerts-count" {{action "showAlertsPopup" host target="controller"}}>{{host.criticalAlertsCount}}</span>
         {{/if}}
       </td>
       <td>{{host.ip}}</td>

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=1443250&r1=1443249&r2=1443250&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 Wed Feb  6 22:39:08 2013
@@ -18,8 +18,8 @@
 
 <div id="host-details">
   <span {{bindAttr class="view.content.healthClass"}} {{bindAttr title="view.content.healthToolTip" }}></span><span class='host-title'>{{unbound view.content.publicHostName}}</span>
-  {{#if view.content.alertsCount}}
-    <span class="label label-important alerts-count" {{action "showAlertsPopup" content target="App.router.mainHostController"}}>{{view.content.alertsCount}}</span>
+  {{#if view.content.criticalAlertsCount}}
+  <span class="label label-important alerts-count" {{action "showAlertsPopup" content target="App.router.mainHostController"}}>{{view.content.criticalAlertsCount}}</span>
   {{else}}
     <span class="label label-success alerts-count">{{t hosts.host.alert.noAlerts}}</span>
   {{/if}}