Repository: ambari Updated Branches: refs/heads/trunk f5b439bf5 -> 48f033580
AMBARI-6796. Flume: assign specific id's and/or classes to the markup to ease test automation (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/48f03358 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/48f03358 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/48f03358 Branch: refs/heads/trunk Commit: 48f033580943d17cb3b5fe1245de470efb8caba6 Parents: f5b439b Author: Alex Antonenko <[email protected]> Authored: Fri Aug 8 23:15:08 2014 +0300 Committer: Alex Antonenko <[email protected]> Committed: Fri Aug 8 23:15:08 2014 +0300 ---------------------------------------------------------------------- .../app/templates/main/service/services/flume.hbs | 16 ++++++++-------- .../app/views/main/service/services/flume.js | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/48f03358/ambari-web/app/templates/main/service/services/flume.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/flume.hbs b/ambari-web/app/templates/main/service/services/flume.hbs index b6f7689..bdf5fd8 100644 --- a/ambari-web/app/templates/main/service/services/flume.hbs +++ b/ambari-web/app/templates/main/service/services/flume.hbs @@ -20,7 +20,7 @@ <div id="flume-summary"> <a href="#" {{action filterHosts view.flumeHandlerComponent}}>{{view.summaryHeader}}</a> <a href="#" class="pull-right" {{action gotoConfigs target="controller"}}>{{t dashboard.services.flume.summary.configure}}</a> - <div id="flume-agent-table" class="scrollable-container"> + <div id="flume-agent-table-wrap" class="scrollable-container"> <table class="table table-hover table-bordered table-striped" id="flume-agents-table"> <thead> {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}} @@ -33,7 +33,7 @@ </thead> {{#if view.pageContent}} {{#each host in view.pageContent}} - <tbody> + <tbody class="flume-agent-table-tbody"> {{#view view.agentView contentBinding="host"}} <td {{bindAttr rowspan="host.rowspan"}} id="flume-host-agent-row" class="agent-host-name"> <a href="javascript:void(null)" {{action showDetails host.agents}}> @@ -75,7 +75,7 @@ </td> {{/view}} {{#each agent in host.otherAgents}} - <tr> + {{#view view.agentView contentBinding="host"}} <td class="agent-status"> <div class="wrapp-flume-status"> <span {{bindAttr class="agent.healthClass"}}></span> {{agent.name}} @@ -100,22 +100,22 @@ </div> </div> </td> - <td> + <td class="flume-agent-sources-count"> {{agent.sourcesCount}} </td> - <td> + <td class="flume-agent-channels-count"> {{agent.channelsCount}} </td> - <td> + <td class="flume-agent-sink-count"> {{agent.sinksCount}} </td> - </tr> + {{/view}} {{/each}} </tbody> {{/each}} {{else}} <tr> - <td colspan="6" class="empty-label"> + <td colspan="6" id="flume-agents-empty-label" class="empty-label"> {{t services.service.summary.flume.noAgents}} </td> </tr> http://git-wip-us.apache.org/repos/asf/ambari/blob/48f03358/ambari-web/app/views/main/service/services/flume.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/flume.js b/ambari-web/app/views/main/service/services/flume.js index e847f31..b2d29d3 100644 --- a/ambari-web/app/views/main/service/services/flume.js +++ b/ambari-web/app/views/main/service/services/flume.js @@ -26,12 +26,15 @@ App.MainDashboardServiceFlumeView = App.TableView.extend({ selectedHost: null, + flumeAgentsCount:0, + content: function () { - var hostNames = this.get('service.agents').mapProperty('hostName').uniq(), + var flumeAgents = this.get('service.agents'), + hostNames = flumeAgents.mapProperty('hostName').uniq(), content = [], self = this; hostNames.forEach(function(hostName) { - var agents = self.get('service.agents').filterProperty('hostName', hostName); + var agents = flumeAgents.filterProperty('hostName', hostName); content.push( Em.Object.create({ hostName: hostName, @@ -43,7 +46,9 @@ App.MainDashboardServiceFlumeView = App.TableView.extend({ ); }); return content; - }.property('service.agents.length', '[email protected]'), + }.property('[email protected]', 'flumeAgentsCount'), + + summaryHeader: function () { var agents = App.FlumeService.find().objectAt(0).get('agents'), @@ -95,7 +100,11 @@ App.MainDashboardServiceFlumeView = App.TableView.extend({ agent.set('isStopAgentDisabled', agent.get('status') !== 'RUNNING'); }); }); - }.observes('[email protected][email protected]'), + }.observes('[email protected]'), + + updateFlumeAgentsCount: function () { + this.set('flumeAgentsCount', this.get('service.agents.length')); + }.observes('service.agents.length'), /** * Action handler from flume tepmlate.
