diff options
author | Yusaku Sako <yusaku@apache.org> | 2012-12-09 13:45:47 +0000 |
---|---|---|
committer | Yusaku Sako <yusaku@apache.org> | 2012-12-09 13:45:47 +0000 |
commit | 0135ae98f75ef2f7550c2477f1fbb750332cdfe6 (patch) | |
tree | c94756e606b9263303859a8dc35bb6386de7b517 /ambari-web | |
parent | 536a305dce59b876b4c728e01bf785f7cd2e1948 (diff) |
AMBARI-1017. Alerts not showing up in Ambari UI due to refactoring. (Srimanth Gunturi via yusaku)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418953 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ambari-web')
-rw-r--r-- | ambari-web/app/controllers/global/cluster_controller.js | 2 | ||||
-rw-r--r-- | ambari-web/app/controllers/main/dashboard.js | 20 | ||||
-rw-r--r-- | ambari-web/app/templates/main/dashboard.hbs | 6 |
3 files changed, 16 insertions, 12 deletions
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index f7c8a3a140..eaea3b0972 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -91,7 +91,7 @@ App.ClusterController = Em.Controller.extend({ 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"; } diff --git a/ambari-web/app/controllers/main/dashboard.js b/ambari-web/app/controllers/main/dashboard.js index 172357655c..a1ef10cd71 100644 --- a/ambari-web/app/controllers/main/dashboard.js +++ b/ambari-web/app/controllers/main/dashboard.js @@ -24,12 +24,16 @@ App.MainDashboardController = Em.Controller.extend({ 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.Controller.extend({ * 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'); diff --git a/ambari-web/app/templates/main/dashboard.hbs b/ambari-web/app/templates/main/dashboard.hbs index 2d9dd2ffca..4a5906fa5e 100644 --- a/ambari-web/app/templates/main/dashboard.hbs +++ b/ambari-web/app/templates/main/dashboard.hbs @@ -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> |