Author: yusaku
Date: Mon Jun  3 19:14:56 2013
New Revision: 1489112

URL: http://svn.apache.org/r1489112
Log:
AMBARI-2253. YARN/MR2 quick links should be populated. (Andrii Tkach via yusaku)

Modified:
    
incubator/ambari/branches/branch-1.4.0/ambari-web/app/mappers/service_mapper.js
    incubator/ambari/branches/branch-1.4.0/ambari-web/app/models/quick_links.js
    
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/mapreduce2.hbs
    
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/yarn.hbs
    
incubator/ambari/branches/branch-1.4.0/ambari-web/app/views/common/quick_view_link_view.js

Modified: 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/mappers/service_mapper.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/mappers/service_mapper.js?rev=1489112&r1=1489111&r2=1489112&view=diff
==============================================================================
--- 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/mappers/service_mapper.js 
(original)
+++ 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/mappers/service_mapper.js 
Mon Jun  3 19:14:56 2013
@@ -330,7 +330,7 @@ App.servicesMapper = App.QuickDataMapper
     });
     // Map
     var finalJson = this.parseIt(item, finalConfig);
-    finalJson.quick_links = [1, 2, 3, 4];
+    finalJson.quick_links = [19, 20, 21, 22];
 
     return finalJson;
   },
@@ -357,7 +357,7 @@ App.servicesMapper = App.QuickDataMapper
     });
     // Map
     var finalJson = this.parseIt(item, finalConfig);
-    finalJson.quick_links = [1, 2, 3, 4];
+    finalJson.quick_links = [23, 24, 25, 26];
 
     return finalJson;
   },

Modified: 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/models/quick_links.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/models/quick_links.js?rev=1489112&r1=1489111&r2=1489112&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/models/quick_links.js 
(original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/models/quick_links.js 
Mon Jun  3 19:14:56 2013
@@ -132,5 +132,53 @@ App.QuickLinks.FIXTURES = [
     label:'Thread Stacks',
     url:'http://%@:60010/stacks',
     service_id: 'HBASE'
+  },
+  {
+    id:19,
+    label:'ResourceManager UI',
+    url:'http://%@:8088',
+    service_id: 'YARN'
+  },
+  {
+    id:20,
+    label:'ResourceManager logs',
+    url:'http://%@:8088/logs',
+    service_id: 'YARN'
+  },
+  {
+    id:21,
+    label:'ResourceManager JMX',
+    url:'http://%@:8088/jmx',
+    service_id: 'YARN'
+  },
+  {
+    id:22,
+    label:'Thread Stacks',
+    url:'http://%@:8088/stacks',
+    service_id: 'YARN'
+  },
+  {
+    id:23,
+    label:'JobHistory UI',
+    url:'http://%@:19888',
+    service_id: 'MAPREDUCE2'
+  },
+  {
+    id:24,
+    label:'JobHistory logs',
+    url:'http://%@:19888/logs',
+    service_id: 'MAPREDUCE2'
+  },
+  {
+    id:25,
+    label:'JobHistory JMX',
+    url:'http://%@:19888/jmx',
+    service_id: 'MAPREDUCE2'
+  },
+  {
+    id:26,
+    label:'Thread Stacks',
+    url:'http://%@:19888/stacks',
+    service_id: 'MAPREDUCE2'
   }
 ];

Modified: 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/mapreduce2.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/mapreduce2.hbs?rev=1489112&r1=1489111&r2=1489112&view=diff
==============================================================================
--- 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/mapreduce2.hbs
 (original)
+++ 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/mapreduce2.hbs
 Mon Jun  3 19:14:56 2013
@@ -16,9 +16,15 @@
 * limitations under the License.
 }}
 
