You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/01/23 19:43:46 UTC

ambari git commit: AMBARI-9308. Alerts: Hosts badge shows red when there are only warn level alerts on the hosts

Repository: ambari
Updated Branches:
  refs/heads/trunk eb7e11c63 -> b7613c0b3


AMBARI-9308. Alerts: Hosts badge shows red when there are only warn level alerts on the hosts


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b7613c0b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b7613c0b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b7613c0b

Branch: refs/heads/trunk
Commit: b7613c0b3d6c64d6024d5158a6e7a299f86e0498
Parents: eb7e11c
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Fri Jan 23 10:19:49 2015 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Fri Jan 23 10:40:51 2015 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js     |  1 +
 ambari-web/app/styles/application.less      | 10 ++++++++--
 ambari-web/app/templates/main/menu_item.hbs |  2 +-
 ambari-web/app/views/main/menu.js           |  4 ++++
 4 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b7613c0b/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 1ba1faf..cd6b3d2 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -310,6 +310,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
       'ALERT': data.Clusters.health_report['Host/host_status/ALERT'],
       'UNKNOWN': data.Clusters.health_report['Host/host_status/UNKNOWN'],
       'health-status-WITH-ALERTS': (data.alerts_summary_hosts) ? data.alerts_summary_hosts.CRITICAL + data.alerts_summary_hosts.WARNING : 0,
+      'health-status-CRITICAL': (data.alerts_summary_hosts) ? data.alerts_summary_hosts.CRITICAL : 0,
       'health-status-RESTART': data.Clusters.health_report['Host/stale_config'],
       'health-status-PASSIVE_STATE': data.Clusters.health_report['Host/maintenance_state'],
       'TOTAL': data.Clusters.total_hosts

http://git-wip-us.apache.org/repos/asf/ambari/blob/b7613c0b/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 9abde83..2513f33 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -202,9 +202,15 @@ footer {
         text-decoration: none;
         background-color: transparent;
       }
-      .alerts-count {
-        margin: 1px;
+      .alerts-crit-count {
+        margin-left: 0;
         background: @health-status-red;
+        cursor: pointer;
+      }
+      .alerts-warn-count {
+        margin-left: 0;
+        background: @health-status-orange;
+        cursor: pointer;
       }
       .icon-th {
         font-size: 1.3em;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b7613c0b/ambari-web/app/templates/main/menu_item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/menu_item.hbs b/ambari-web/app/templates/main/menu_item.hbs
index 769ff7e..bd471b4 100644
--- a/ambari-web/app/templates/main/menu_item.hbs
+++ b/ambari-web/app/templates/main/menu_item.hbs
@@ -20,7 +20,7 @@
 <a href="#" {{action goToSection view.content.routing target="view"}}>
   {{{unbound view.content.label}}}
   {{#if view.hasAlertsLabel}}
-    <span class="label alerts-count">
+    <span {{bindAttr class=":label view.hasCriticalAlerts:alerts-crit-count:alerts-warn-count"}}>
       {{view.alertsCount}}
     </span>
   {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b7613c0b/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index 8bc8f2e..0a09003 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -74,6 +74,10 @@ App.MainMenuView = Em.CollectionView.extend({
       return App.router.get('mainHostController.hostsCountMap.health-status-WITH-ALERTS');
     }.property('App.router.mainHostController.hostsCountMap'),
 
+    hasCriticalAlerts: function () {
+      return App.router.get('mainHostController.hostsCountMap.health-status-CRITICAL') > 0;
+    }.property('content.hasAlertsLabel', 'alertsCount'),
+
     hasAlertsLabel: function () {
       return this.get('content.hasAlertsLabel') && this.get('alertsCount') > 0;
     }.property('content.hasAlertsLabel', 'alertsCount'),