You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2015/02/06 18:39:37 UTC

[2/2] tez git commit: TEZ-2052. Tez UI: log view fixes, show version from build, better handling of ats url config. (Sreenath Somarajapuram via hitesh)

TEZ-2052. Tez UI: log view fixes, show version from build, better handling of ats url config. (Sreenath Somarajapuram via hitesh)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/2b12f4cb
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/2b12f4cb
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/2b12f4cb

Branch: refs/heads/master
Commit: 2b12f4cba60e043eaa725c54f7bcfb390460e24a
Parents: d51103d
Author: Hitesh Shah <hi...@apache.org>
Authored: Fri Feb 6 09:30:15 2015 -0800
Committer: Hitesh Shah <hi...@apache.org>
Committed: Fri Feb 6 09:30:15 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 tez-ui/pom.xml                                     | 12 ++++++++++++
 tez-ui/src/main/webapp/app/scripts/app.js          |  7 +++++++
 tez-ui/src/main/webapp/app/scripts/configs.js      |  1 +
 .../controllers/dag-task-attempts-controller.js    |  4 ++--
 .../webapp/app/scripts/controllers/dag_tasks.js    |  4 ++--
 .../controllers/task_task_attempts_controller.js   |  4 ++--
 .../controllers/vertex_task_attempts_controller.js |  4 ++--
 .../scripts/controllers/vertex_tasks_controller.js |  4 ++--
 tez-ui/src/main/webapp/app/scripts/helpers/misc.js | 17 +++++++++++++++++
 .../src/main/webapp/app/templates/application.hbs  |  4 ++--
 tez-ui/src/main/webapp/app/templates/tez-app.hbs   |  2 +-
 12 files changed, 51 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0732004..ab46d64 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -57,6 +57,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2052. Tez UI: log view fixes, show version from build, better handling of ats url config.
   TEZ-2043. Tez UI: add progress info from am webservice to dag and vertex views.
   TEZ-2032. Update CHANGES.txt to show 0.6.0 is released
   TEZ-2018. App Tracking and History URL should point to the Tez UI.

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/pom.xml
----------------------------------------------------------------------
diff --git a/tez-ui/pom.xml b/tez-ui/pom.xml
index ed49f88..db9673f 100644
--- a/tez-ui/pom.xml
+++ b/tez-ui/pom.xml
@@ -130,10 +130,22 @@
         <configuration>
           <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
           <warSourceDirectory>${webappDir}/dist</warSourceDirectory>
+          <warSourceExcludes>**/configs.js</warSourceExcludes>
           <webResources>
             <resource>
+              <filtering>false</filtering>
               <directory>${basedir}/src/main/resources/</directory>
             </resource>
+            <resource>
+              <filtering>false</filtering>
+              <directory>${webappDir}/dist</directory>
+              <exclude>**/configs.js</exclude>
+            </resource>
+            <resource>
+              <filtering>true</filtering>
+              <directory>${webappDir}/dist</directory>
+              <include>**/configs.js</include>
+            </resource>
           </webResources>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/app.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/app.js b/tez-ui/src/main/webapp/app/scripts/app.js
