Sfoglia il codice sorgente

AMBARI-2558. Provide master component info in Services > Summary sections. (Antonenko Alexander via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1499654 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 anni fa
parent
commit
98fb5ab9a6

+ 10 - 3
ambari-web/app/messages.js

@@ -690,6 +690,12 @@ Em.I18n.translations = {
   'services.service.start':'Start',
   'services.service.start':'Start',
   'services.service.stop':'Stop',
   'services.service.stop':'Stop',
   'services.service.summary.version':'Version',
   'services.service.summary.version':'Version',
+  'services.service.summary.viewHost':'View Host',
+  'services.service.summary.viewHosts':'View Hosts',
+  'services.service.summary.DataNodesLive':'DataNodes Live',
+  'services.service.summary.TrackersLive':'Trackers Live',
+  'services.service.summary.RegionServersLIVE':'RegionServers Live',
+  'services.service.summary.GangliaMonitorsLIVE':'Ganglia Monitors Live',
   'services.service.summary.nameNode':'NameNode Web UI',
   'services.service.summary.nameNode':'NameNode Web UI',
   'services.service.summary.nameNodeUptime':'NameNode Uptime',
   'services.service.summary.nameNodeUptime':'NameNode Uptime',
   'services.service.summary.nameNodeHeap':'NameNode Heap',
   'services.service.summary.nameNodeHeap':'NameNode Heap',
@@ -828,8 +834,7 @@ Em.I18n.translations = {
 
 
   'services.service.info.menu.summary':'Summary',
   'services.service.info.menu.summary':'Summary',
   'services.service.info.menu.configs':'Configs',
   'services.service.info.menu.configs':'Configs',
-  'services.service.info.summary.hostsRunningMonitor':'{0} hosts running monitor',
-  'services.service.info.summary.hostRunningMonitor':'1 host running monitor',
+  'services.service.info.summary.hostsRunningMonitor':'{0}/{1}',
   'services.service.info.summary.serversHostCount':'{0} more',
   'services.service.info.summary.serversHostCount':'{0} more',
   'services.service.info.summary.nagiosWebUI':'Nagios Web UI',
   'services.service.info.summary.nagiosWebUI':'Nagios Web UI',
   'services.service.info.summary.nagios.noAlerts':'No alerts',
   'services.service.info.summary.nagios.noAlerts':'No alerts',
@@ -876,6 +881,8 @@ Em.I18n.translations = {
   'services.zookeeper.prefix': '{0} of',
   'services.zookeeper.prefix': '{0} of',
   'services.zookeeper.title': '{0} ZooKeepers',
   'services.zookeeper.title': '{0} ZooKeepers',
   'services.zookeeper.postfix': 'running',
   'services.zookeeper.postfix': 'running',
+  'services.zookeeper.clients': 'ZooKeeper Clients',
+  'services.zookeeper.client': 'ZooKeeper Client',
 
 
   'services.mapreduce2.history.running': 'History server is running',
   'services.mapreduce2.history.running': 'History server is running',
   'services.mapreduce2.history.stopped': 'History server is stopped',
   'services.mapreduce2.history.stopped': 'History server is stopped',
@@ -1101,7 +1108,7 @@ Em.I18n.translations = {
   'dashboard.services.mapreduce.nodes.blacklist':'blacklist',
   'dashboard.services.mapreduce.nodes.blacklist':'blacklist',
   'dashboard.services.mapreduce.nodes.graylist':'graylist',
   'dashboard.services.mapreduce.nodes.graylist':'graylist',
   'dashboard.services.mapreduce.slotCapacity':'Total Slots Capacity',
   'dashboard.services.mapreduce.slotCapacity':'Total Slots Capacity',
-  'dashboard.services.mapreduce.trackersSummary':'{0} live / {1} total',
+  'dashboard.services.mapreduce.trackersSummary':'{0}/{1}',
   'dashboard.services.mapreduce.jobs':'Total Jobs',
   'dashboard.services.mapreduce.jobs':'Total Jobs',
   'dashboard.services.mapreduce.jobsSummary':'{0} submitted / {1} completed',
   'dashboard.services.mapreduce.jobsSummary':'{0} submitted / {1} completed',
   'dashboard.services.mapreduce.mapSlots':'Map Slots',
   'dashboard.services.mapreduce.mapSlots':'Map Slots',

+ 34 - 0
ambari-web/app/styles/application.less

@@ -1493,6 +1493,40 @@ width:100%;
   }
   }
 }
 }
 
 
+.services, #summary-info {
+  .tab-marker-position {
+    background-position:  0px 3px;
+    background-repeat: no-repeat;
+    list-style: none;
+    float: left;
+    height: 20px;
+    width: 20px;
+    margin-left: 0;
+  }
+
+  .green-live{
+    color: #008000;
+  }
+
+  .STARTING, .STARTED {
+    .tab-marker-position;
+    background-image: @status-live-marker;
+  }
+  .STOPPING, .INSTALLED {
+    .tab-marker-position;
+    background-image: @status-dead-red-marker;
+  }
+  .UNKNOWN {
+    .tab-marker-position;
+    background-image: @status-dead-yellow-marker;
+  }
+
+  .summary-view-host{
+    float: right;
+    padding-right: 20px;
+  }
+}
+
 #summary-info {
 #summary-info {
   border-top: none;
   border-top: none;
   border-collapse: collapse;
   border-collapse: collapse;