-<div class="clearfix">
+
+{{#unless view.showOnlyRows}}
+<div class="clearfix like_pointer" {{action toggleInfoView target="view"}}>
   <div class="name span2">
-    <i class="pull-left icon-empty"></i>
+   {{#if view.isCollapsed}}
+    <i class="icon-caret-down pull-left"></i>
+   {{else}}
+    <i class="icon-caret-right pull-left"></i>
+   {{/if}}
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
     <a {{action selectService view.service 
href=true}}>{{view.service.displayName}}</a>
     {{#if view.criticalAlertsCount}}
@@ -30,4 +36,26 @@
   <div class="summary span">
     {{view.titleInfo}}
   </div>
-</div>
\ No newline at end of file
+</div>
+<div class="service-body">
+    <div class="span4">
+      <div class="dashboard-mini-chart span2">
+        {{#if view.service.quickLinks.length}}
+        {{#view App.QuickViewLinks contentBinding="view.service"}}
+          <div class="btn-group">
+            <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" 
href="#">
+              {{t common.quickLinks}}
+              <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu">
+              {{#each view.quickLinks}}
+                <li><a {{bindAttr href="url"}} 
target="_blank">{{label}}</a></li>
+              {{/each}}
+            </ul>
+          </div>
+        {{/view}}
+        {{/if}}
+      </div>
+  </div>
+</div>
+{{/unless}}
\ No newline at end of file

Modified: 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/yarn.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/yarn.hbs?rev=1489112&r1=1489111&r2=1489112&view=diff
==============================================================================
--- 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/yarn.hbs
 (original)
+++ 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/templates/main/dashboard/service/yarn.hbs
 Mon Jun  3 19:14:56 2013
@@ -100,6 +100,23 @@
     {{#unless view.showOnlyRows}}
       </tbody>
     </table>
-  </div>
+    <div class="dashboard-mini-chart span2">
+      {{#if view.service.quickLinks.length}}
+      {{#view App.QuickViewLinks contentBinding="view.service"}}
+        <div class="btn-group">
+          <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" 
href="#">
+            {{t common.quickLinks}}
+            <span class="caret"></span>
+          </a>
+          <ul class="dropdown-menu">
+            {{#each view.quickLinks}}
+              <li><a {{bindAttr href="url"}} target="_blank">{{label}}</a></li>
+            {{/each}}
+          </ul>
+        </div>
+      {{/view}}
+      {{/if}}
+    </div>
+</div>
 </div>
 {{/unless}}
\ No newline at end of file

Modified: 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/views/common/quick_view_link_view.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/views/common/quick_view_link_view.js?rev=1489112&r1=1489111&r2=1489112&view=diff
==============================================================================
--- 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/views/common/quick_view_link_view.js
 (original)
+++ 
incubator/ambari/branches/branch-1.4.0/ambari-web/app/views/common/quick_view_link_view.js
 Mon Jun  3 19:14:56 2013
@@ -30,6 +30,10 @@ App.QuickViewLinks = Em.View.extend({
 
     if (serviceName === 'HDFS') {
       host = App.singleNodeInstall ? App.singleNodeAlias : 
components.findProperty('componentName', 'NAMENODE').get('host.publicHostName');
+    } else if (serviceName === 'YARN') {
+      host = App.singleNodeInstall ? App.singleNodeAlias : 
components.findProperty('componentName', 
'RESOURCEMANAGER').get('host.publicHostName');
+    } else if (serviceName === 'MAPREDUCE2') {
+      host = App.singleNodeInstall ? App.singleNodeAlias : 
components.findProperty('componentName', 
'HISTORYSERVER').get('host.publicHostName');
     } else if (serviceName === 'MAPREDUCE') {
       host = App.singleNodeInstall ? App.singleNodeAlias : 
components.findProperty('componentName', 
'JOBTRACKER').get('host.publicHostName');
     } else if (serviceName === 'HBASE') {
@@ -40,7 +44,6 @@ App.QuickViewLinks = Em.View.extend({
         }else{
           host = component.get('host.publicHostName');
         }
-
       }
     }
     if (!host) {
@@ -62,6 +65,8 @@ App.QuickViewLinks = Em.View.extend({
   linkTarget: function () {
     switch (this.get('content.serviceName').toLowerCase()) {
       case "hdfs":
+      case "yarn":
+      case "mapreduce2":
       case "mapreduce":
       case "hbase":
         return "_blank";


Reply via email to