index 4fc461a..69d6407 100644
--- a/tez-ui/src/main/webapp/app/scripts/app.js
+++ b/tez-ui/src/main/webapp/app/scripts/app.js
@@ -34,7 +34,14 @@ var App = window.App = Em.Application.createWithMixins(Bootstrap, {
   },
 
   setConfigs: function (configs) {
+    if(configs.envDefaults.version == "${version}") {
+      delete configs.envDefaults.version;
+    }
     App.Helpers.misc.merge(App.Configs, configs);
+    $.extend(App.env, {
+      timelineBaseUrl: App.Helpers.misc.normalizePath(App.env.timelineBaseUrl),
+      RMWebUrl: App.Helpers.misc.normalizePath(App.env.RMWebUrl)
+    });
     App.advanceReadiness();
   }
 });

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/configs.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/configs.js b/tez-ui/src/main/webapp/app/scripts/configs.js
index b0397d8..1e2782f 100644
--- a/tez-ui/src/main/webapp/app/scripts/configs.js
+++ b/tez-ui/src/main/webapp/app/scripts/configs.js
@@ -20,6 +20,7 @@ App.setConfigs({
 
   /* Environment configurations */
   envDefaults: {
+    version: "${version}",
     /*
      * By default TEZ UI looks for timeline server at http://localhost:8188, uncomment and change
      * the following value for pointing to a different domain.

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
index eaa533e..d473d9a 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag-task-attempts-controller.js
@@ -161,9 +161,9 @@ App.DagTaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentM
               {{#unless view.cellContent}}\
                 Not Available\
               {{else}}\
-                <a href="//{{unbound view.cellContent}}">View</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
                 &nbsp;\
-                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
               {{/unless}}\
             </span>')
         }),

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
index 41bd101..019d29a 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_tasks.js
@@ -180,9 +180,9 @@ App.DagTasksController = Em.ObjectController.extend(App.PaginatedContentMixin, A
               {{#unless view.cellContent}}\
                 Not Available\
               {{else}}\
-                <a href="//{{unbound view.cellContent}}">View</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
                 &nbsp;\
-                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
               {{/unless}}\
             </span>')
         }),

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
index 399124b..aacefe3 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_task_attempts_controller.js
@@ -162,9 +162,9 @@ App.TaskAttemptsController = Em.ObjectController.extend(App.PaginatedContentMixi
               {{#unless view.cellContent}}\
                 Not Available\
               {{else}}\
-                <a href="//{{unbound view.cellContent}}">View</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
                 &nbsp;\
-                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
               {{/unless}}\
             </span>')
         }),

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
index a525ba4..4c38f51 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_task_attempts_controller.js
@@ -162,9 +162,9 @@ App.VertexTaskAttemptsController = Em.ObjectController.extend(App.PaginatedConte
               {{#unless view.cellContent}}\
                 Not Available\
               {{else}}\
-                <a href="//{{unbound view.cellContent}}">View</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
                 &nbsp;\
-                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
               {{/unless}}\
             </span>')
         }),

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
index 44f160e..4241a2b 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_tasks_controller.js
@@ -170,9 +170,9 @@ App.VertexTasksController = Em.ObjectController.extend(App.PaginatedContentMixin
               {{#unless view.cellContent}}\
                 Not Available\
               {{else}}\
-                <a href="//{{unbound view.cellContent}}">View</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}">View</a>\
                 &nbsp;\
-                <a href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
+                <a target="_blank" href="//{{unbound view.cellContent}}?start=0" download target="_blank" type="application/octet-stream">Download</a>\
               {{/unless}}\
             </span>')
         }),

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
index f115379..1bbb677 100644
--- a/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
+++ b/tez-ui/src/main/webapp/app/scripts/helpers/misc.js
@@ -161,6 +161,23 @@ App.Helpers.misc = {
     };
   },
 
+  /**
+   * Normalize path
+   * @param path {String}
+   * @return normalized path {String}
+   */
+  normalizePath: function (path) {
+    if(path && path.charAt(path.length - 1) == '/') {
+      path = path.slice(0, -1);
+    }
+    return path;
+  },
+
+  /**
+   * Merge content of obj2 into obj2, array elements will be concated.
+   * @param obj1 {Object}
+   * @param obj2 {Object}
+   */
   merge: function objectMerge(obj1, obj2) {
     $.each(obj2, function (key, val) {
       if(Array.isArray(obj1[key]) && Array.isArray(val)) {

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/application.hbs b/tez-ui/src/main/webapp/app/templates/application.hbs
index 10d939e..b51818a 100644
--- a/tez-ui/src/main/webapp/app/templates/application.hbs
+++ b/tez-ui/src/main/webapp/app/templates/application.hbs
@@ -22,10 +22,10 @@
       <div class="navbar navbar-static-top">
         <div class="navbar-inner">
           <div class="main-container">
-            <a class="logo" href="/">
+            {{#link-to 'application' class="logo"}}
               <img src="img/apache-tez-logo-transparent.png" width="70px"/>
               <span>{{unbound App.env.version}}</span>
-            </a>
+            {{/link-to}}
           </div>
         </div>
       </div>

http://git-wip-us.apache.org/repos/asf/tez/blob/2b12f4cb/tez-ui/src/main/webapp/app/templates/tez-app.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/tez-app.hbs b/tez-ui/src/main/webapp/app/templates/tez-app.hbs
index 5ab983c..011fde7 100644
--- a/tez-ui/src/main/webapp/app/templates/tez-app.hbs
+++ b/tez-ui/src/main/webapp/app/templates/tez-app.hbs
@@ -28,7 +28,7 @@
         <tbody>
           <tr>
             <td>YARN RM Tracking URL</td>
-            <td><a {{bind-attr href=rmTrackingURL}}>{{unbound appId}}</a></td>
+            <td><a target="_blank" {{bind-attr href=rmTrackingURL}}>{{unbound appId}}</a></td>
           </tr>
           <tr>
             <td>Attempt Id</td>