Author: yusaku
Date: Sat Jan 19 01:47:16 2013
New Revision: 1435453

URL: http://svn.apache.org/viewvc?rev=1435453&view=rev
Log:
AMBARI-1226. On Dashboard, links to host components are missing. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hive.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/oozie.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hive.js
    
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
    incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/oozie.js
    
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Sat Jan 19 01:47:16 2013
@@ -75,6 +75,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1226. On Dashboard, links to host components are missing. (yusaku)
+
  AMBARI-1219. After adding hosts, the number of live TaskTrackers is not
  updated. (yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Sat Jan 19 01:47:16 2013
@@ -381,6 +381,17 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
+  'dashboard.services.hive.client': '{0} Hive Client',
+  'dashboard.services.hive.clients': '{0} Hive Clients',
+
+  'dashboard.services.oozie.client': '{0} Oozie Client',
+  'dashboard.services.oozie.clients': '{0} Oozie Clients',
+  'dashboard.services.oozie.webUi': 'Oozie Web UI',
+
+  'dashboard.services.zookeeper.prefix': '{0} of',
+  'dashboard.services.zookeeper.title': '{0} ZooKeepers',
+  'dashboard.services.zookeeper.postfix': 'running',
+
   'dashboard.services.configs.popup.stopService.header':'Stop service',
   'dashboard.services.configs.popup.stopService.body' : 'Service needs to be 
stopped for reconfiguration',
   'dashboard.services.configs.popup.restartService.header' : 'Restart service',

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Sat Jan 19 
01:47:16 2013
@@ -775,7 +775,7 @@ a:focus {
     .clearfix {
       padding-bottom: 8px;
     }
-    #hdfs-info, #mapreduce-info, #hbase-info {
+    .service-body {
       display: none;
       position: relative;
     }

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hbase.hbs
 Sat Jan 19 01:47:16 2013
@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
   </div>
 </div>
-<div id="hbase-info">
+<div class="service-body">
   <div class="span4">
     <table class="table no-borders">
       <tbody>

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hdfs.hbs 
Sat Jan 19 01:47:16 2013
@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
   </div>
 </div>
-<div id="hdfs-info">
+<div class="service-body">
   <div class="span4">
     <table class="table no-borders">
       <tbody>

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hive.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hive.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hive.hbs 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/hive.hbs 
Sat Jan 19 01:47:16 2013
@@ -28,12 +28,10 @@
     {{/if}}
   </div>
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost 
component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
+    {{#each component in view.titleMasters}}
+      <a href="#" {{action showDetails 
component.host}}>{{component.displayName}}</a>,
     {{/each}}
+
+    <a href="#" {{action filterHosts 
view.clients.component}}>{{view.clients.title}}</a>
   </div>
-</div>
+</div>
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
 Sat Jan 19 01:47:16 2013
@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
   </div>
 </div>
-<div id="mapreduce-info">
+<div class="service-body">
   <div class="span4">
     <table class="table no-borders">
       <tbody>

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/oozie.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/oozie.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/oozie.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/oozie.hbs
 Sat Jan 19 01:47:16 2013
@@ -28,12 +28,13 @@
     {{/if}}
   </div>
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost 
component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
+    {{#each component in view.masters}}
+      <a href="#" {{action showDetails 
component.host}}>{{component.displayName}}</a>,
     {{/each}}
+
+    <a href="#" {{action filterHosts 
view.clients.component}}>{{view.clients.title}}</a>,
+
+    <a href="{{unbound view.webUi}}" target="_blank">{{t 
dashboard.services.oozie.webUi}}</a>
+
   </div>
-</div>
+</div>
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
 Sat Jan 19 01:47:16 2013
@@ -28,12 +28,8 @@
     {{/if}}
   </div>
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost 
component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
-    {{/each}}
+    {{view.titleInfo.pre}}
+    <a href="#" {{action filterHosts 
view.titleInfo.component}}>{{view.titleInfo.title}}</a>
+    {{t dashboard.services.zookeeper.postfix}}
   </div>
-</div>
+</div>
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service.js Sat 
Jan 19 01:47:16 2013
@@ -93,6 +93,31 @@ App.MainDashboardServiceView = Em.View.e
   criticalAlertsCount: function () {
     var alerts = App.router.get('clusterController.alerts');
     return alerts.filterProperty('serviceType', 
this.get('service.id')).filterProperty('isOk', false).length;
-  }.property('App.router.clusterController.alerts')
+  }.property('App.router.clusterController.alerts'),
+
+  isCollapsed: false,
+
+  toggleInfoView: function () {
+    this.$('.service-body').toggle('blind', 200);
+    this.set('isCollapsed', !this.isCollapsed);
+  },
+
+  masters: function(){
+    return this.get('service.hostComponents').filterProperty('isMaster', true);
+  }.property('service'),
+
+  clients: function(){
+    var clients = 
this.get('service.hostComponents').filterProperty('isClient', true);
+    var len = clients.length;
+    var template = 
'dashboard.services.{0}.client'.format(this.get('serviceName').toLowerCase());
+    if(len > 1){
+      template += 's';
+    }
+
+    return {
+      title: this.t(template).format(len),
+      component: clients.objectAt(0)
+    };
+  }.property('service')
 
 });
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hbase.js 
Sat Jan 19 01:47:16 2013
@@ -83,12 +83,6 @@ App.MainDashboardServiceHbaseView = App.
 
   regionServerComponent: function () {
     return App.HostComponent.find().findProperty('componentName', 
'HBASE_REGIONSERVER');
-  }.property('components'),
+  }.property()
 
-  isCollapsed: false,
-
-  toggleInfoView: function () {
-    $('#hbase-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  }
 });
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hdfs.js 
Sat Jan 19 01:47:16 2013
@@ -112,13 +112,6 @@ App.MainDashboardServiceHdfsView = App.M
     return App.HostComponent.find().findProperty('componentName', 'DATANODE');
   }.property('+'),
 
-  isCollapsed: false,
-
-  toggleInfoView: function () {
-    $('#hdfs-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  },
-
   isSafeMode: function () {
     var safeMode = this.get('service.safeModeStatus');
     return safeMode != null && safeMode.length > 0;

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hive.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hive.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hive.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/hive.js 
Sat Jan 19 01:47:16 2013
@@ -20,5 +20,10 @@ var App = require('app');
 
 App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/dashboard/service/hive'),
-  serviceName: 'hive'
+  serviceName: 'hive',
+
+  titleMasters: function(){
+    var masters = this.get('masters');
+    return [masters.findProperty('componentName', 'HIVE_SERVER'), 
masters.findProperty('componentName', 'HIVE_METASTORE')];
+  }.property('service')
 });
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/mapreduce.js 
Sat Jan 19 01:47:16 2013
@@ -118,12 +118,5 @@ App.MainDashboardServiceMapreduceView = 
 
   taskTrackerComponent: function () {
     return App.HostComponent.find().findProperty('componentName', 
'TASKTRACKER');
-  }.property('components'),
-
-  isCollapsed: false,
-
-  toggleInfoView: function() {
-    $('#mapreduce-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  }
+  }.property()
 });
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/oozie.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/oozie.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/oozie.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/oozie.js 
Sat Jan 19 01:47:16 2013
@@ -21,5 +21,10 @@ var App = require('app');
 App.MainDashboardServiceOozieView = App.MainDashboardServiceView.extend({
   classNames: ['no-borders'],
   serviceName: 'oozie',
-  templateName: require('templates/main/dashboard/service/oozie')
+  templateName: require('templates/main/dashboard/service/oozie'),
+
+  webUi: function () {
+    var hostName = 
this.get('service.hostComponents').findProperty('componentName', 
'OOZIE_SERVER').get('host.publicHostName');
+    return "http://{0}:11000/oozie".format(hostName);
+  }.property('service')
 });
\ No newline at end of file

Modified: 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js?rev=1435453&r1=1435452&r2=1435453&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/views/main/dashboard/service/zookeeper.js 
Sat Jan 19 01:47:16 2013
@@ -20,5 +20,21 @@ var App = require('app');
 
 App.MainDashboardServiceZookeperView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/dashboard/service/zookeeper'),
-  serviceName: 'zookeeper'
+  serviceName: 'zookeeper',
+
+  titleInfo: function(){
+    var components = 
this.get('service.hostComponents').filterProperty('componentName', 
'ZOOKEEPER_SERVER');
+    var running = 0;
+    components.forEach(function(item){
+      if(item.get('workStatus') === App.HostComponentStatus.started){
+        running += 1;
+      }
+    });
+
+    return {
+      pre: this.t('dashboard.services.zookeeper.prefix').format(running),
+      title: 
this.t('dashboard.services.zookeeper.title').format(components.length),
+      component: components.objectAt(0)
+    };
+  }.property('service')
 });
\ No newline at end of file


Reply via email to