incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1418953 - in /incubator/ambari/branches/AMBARI-666: AMBARI-666-CHANGES.txt ambari-web/app/controllers/global/cluster_controller.js ambari-web/app/controllers/main/dashboard.js ambari-web/app/templates/main/dashboard.hbs
Date Sun, 09 Dec 2012 13:45:48 GMT
Author: yusaku
Date: Sun Dec  9 13:45:47 2012
New Revision: 1418953

URL: http://svn.apache.org/viewvc?rev=1418953&view=rev
Log:
AMBARI-1017. Alerts not showing up in Ambari UI due to refactoring. (Srimanth Gunturi via
yusaku)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1418953&r1=1418952&r2=1418953&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Sun Dec  9 13:45:47 2012
@@ -476,6 +476,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1017. Alerts not showing up in Ambari UI due to model refactoring.
+  (Srimanth Gunturi via yusaku)
+
   AMBARI-1013. Host metrics charts should use live data. (Srimanth Gunturi
   via yusaku)
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js?rev=1418953&r1=1418952&r2=1418953&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
Sun Dec  9 13:45:47 2012
@@ -91,7 +91,7 @@ App.ClusterController = Em.Controller.ex
         if (svcComponents) {
           var nagiosSvcComponent = svcComponents.findProperty("componentName", "NAGIOS_SERVER");
           if(nagiosSvcComponent){
-            var hostName = nagiosSvcComponent.get('host_name');
+            var hostName = nagiosSvcComponent.get('host.hostName');
             if(hostName){
               return "http://"+hostName+"/nagios";
             }

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js?rev=1418953&r1=1418952&r2=1418953&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/dashboard.js Sun
Dec  9 13:45:47 2012
@@ -24,12 +24,16 @@ App.MainDashboardController = Em.Control
     return App.router.get('clusterController.alerts');
   }.property('App.router.clusterController.alerts'),
 
-  alertsFilteredBy: 'All',
+  alertsFilteredByName: 'All',
+  alertsFilteredByType: 'All',
   alertsFilter: function(event) {
-    if (event.context)
-      this.set('alertsFilteredBy', event.context.get('serviceName'));
-    else
-      this.set('alertsFilteredBy', 'All');
+    if (event.context && event.context.model && event.context.model.get('serviceName')){
+      this.set('alertsFilteredByName', event.context.model.get('displayName'));
+      this.set('alertsFilteredByType', event.context.model.get('serviceName'));
+    } else {
+      this.set('alertsFilteredByName', 'All');
+      this.set('alertsFilteredByType', 'All');
+    }
   },
   /**
    * We do not want to re-get all the data everytime the filter
@@ -37,15 +41,15 @@ App.MainDashboardController = Em.Control
    * load.
    */
   displayAlerts: function(){
-    if(this.get('alertsFilteredBy')=='All')
+    if(this.get('alertsFilteredByType')=='All')
       return this.get('alerts');
     else
-      var type = this.get('alertsFilteredBy').toLowerCase();
+      var type = this.get('alertsFilteredByType').toLowerCase();
       return this.get('alerts').filter(function(item){
         var serviceType = item.get('serviceType');
         return serviceType && serviceType.toLowerCase()==type.toLowerCase();
       });
-  }.property('alerts', 'alertsFilteredBy'),
+  }.property('alerts', 'alertsFilteredByType'),
   
   nagiosUrl: function(){
     return App.router.get('clusterController.nagiosUrl');

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs?rev=1418953&r1=1418952&r2=1418953&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs Sun Dec
 9 13:45:47 2012
@@ -64,12 +64,12 @@
       <div class="box-header">
         <h4>Alerts</h4>
         <div class="btn-group">
-          <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">{{controller.alertsFilteredBy}}
<span class="caret"></span></button>
+          <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">{{controller.alertsFilteredByName}}
<span class="caret"></span></button>
           <a class="btn" target="_blank" rel="tooltip" title="Go to Nagios" {{bindAttr
href="controller.nagiosUrl"}}><i class="icon-link"></i></a>
           <ul class="dropdown-menu">
             <li><a {{action alertsFilter target="controller"}} href="javascript:void(null)">All</a></li>
-            {{#each service in controller.services}}
-              <li><a {{action alertsFilter service target="controller"}} href="javascript:void(null)">{{service.displayName}}</a></li>
+            {{#each service in view.content}}
+              <li><a {{action alertsFilter service target="controller"}} href="javascript:void(null)">{{service.model.displayName}}</a></li>
             {{/each}}
           </ul>
         </div>



Mime
View raw message