+ 9 - 25
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -42,34 +42,18 @@
       <tbody>
       <tbody>
     {{/unless}}
     {{/unless}}
       <!-- HBase Master Server -->
       <!-- HBase Master Server -->
-      <tr>
-        <td>{{t dashboard.services.hbase.masterServer}}</td>
-        <td>
-            {{#if view.activeMaster}}
-              <a href="#" {{action showDetails view.activeMaster.host}}>{{view.activeMasterTitle}}</a>
-              {{#if view.passiveMasters.length}}
-                  {{view.passiveMasterOutput}}
-              {{/if}}
-            {{else}}
-              {{t dashboard.services.hbase.noMasterServer}}
-            {{/if}}
-        </td>
-      </tr>
+
+      {{view view.dashboardMasterComponentView}}
+
       <!-- RegionServers -->
       <!-- RegionServers -->
       <tr>
       <tr>
         <td>{{t dashboard.services.hbase.regionServers}}</td>
         <td>{{t dashboard.services.hbase.regionServers}}</td>
-        <td><a href="#" {{action filterHosts view.regionServerComponent}}>{{view.service.regionServers.length}} {{t dashboard.services.hbase.regionServers}}</a></td>
-      </tr>
-      <!-- HBaseMaster Web UI -->
-      <tr>
-        <td>{{t dashboard.services.hbase.masterWebUI}}</td>
-        <td>
-            {{#if view.activeMaster}}
-              <a {{bindAttr href="view.hbaseMasterWebUrl"}} target="_blank">{{view.activeMaster.host.publicHostName}}:60010</a>
-            {{else}}
-              {{t services.service.summary.notAvailable}}
-            {{/if}}
-        </td>
+         <td>
+            <span class="green-live">{{view.liveRegionServes.length}}/{{view.service.regionServers.length}} </span> {{t services.service.summary.RegionServersLIVE}}
+            <div class="summary-view-host">
+              <a href="#" {{action filterHosts view.regionServerComponent}}>{{view.regionServesText}}</a>
+            </div>
+         </td>
       </tr>
       </tr>
       <!-- Regions in Transition -->
       <!-- Regions in Transition -->
       <tr>
       <tr>

+ 6 - 17
ambari-web/app/templates/main/dashboard/service/hdfs.hbs

@@ -42,27 +42,16 @@
       <tbody>
       <tbody>
     {{/unless}}
     {{/unless}}
 
 
-      <!-- NameNode -->
-      <tr>
-        <td>{{t dashboard.services.hdfs.nanmenode}}</td>
-        <td><a href="#" {{action showDetails view.service.nameNode}}>{{view.service.nameNode.publicHostName}}</a></td>
-      </tr>
-      <!-- SecondaryNameNode -->
-      <tr>
-        <td>{{t dashboard.services.hdfs.snanmenode}}</td>
-        <td><a href="#" {{action showDetails view.service.snameNode}}>{{view.service.snameNode.publicHostName}}</a></td>
-      </tr>
+      {{view view.dashboardMasterComponentView}}
+
       <!-- Data Nodes -->
       <!-- Data Nodes -->
       <tr>
       <tr>
         <td>{{t dashboard.services.hdfs.datanodes}}</td>
         <td>{{t dashboard.services.hdfs.datanodes}}</td>
         <td>
         <td>
-          <a href="#" {{action filterHosts view.dataNodeComponent}}>{{view.service.dataNodes.length}} {{t dashboard.services.hdfs.datanodes}}</a>
-        </td>
-      </tr>
-      <!-- NameNode Web UI -->
-      <tr>
-        <td>{{t dashboard.services.hdfs.nameNodeWebUI}}</td>
-        <td><a {{bindAttr href="view.nodeWebUrl"}} target="_blank">{{view.service.nameNode.publicHostName}}:50070</a>
+          <span class="green-live">{{view.service.liveDataNodes.length}}/{{view.service.dataNodes.length}}</span> {{t services.service.summary.DataNodesLive}}
+          <div class="summary-view-host">
+            <a href="#" {{action filterHosts view.dataNodeComponent}}>{{view.dataNodeHostText}}</a>
+          </div>
         </td>
         </td>
       </tr>
       </tr>
       <!-- NameNode Uptime -->
       <!-- NameNode Uptime -->

+ 9 - 16
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -41,20 +41,18 @@
     <table class="table no-borders">
     <table class="table no-borders">
       <tbody>
       <tbody>
     {{/unless}}
     {{/unless}}
-      <!-- JobTracker -->
-      <tr>
-        <td>{{t services.service.summary.jobTracker}}</td>
-        <td><a href="#" {{action showDetails view.service.jobTracker}}>{{view.service.jobTracker.publicHostName}}</a></td>
-      </tr>
+
+     {{view view.dashboardMasterComponentView}}
+
       <!-- TaskTrackers -->
       <!-- TaskTrackers -->
       <tr>
       <tr>
         <td>{{t dashboard.services.mapreduce.taskTrackers}}</td>
         <td>{{t dashboard.services.mapreduce.taskTrackers}}</td>
-        <td><a href="#" {{action filterHosts view.taskTrackerComponent}}>{{view.service.taskTrackers.length}} {{t dashboard.services.mapreduce.taskTrackers}}</a></td>
-      </tr>
-      <!-- JobTracker Web UI -->
-      <tr>
-        <td>{{t services.service.summary.jobTrackerWebUI}}</td>
-        <td><a {{bindAttr href="view.jobTrackerWebUrl"}} target="_blank">{{view.service.jobTracker.publicHostName}}:50030</a>
+        <td>
+
+          <span class="green-live">{{view.trackersSummary}}</span> {{t services.service.summary.TrackersLive}}
+          <div class="summary-view-host">
+            <a href="#" {{action filterHosts view.taskTrackerComponent}}>{{view.trackersText}}</a>
+          </div>
         </td>
         </td>
       </tr>
       </tr>
       <!-- Job Tracker Uptime -->
       <!-- Job Tracker Uptime -->
@@ -62,11 +60,6 @@
         <td>{{t dashboard.services.mapreduce.jobTrackerUptime}}</td>
         <td>{{t dashboard.services.mapreduce.jobTrackerUptime}}</td>
         <td>{{view.jobTrackerUptime}}</td>
         <td>{{view.jobTrackerUptime}}</td>
       </tr>
       </tr>
-      <!-- Trackers -->
-      <tr>
-        <td>{{t dashboard.services.mapreduce.trackers}}</td>
-        <td>{{view.trackersSummary}}</td>
-      </tr>
       <!-- TaskTracker Counts -->
       <!-- TaskTracker Counts -->
       <tr>
       <tr>
         <td>{{t dashboard.services.mapreduce.taskTrackerCounts}}</td>
         <td>{{t dashboard.services.mapreduce.taskTrackerCounts}}</td>

+ 48 - 67
ambari-web/app/templates/main/service/info/summary.hbs

@@ -40,73 +40,54 @@
   <div class="service-content">
   <div class="service-content">
     <table id="summary-info" class="table no-borders table-condensed">
     <table id="summary-info" class="table no-borders table-condensed">
       <tbody>
       <tbody>
-      {{#unless view.serviceStatus.oozie}}
-        {{#unless view.serviceStatus.hive}}
-          {{#unless view.serviceStatus.zookeeper}}
-            {{#unless view.serviceStatus.hdfs}}
-              {{#unless view.serviceStatus.mapreduce}}
-                {{#unless view.serviceStatus.hbase}}
-                  {{#unless view.serviceStatus.ganglia}}
-                    {{#unless view.serviceStatus.hue}}
-                      {{#unless view.serviceStatus.mapreduce2}}
-                        {{#unless view.serviceStatus.flume}}
-		                      {{#each component in view.components}}
-		                        <tr>
-		                          {{#if component.isMaster}}
-		                            <td class="summary-label">{{component.displayName}}</td>
-		                            <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</a></td>
-		                          {{else}}
-		                            <td class="summary-label">{{component.displayName}}s</td>
-		                            <td><a {{action filterHosts component}} href="javascript:void(null)">{{component.displayName}}s</a></td>
-		                          {{/if}}
-		                        </tr>
-		                      {{/each}}
-		                      {{#if view.serviceStatus.nagios}}
-		                        <tr>
-		                          <td class="summary-label">{{t services.service.info.summary.nagiosWebUI}}</td>
-		                          <td><a target=_blank href="http://{{unbound view.nagiosServer}}/nagios">{{view.nagiosServer}}/nagios</a></td>
-		                        </tr>
-		                      {{/if}}
-		                    {{/unless}}
-                      {{/unless}}
-                    {{/unless}}
-                  {{/unless}}
-                {{/unless}}
-              {{/unless}}
-            {{/unless}}
-          {{/unless}}
-        {{/unless}}
-      {{/unless}}
-      {{#if view.serviceStatus.hdfs}}
-        {{view App.MainDashboardServiceHdfsView showOnlyRows=true serviceBinding="view.service"}}
-      {{/if}}
-      {{#if view.serviceStatus.mapreduce}}
-        {{view App.MainDashboardServiceMapreduceView showOnlyRows=true serviceBinding="view.service"}}
-      {{/if}}
-      {{#if view.serviceStatus.mapreduce2}}
-        {{template "templates/main/service/info/summary/mapreduce2"}}
-      {{/if}}
-      {{#if view.serviceStatus.hbase}}
-        {{view App.MainDashboardServiceHbaseView showOnlyRows=true serviceBinding="view.service"}}
-      {{/if}}
-      {{#if view.serviceStatus.zookeeper}}
-        {{template "templates/main/service/info/summary/zookeeper"}}
-      {{/if}}
-      {{#if view.serviceStatus.oozie}}
-        {{template "templates/main/service/info/summary/oozie"}}
-      {{/if}}
-      {{#if view.serviceStatus.ganglia}}
-        {{template "templates/main/service/info/summary/ganglia"}}
-      {{/if}}
-      {{#if view.serviceStatus.hive}}
-        {{template "templates/main/service/info/summary/hive"}}
-      {{/if}}
-      {{#if view.serviceStatus.hue}}
-        {{template "templates/main/service/info/summary/hue"}}
-      {{/if}}
-      {{#if view.serviceStatus.flume}}
-        {{view App.MainDashboardServiceFlumeView showOnlyRows=true serviceBinding="view.service"}}
-      {{/if}}
+        {{#if view.noTemplateService}}
+          {{#each component in view.components}}
+            {{#if component.isMaster}}
+             {{view view.sumMasterComponentView}}
+            {{else}}
+              <tr>
+                <td class="summary-label">{{component.displayName}}{{#if view.hasManyClients}}s{{/if}}</td>
+                <td>
+                  <span class="green-live">{{view.clients.length}}</span>
+                  {{component.displayName}} {{#if view.hasManyClients}}s{{/if}} {{t common.installed}}
+                  <div class="summary-view-host">
+                    <a {{action filterHosts component}} href="javascript:void(null)>{{view.clientsHostText}}</a>
+                  </div>
+                </td>
+              </tr>
+            {{/if}}
+          {{/each}}
+        {{/if}}
+        {{#if view.serviceStatus.hdfs}}
+          {{view App.MainDashboardServiceHdfsView showOnlyRows=true serviceBinding="view.service"}}
+        {{/if}}
+        {{#if view.serviceStatus.mapreduce}}
+          {{view App.MainDashboardServiceMapreduceView showOnlyRows=true serviceBinding="view.service"}}
+        {{/if}}
+        {{#if view.serviceStatus.mapreduce2}}
+          {{template "templates/main/service/info/summary/mapreduce2"}}
+        {{/if}}
+        {{#if view.serviceStatus.hbase}}
+          {{view App.MainDashboardServiceHbaseView showOnlyRows=true serviceBinding="view.service"}}
+        {{/if}}
+        {{#if view.serviceStatus.zookeeper}}
+          {{template "templates/main/service/info/summary/zookeeper"}}
+        {{/if}}
+        {{#if view.serviceStatus.oozie}}
+          {{template "templates/main/service/info/summary/oozie"}}
+        {{/if}}
+        {{#if view.serviceStatus.ganglia}}
+          {{template "templates/main/service/info/summary/ganglia"}}
+        {{/if}}
+        {{#if view.serviceStatus.hive}}
+          {{template "templates/main/service/info/summary/hive"}}
+        {{/if}}
+        {{#if view.serviceStatus.hue}}
+          {{template "templates/main/service/info/summary/hue"}}
+        {{/if}}
+        {{#if view.serviceStatus.flume}}
+          {{view App.MainDashboardServiceFlumeView showOnlyRows=true serviceBinding="view.service"}}
+        {{/if}}
       </tbody>
       </tbody>
     </table>
     </table>
     {{!view view.moreStatsView}}
     {{!view view.moreStatsView}}

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

@@ -16,19 +16,16 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
-{{#each component in view.components}}
-  {{#if component.isMaster}}
-    <tr>
-      <td class="summary-label">{{component.displayName}}</td>
-      <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</a></td>
-    </tr>
-  {{/if}}
-{{/each}}
+
+
+{{view view.sumMasterComponentView}}
+
 <tr>
 <tr>
   <td class="summary-label">{{t services.ganglia.monitors}}</td>
   <td class="summary-label">{{t services.ganglia.monitors}}</td>
-  <td><a {{action filterHosts view.monitorsObj}} href="javascript:void(null)">{{view.monitors}}</a></td>
-</tr>
-<tr>
-  <td class="summary-label">{{t services.ganglia.webUi}}</td>
-  <td><a target=_blank href="http://{{unbound view.gangliaServer}}/ganglia">{{view.gangliaServer}}/ganglia</a></td>
+  <td>
+    <span class="green-live">{{view.monitors}} </span>{{t services.service.summary.GangliaMonitorsLIVE}}
+    <div class="summary-view-host">
+       <a {{action filterHosts view.monitorsObj}} href="javascript:void(null)" >{{view.hasManyMonitors}}</a>
+    </div>
+  </td>
 </tr>
 </tr>

+ 5 - 13
ambari-web/app/templates/main/service/info/summary/hive.hbs

@@ -16,22 +16,14 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
-{{#each component in view.components}}
-  {{#if component.isMaster}}
-    <tr>
-      <td>
-        {{view view.componentNameView compBinding="component"}}
-      </td>
-      <td>
-        <a href="#" {{action selectHost component.host}}>{{component.host.publicHostName}}</a>
-      </td>
-    </tr>
-  {{/if}}
-{{/each}}
+{{view view.sumMasterComponentView}}
 
 
 <tr>
 <tr>
   <td class="summary-label">{{t services.hive.clients}}</td>
   <td class="summary-label">{{t services.hive.clients}}</td>
   <td>
   <td>
-    <a {{action filterHosts view.clientObj}} href="javascript:void(null)">{{view.clients.length}} {{t services.hive.client}}{{#if view.hasManyClients}}s{{/if}}</a>
+    <span class="green-live">{{view.clients.length}} </span>{{t services.hive.client}}{{#if view.hasManyClients}}s{{/if}} {{t common.installed}}
+    <div class="summary-view-host">
+      <a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{view.clientsHostText}}</a>
+    </div>
   </td>
   </td>
 </tr>
 </tr>

+ 3 - 12
ambari-web/app/templates/main/service/info/summary/hue.hbs

@@ -15,15 +15,6 @@
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * limitations under the License.
 }}
 }}
-{{#each component in view.components}}
-  {{#if component.isMaster}}
-      <tr>
-          <td class="summary-label">{{component.displayName}}</td>
-          <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</a></td>
-      </tr>
-  {{/if}}
-{{/each}}
-<tr>
-    <td class="summary-label">{{t services.hue.webUi}}</td>
-    <td><a target=_blank href="http://{{unbound view.hueServer}}/hue">{{view.hueServer}}/hue</a></td>
-</tr>
+
+
+{{view view.sumMasterComponentView}}

+ 30 - 0
ambari-web/app/templates/main/service/info/summary/master_components.hbs

@@ -0,0 +1,30 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+{{#each masterComp in view.mastersComp}}
+  <tr>
+   <td>{{masterComp.displayName}}</td>
+   <td>
+     <span {{bindAttr class="masterComp.workStatus"}}></span>
+     {{masterComp.componentTextStatus}}
+     <div class="summary-view-host">
+       <a href="#" {{action showDetails masterComp.host}}>{{t services.service.summary.viewHost}}</a>
+     </div>
+   </td>
+  </tr>
+{{/each}}

+ 8 - 13
ambari-web/app/templates/main/service/info/summary/oozie.hbs

@@ -16,21 +16,16 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
-{{#each component in view.components}}
-  {{#if component.isMaster}}
-    <tr>
-      <td class="summary-label">{{t common.servers}}</td>
-      <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</a></td>
-    </tr>
-  {{/if}}
-{{/each}}
+
+{{view view.sumMasterComponentView}}
+
 <tr>
 <tr>
   <td class="summary-label">{{t services.oozie.clients}}</td>
   <td class="summary-label">{{t services.oozie.clients}}</td>
   <td>
   <td>
-    <a {{action filterHosts view.clientObj}} href="javascript:void(null)">{{view.clients.length}} {{t services.oozie.client}}{{#if view.hasManyClients}}s{{/if}}</a>
+    <span class="green-live">{{view.clients.length}} </span>{{t services.oozie.client}}{{#if view.hasManyClients}}s{{/if}} {{t common.installed}}
+    <div class="summary-view-host">
+       <a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{view.clientsHostText}}</a>
+    </div>
   </td>
   </td>
 </tr>
 </tr>
-<tr>
-  <td class="summary-label">{{t services.oozie.webUi}}</td>
-  <td><a target=_blank href="http://{{unbound view.oozieServer}}:11000/oozie">{{view.oozieServer}}/oozie</a></td>
-</tr>
+

+ 7 - 9
ambari-web/app/templates/main/service/info/summary/zookeeper.hbs

@@ -16,16 +16,14 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
-<tr>
-  <td class="summary-label">{{t common.servers}}</td>
-  <td>
-      <a {{action filterHosts view.serversHost}} href="javascript:void(null)">{{view.servers.length}} ZooKeeper Server{{#if view.hasManyServers}}s{{/if}}</a>
-  </td>
-</tr>
 
 
-<tr>
-  <td class="summary-label">{{t common.clients}}</td>
+
+{{view view.sumMasterComponentView}}
+<td class="summary-label">{{t services.zookeeper.client}}</td>
   <td>
   <td>
-      <a {{action filterHosts view.clientObj}} href="javascript:void(null)">{{view.clients.length}} ZooKeeper Client{{#if view.hasManyClients}}s{{/if}}</a>
+    <span class="green-live">{{view.clients.length}} </span>{{t services.zookeeper.client}}{{#if view.hasManyClients}}s{{/if}} {{t common.installed}}
+    <div class="summary-view-host">
+       <a {{action filterHosts view.clientObj}} href="javascript:void(null)" >{{view.clientsHostText}}</a>
+    </div>
   </td>
   </td>
 </tr>
 </tr>

+ 18 - 1
ambari-web/app/views/main/dashboard/service.js

@@ -26,7 +26,16 @@ App.MainDashboardServiceHealthView = Em.View.extend({
   //template: Em.Handlebars.compile(""),
   //template: Em.Handlebars.compile(""),
   blink: false,
   blink: false,
   tagName: 'span',
   tagName: 'span',
-  
+  attributeBindings:['rel', 'title','data-original-title'],
+  rel: 'HealthTooltip',
+  'data-original-title': function(){
+    var popupText = "";
+    this.get("service").get("hostComponents").filterProperty('isMaster', true).forEach(function(item){
+      popupText +=" " + item.get("componentName") + " " + item.get("componentTextStatus");
+    });
+    return popupText;
+  }.property('service.healthStatus'),
+
   /**
   /**
    * When set to true, extending classes should
    * When set to true, extending classes should
    * show only tabular rows as they will be 
    * show only tabular rows as they will be 
@@ -79,6 +88,7 @@ App.MainDashboardServiceHealthView = Em.View.extend({
   }.property('service.healthStatus'),
   }.property('service.healthStatus'),
 
 
   didInsertElement: function () {
   didInsertElement: function () {
+    $("[rel='HealthTooltip']").tooltip();
     this.doBlink(); // check for blink availability
     this.doBlink(); // check for blink availability
   }
   }
 });
 });
@@ -90,6 +100,13 @@ App.MainDashboardServiceView = Em.View.extend({
     return this.get('controller.data.' + this.get('serviceName'));
     return this.get('controller.data.' + this.get('serviceName'));
   }.property('controller.data'),
   }.property('controller.data'),
 
 
+  dashboardMasterComponentView : Em.View.extend({
+    templateName: require('templates/main/service/info/summary/master_components'),
+    mastersComp : function(){
+     return this.get('parentView.service.hostComponents').filterProperty('isMaster', true);
+    }.property("service")
+  }),
+
   formatUnavailable: function(value){
   formatUnavailable: function(value){
     return (value || value == 0) ? value : this.t('services.service.summary.notAvailable');
     return (value || value == 0) ? value : this.t('services.service.summary.notAvailable');
   },
   },

+ 14 - 0
ambari-web/app/views/main/dashboard/service/hbase.js

@@ -36,6 +36,20 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
     }
     }
     return [];
     return [];
   }.property('masters'),
   }.property('masters'),
+
+
+  liveRegionServes: function () {
+    return this.get('service.regionServers').filterProperty("healthClass","health-status-LIVE");
+  }.property("service"),
+
+  regionServesText: function () {
+    if(this.get('service.regionServers').get("length") > 1){
+      return Em.I18n.t('services.service.summary.viewHosts');
+    }else{
+      return Em.I18n.t('services.service.summary.viewHost');
+    }
+  }.property("service"),
+
   /**
   /**
    * Formatted output for passive master components
    * Formatted output for passive master components
    */
    */

+ 12 - 0
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -36,6 +36,18 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
     }.property('service.capacityUsed', 'service.capacityTotal')
     }.property('service.capacityUsed', 'service.capacityTotal')
   }),
   }),
 
 
+  dataNodesLive: function(){
+    return this.get("service").get("dataNodes").filterProperty("healthClass", "health-status-LIVE").length;
+  }.property('service'),
+
+  dataNodeHostText: function () {
+    if(this.get("dataNodesLive") > 1){
+      return Em.I18n.t('services.service.summary.viewHosts');
+    }else{
+      return Em.I18n.t('services.service.summary.viewHost');
+    }
+  }.property("dataNodesLive"),
+
   dfsTotalBlocks: function(){
   dfsTotalBlocks: function(){
     return this.formatUnavailable(this.get('service.dfsTotalBlocks'));
     return this.formatUnavailable(this.get('service.dfsTotalBlocks'));
   }.property('service.dfsTotalBlocks'),
   }.property('service.dfsTotalBlocks'),

+ 8 - 0
ambari-web/app/views/main/dashboard/service/mapreduce.js

@@ -55,6 +55,14 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
     return template.format(liveCount, allCount, runningCount, waitingCount);
     return template.format(liveCount, allCount, runningCount, waitingCount);
   }.property('service.aliveTrackers', 'service.taskTrackers','service.mapsRunning', 'service.mapsWaiting', 'service.reducesRunning', 'service.reducesWaiting'),
   }.property('service.aliveTrackers', 'service.taskTrackers','service.mapsRunning', 'service.mapsWaiting', 'service.reducesRunning', 'service.reducesWaiting'),
 
 
+  trackersText: function () {
+    if(this.get('service').get('taskTrackers').get('length') > 1){
+      return Em.I18n.t('services.service.summary.viewHosts');
+    }else{
+      return Em.I18n.t('services.service.summary.viewHost');
+    }
+  }.property("service.taskTrackers.length"),
+
   trackersSummary: function () {
   trackersSummary: function () {
     var svc = this.get('service');
     var svc = this.get('service');
     var liveCount = svc.get('aliveTrackers').get('length');
     var liveCount = svc.get('aliveTrackers').get('length');

+ 44 - 6
ambari-web/app/views/main/service/info/summary.js

@@ -48,6 +48,22 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     flume: false
     flume: false
   },
   },
 
 
+  sumMasterComponentView : Em.View.extend({
+    templateName: require('templates/main/service/info/summary/master_components'),
+    mastersComp : function(){
+      return this.get('parentView.service.hostComponents').filterProperty('isMaster', true);
+    }.property("service")
+  }),
+
+  noTemplateService: function () {
+    var serviceName = this.get("service.serviceName");
+    if(serviceName == "WEBHCAT" || serviceName == "NAGIOS"){
+      return true;
+    }else{
+      return false;
+    }
+  }.property('controller.content'),
+
   clients: function () {
   clients: function () {
     var service = this.get('controller.content');
     var service = this.get('controller.content');
     if (["OOZIE", "ZOOKEEPER", "HIVE", "MAPREDUCE2"].contains(service.get("id"))) {
     if (["OOZIE", "ZOOKEEPER", "HIVE", "MAPREDUCE2"].contains(service.get("id"))) {
@@ -63,6 +79,14 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     return false;
     return false;
   }.property('servers'),
   }.property('servers'),
 
 
+  clientsHostText: function () {
+    if(this.get("hasManyClients")){
+      return Em.I18n.t('services.service.summary.viewHosts');
+    }else{
+      return Em.I18n.t('services.service.summary.viewHost');
+    }
+  }.property("hasManyClients"),
+
   hasManyClients: function () {
   hasManyClients: function () {
     if (this.get('clients').length > 1) {
     if (this.get('clients').length > 1) {
       return true;
       return true;
@@ -107,8 +131,22 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     var service = this.get('controller.content');
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {
     if (service.get("id") == "GANGLIA") {
       var monitors = service.get('hostComponents').filterProperty('isMaster', false);
       var monitors = service.get('hostComponents').filterProperty('isMaster', false);
+      var liveMonitors = monitors.filterProperty("workStatus","STARTED").length;
       if (monitors.length) {
       if (monitors.length) {
-        result = monitors.length - 1 ? Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(monitors.length) : Em.I18n.t('services.service.info.summary.hostRunningMonitor');
+        result = Em.I18n.t('services.service.info.summary.hostsRunningMonitor').format(monitors.length, liveMonitors);
+      }
+    }
+    return result;
+  }.property('controller.content'),
+
+  hasManyMonitors: function () {
+    var service = this.get('controller.content');
+    if (service.get("id") == "GANGLIA") {
+      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
+      if (monitors.length > 1){
+        return Em.I18n.t('services.service.summary.viewHosts');
+      }else{
+        return Em.I18n.t('services.service.summary.viewHost');
       }
       }
     }
     }
     return result;
     return result;
@@ -393,12 +431,12 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     if (summaryTable && alertsList) {
     if (summaryTable && alertsList) {
       var rows = $(summaryTable).find('tr');
       var rows = $(summaryTable).find('tr');
       if (rows != null && rows.length > 0) {
       if (rows != null && rows.length > 0) {
-        var minimumHeight = 50;
+        var minimumHeightSum = 20;
+        var minimumHeightAlert = 50;
         var calculatedHeight = summaryTable.clientHeight;
         var calculatedHeight = summaryTable.clientHeight;
-        if (calculatedHeight < minimumHeight) {
-          $(alertsList).attr('style', "height:" + minimumHeight + "px;");
-          $(summaryTable).append('<tr><td></td></tr>');
-          $(summaryTable).attr('style', "height:" + minimumHeight + "px;");
+        if (calculatedHeight < minimumHeightAlert) {
+          $(alertsList).attr('style', "height:" + minimumHeightAlert + "px;");
+          $(summaryTable).attr('style', "height:" + minimumHeightSum + "px;");
         } else {
         } else {
           $(alertsList).attr('style', "height:" + calculatedHeight + "px;");
           $(alertsList).attr('style', "height:" + calculatedHeight + "px;");
         }
         }