You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/10/28 17:45:54 UTC

[15/38] ambari git commit: AMBARI-18696 - Add Hive&Tez View Links to Hive Summary Page (rzang)

AMBARI-18696 - Add Hive&Tez View Links to Hive Summary Page (rzang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6c222a52
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6c222a52
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6c222a52

Branch: refs/heads/branch-feature-AMBARI-18634
Commit: 6c222a5272ccf3ccd5e57233d823c6b24635b039
Parents: d93b723
Author: Richard Zang <rz...@apache.org>
Authored: Thu Oct 27 16:12:08 2016 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Oct 27 16:12:08 2016 -0700

----------------------------------------------------------------------
 .../controllers/main/service/info/summary.js    |  4 ++++
 ambari-web/app/messages.js                      |  2 ++
 .../main/dashboard/widgets/hbase_links.hbs      |  2 +-
 .../main/dashboard/widgets/hdfs_links.hbs       |  2 +-
 .../main/dashboard/widgets/yarn_links.hbs       |  2 +-
 ambari-web/app/templates/main/service/item.hbs  |  2 +-
 .../templates/main/service/services/hive.hbs    |  8 +++++++
 .../app/views/common/log_search_ui_link_view.js |  4 ++--
 .../app/views/common/quick_view_link_view.js    |  2 +-
 .../app/views/main/service/services/hive.js     | 25 +++++++++++++++++++-
 10 files changed, 45 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 6752bbf..88a6581 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -850,6 +850,10 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
         }
       })
     });
+  },
+
+  goToView: function(event) {
+    App.router.route('main' + event.context.href);
   }
 
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1770624..dc0af81 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -55,6 +55,8 @@ Em.I18n.translations = {
   'app.settings.no.privileges': 'This user does not have any privileges.',
   'app.settings.clusterRole': 'Cluster Role',
   'app.settings.viewPermissions': 'View Permissions',
+  'app.goToView': 'Go To View',
+  'app.debugHiveQuery': 'Debug Hive Query',
 
   'app.aboutAmbari.getInvolved': 'Get involved!',
   'app.aboutAmbari.version': 'Version',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
index 37225e1..e96ed23 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
@@ -58,7 +58,7 @@
 
         <div class="link-button">
           {{#if view.model.quickLinks.length}}
-            {{#view App.QuickViewLinks contentBinding="view.model"}}
+            {{#view App.QuickLinksView contentBinding="view.model"}}
               <div class="btn-group">
                 <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" href="#">
                   {{t common.more}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
index f73e2bb..2feb1b0 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
@@ -79,7 +79,7 @@
 
     <div class="link-button">
       {{#if view.model.quickLinks.length}}
-        {{#view App.QuickViewLinks contentBinding="view.model"}}
+        {{#view App.QuickLinksView contentBinding="view.model"}}
           <div class="btn-group">
             <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
               {{t common.more}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
index eabb6dc..e346abd 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
@@ -46,7 +46,7 @@
 
         <div class="link-button">
           {{#if view.model.quickLinks.length}}
-            {{#view App.QuickViewLinks contentBinding="view.model"}}
+            {{#view App.QuickLinksView contentBinding="view.model"}}
               <div class="btn-group">
                 <button class="btn btn-xs dropdown-toggle" data-toggle="dropdown" href="#">
                   {{t common.more}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/templates/main/service/item.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/item.hbs b/ambari-web/app/templates/main/service/item.hbs
index 5eb4e5b..64c4c7e 100644
--- a/ambari-web/app/templates/main/service/item.hbs
+++ b/ambari-web/app/templates/main/service/item.hbs
@@ -18,7 +18,7 @@
 
 {{view App.MainServiceInfoMenuView configTabBinding="view.hasConfigTab" heatmapTabBinding="view.hasHeatmapTab"}}
   <div class="col-md-3 quick-links-wrapper">
-    {{#view App.QuickViewLinks contentBinding="view.service"}}
+    {{#view App.QuickLinksView contentBinding="view.service"}}
       {{#if view.showQuickLinks}}
         <ul class="nav nav-pills move">
           <li class="dropdown quick-links-dropdown">

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/templates/main/service/services/hive.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/hive.hbs b/ambari-web/app/templates/main/service/services/hive.hbs
index 23a2347..1b26091 100644
--- a/ambari-web/app/templates/main/service/services/hive.hbs
+++ b/ambari-web/app/templates/main/service/services/hive.hbs
@@ -35,4 +35,12 @@
      </td>
    </tr>
   {{/if}}
+{{/each}}
+{{#each link in view.viewLinks}}
+    <tr>
+        <td class="summary-label">{{link.label}}</td>
+        <td class="summary-value" >
+            <a href="#" target="_blank" {{action goToView link target="controller"}}>{{t app.goToView}}</a>
+        </td>
+    </tr>
 {{/each}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/views/common/log_search_ui_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/log_search_ui_link_view.js b/ambari-web/app/views/common/log_search_ui_link_view.js
index 8227b7f..eafc76b 100644
--- a/ambari-web/app/views/common/log_search_ui_link_view.js
+++ b/ambari-web/app/views/common/log_search_ui_link_view.js
@@ -24,9 +24,9 @@ require('views/common/quick_view_link_view');
  * This view helps to get and format correct link to LogSearch UI with query params.
  * Used mostly for navigation to concrete log file.
  *
- * @augments App.QuickViewLinks
+ * @augments App.QuickLinksView
  */
-App.LogSearchUILinkView = App.QuickViewLinks.extend({
+App.LogSearchUILinkView = App.QuickLinksView.extend({
   content: function() {
     return App.Service.find().findProperty('serviceName', 'LOGSEARCH');
   }.property(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index 2678c1c..4c92a2f 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -26,7 +26,7 @@ var App = require('app');
  * @property {?string} status
  */
 
-App.QuickViewLinks = Em.View.extend({
+App.QuickLinksView = Em.View.extend({
 
   /**
    * @type {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c222a52/ambari-web/app/views/main/service/services/hive.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hive.js b/ambari-web/app/views/main/service/services/hive.js
index 2530e42..690575e 100644
--- a/ambari-web/app/views/main/service/services/hive.js
+++ b/ambari-web/app/views/main/service/services/hive.js
@@ -22,7 +22,30 @@ App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/service/services/hive'),
   serviceName: 'HIVE',
   isFullWidth: true,
-  
+  viewsToShow: {
+  'AUTO_HIVE_INSTANCE': {},
+  'TEZ_CLUSTER_INSTANCE': {
+    overwriteLabel: 'app.debugHiveQuery'
+  }},
+  viewLinks: function() {
+    var viewsToShow = this.get('viewsToShow');
+    var links = [];
+    App.router.get('mainViewsController.ambariViews').forEach(function(item) {
+      var view = viewsToShow[item.get('instanceName')];
+      if (view) {
+        var link = {
+          href: item.href,
+          label: item.label
+        };
+        if (view.overwriteLabel) {
+          link.label = Em.I18n.t(view.overwriteLabel);
+        }
+        links.push(link);
+      }
+    });
+    return links;
+  }.property('App.router.mainViewController.ambariViews'),
+
   didInsertElement: function () {
     var controller = this.get('controller');
     this._super();