Bläddra i källkod

AMBARI-1099. Hive Service Summary needs to show service components better. (Srimanth Gunturi via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431767 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 år sedan
förälder
incheckning
3881acfc10

+ 3 - 0
CHANGES.txt

@@ -458,6 +458,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-1099. Hive Service Summary needs to show service components better.
+  (Srimanth Gunturi via yusaku)
+
   AMBARI-1097.  Restrict user to proceed ahead of step 7 (Service configuration)
   when properties specified in custom-box are already exposed on the page.
   (Jaimin Jetly via yusaku)

+ 1 - 0
ambari-web/app/messages.js

@@ -44,6 +44,7 @@ Em.I18n.translations = {
   'services.oozie.description':'System for workflow coordination and execution of Apache Hadoop jobs',
   'services.zookeeper.description':'ZooKeeper desc',
   'services.hbase.description':'Non-relational distributed database and centralized service for configuration management & synchronization',
+  'services.hive.databaseComponent':'Database Server',
   
   'services.alerts.OK.timePrefix': 'OK for ',
   'services.alerts.WARN.timePrefix': 'WARN for ',

+ 10 - 20
ambari-web/app/templates/main/service/info/summary.hbs

@@ -90,26 +90,16 @@
         {{template "templates/main/service/info/summary/ganglia"}}
       {{/if}}
       {{#if view.serviceStatus.hive}}
-        <tr>
-          <td class="summary-label">Host</td>
-          <td>
-            {{#each component in controller.content.components}}
-              <a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</a>
-           {{/each}}
-          </td>
-        </tr>
-        <tr>
-          <td>Database</td>
-          <td>{{view.data.hive.database}}</td>
-        </tr>
-        <tr>
-          <td>Database Name</td>
-          <td>{{view.data.hive.databaseName}}</td>
-        </tr>
-        <tr>
-          <td>User</td>
-          <td>{{view.data.hive.user}}</td>
-        </tr>
+		    {{#each component in view.hiveComponentsInfo}}
+		    <tr>
+		      <td>
+		        {{component.label}}
+		      </td>
+		      <td>
+	          <a href="#" {{action selectHost component.host}}>{{component.host.publicHostName}}</a>
+		      </td>
+		    </tr>
+		    {{/each}}
       {{/if}}
       </tbody>
     </table>

+ 29 - 0
ambari-web/app/views/main/service/info/summary.js

@@ -197,6 +197,35 @@ App.MainServiceInfoSummaryView = Em.View.extend({
       return "";
     }
   }.property('controller.content'),
+  /**
+   * Returns hive components information in 
+   * the following format:
+   * {
+   *  label: "Component Name",
+   *  host: Host,
+   *  
+   */
+  hiveComponentsInfo: function(){
+    var componentInfos = [];
+    var service=this.get('controller.content');
+    if(service.get("id") == "HIVE"){
+      var self = this;
+      var components = service.get("components");
+      if(components){
+        components.forEach(function(component){
+          var ci = {
+              label: component.get('displayName'),
+              host: component.get('host')
+          };
+          if(component.get('id')=='MYSQL_SERVER'){
+            ci.label = self.t('services.hive.databaseComponent');
+          }
+          componentInfos.push(ci);
+        });
+      }
+    }
+    return componentInfos;
+  }.property('controller.content'),
   service:function () {
     var svc = this.get('controller.content');
     var svcName = svc.get('serviceName');