You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by je...@apache.org on 2015/08/04 23:55:24 UTC

tez git commit: TEZ-2211. Tez UI: Allow users to configure timezone (jeagles)

Repository: tez
Updated Branches:
  refs/heads/master 6a99798f2 -> 1864e4b23


TEZ-2211. Tez UI: Allow users to configure timezone (jeagles)


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

Branch: refs/heads/master
Commit: 1864e4b2315e43542d89cddda1a2ac6adff96f2d
Parents: 6a99798
Author: Jonathan Eagles <je...@yahoo-inc.com>
Authored: Tue Aug 4 15:51:05 2015 -0500
Committer: Jonathan Eagles <je...@yahoo-inc.com>
Committed: Tue Aug 4 15:51:05 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                          | 1 +
 tez-ui/README.TXT                                    | 3 +++
 tez-ui/src/main/resources/META-INF/LICENSE.txt       | 3 ++-
 tez-ui/src/main/webapp/app/index.html                | 1 +
 tez-ui/src/main/webapp/app/scripts/configs.js        | 6 ++++++
 tez-ui/src/main/webapp/app/scripts/helpers/date.js   | 6 +++++-
 tez-ui/src/main/webapp/app/templates/application.hbs | 5 ++++-
 tez-ui/src/main/webapp/bower.json                    | 3 ++-
 8 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1f85954..26ce333 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -61,6 +61,7 @@ Release 0.7.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2211. Tez UI: Allow users to configure timezone
   TEZ-2623. Fix module dependencies related to hadoop-auth.
   TEZ-1314. Port MAPREDUCE-5821 to Tez.
   TEZ-2568. V_INPUT_DATA_INFORMATION may happen after vertex is initialized

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/tez-ui/README.TXT
----------------------------------------------------------------------
diff --git a/tez-ui/README.TXT b/tez-ui/README.TXT
index aa4564c..e3d98f5 100644
--- a/tez-ui/README.TXT
+++ b/tez-ui/README.TXT
@@ -41,6 +41,9 @@ In configs.js
   * Visibility of table columns can be controlled using the column selector. Also an optional set
     of file system counters can be made visible as columns for most of the tables. For adding more
     counters refer configs.js.
+  * Timezone defaults to displaying timestamps in local timezone. For configuring to a specific
+    timezone, configure the timezone value referring to http://momentjs.com/timezone/docs/
+    for valid entries.
 
 Building
 ---------

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/tez-ui/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/resources/META-INF/LICENSE.txt b/tez-ui/src/main/resources/META-INF/LICENSE.txt
index cbb42f3..4f0c9d4 100644
--- a/tez-ui/src/main/resources/META-INF/LICENSE.txt
+++ b/tez-ui/src/main/resources/META-INF/LICENSE.txt
@@ -225,7 +225,8 @@ The Apache TEZ tez-ui bundles the following files under the MIT License:
  - jquery v1.10.2 (http://jquery.org) - Copyright 2005, 2014 jQuery Foundation and other contributors
  - jquery-mousewheel v3.1.12 (https://github.com/jquery/jquery-mousewheel) - Copyright 2006, 2014 jQuery Foundation and other contributors, https://jquery.org/
  - jquery-ui v1.11 (http://jqueryui.com/) - Copyright 2014 jQuery Foundation and other contributors
- - moment v2.8.4 (http://momentjs.com/) - authors : Tim Wood, Iskren Chernev, Moment.js contributors
+ - moment v2.10.6 (http://momentjs.com/) - Copyright (c) 2011-2015 Tim Wood, Iskren Chernev, Moment.js contributors
+ - moment-timezone v0.4.0 (http://momentjs.com/timezone/) - Copyright (c) 2014 Tim Wood
  - FileSaver.js master branch #24b303f49213b905ec9062b708f7cd43d56a5dde (https://github.com/eligrey/FileSaver.js) authors : Eli Grey.
  - CodeMirror 5.2.0 (https://codemirror.net/) authors: Copyright (C) 2015 by Marijn Haverbeke <ma...@gmail.com> and others
 

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/tez-ui/src/main/webapp/app/index.html
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/index.html b/tez-ui/src/main/webapp/app/index.html
index 3a6c9f6..bb65e6b 100644
--- a/tez-ui/src/main/webapp/app/index.html
+++ b/tez-ui/src/main/webapp/app/index.html
@@ -42,6 +42,7 @@
     <script src="bower_components/bootstrap/js/button.js"></script>
     <script src="bower_components/jquery-ui/ui/datepicker.js"></script>
     <script src="bower_components/moment/moment.js"></script>
+    <script src="bower_components/moment-timezone/builds/moment-timezone-with-data-2010-2020.js"></script>
     <script src="bower_components/handlebars/handlebars.js"></script>
     <script src="@@ember"></script>
     <script src="@@ember_data"></script>

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/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 7fef209..b4dafc7 100644
--- a/tez-ui/src/main/webapp/app/scripts/configs.js
+++ b/tez-ui/src/main/webapp/app/scripts/configs.js
@@ -37,6 +37,12 @@ App.setConfigs({
      * Ensures that some of the UI features work with old versions of Tez
      */
     compatibilityMode: false,
+
+    /*
+     * Default time zone for UI display. Set to undefined for local timezone
+     * For configuration see http://momentjs.com/timezone/docs/
+     */
+    //timezone: "UTC",
   },
 
   /*

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/tez-ui/src/main/webapp/app/scripts/helpers/date.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/date.js b/tez-ui/src/main/webapp/app/scripts/helpers/date.js
index 5990c24..b9c9683 100644
--- a/tez-ui/src/main/webapp/app/scripts/helpers/date.js
+++ b/tez-ui/src/main/webapp/app/scripts/helpers/date.js
@@ -63,7 +63,11 @@ App.Helpers.date = {
         format += ':SSS';
       }
     }
-    return moment.utc(timestamp).local().format(format);
+    var zone = moment.tz.zone(App.get('env.timezone'));
+    if (zone == null)  {
+      return moment.utc(timestamp).local().format(format);
+    }
+    return moment.tz(timestamp, zone.name).format(format);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/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 8dc0b55..f25ed89 100644
--- a/tez-ui/src/main/webapp/app/templates/application.hbs
+++ b/tez-ui/src/main/webapp/app/templates/application.hbs
@@ -40,6 +40,9 @@
   <div class="footer">
     <div class="main-container">
       <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Licensed under the Apache License, Version 2.0</a>.
+      {{#if App.env.timezone}}
+        <span>Timezone: {{App.env.timezone}}</span>
+      {{/if}}
     </div>
   </div>
-</div>
\ No newline at end of file
+</div>

http://git-wip-us.apache.org/repos/asf/tez/blob/1864e4b2/tez-ui/src/main/webapp/bower.json
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/bower.json b/tez-ui/src/main/webapp/bower.json
index e905c55..cc6577b 100644
--- a/tez-ui/src/main/webapp/bower.json
+++ b/tez-ui/src/main/webapp/bower.json
@@ -4,7 +4,8 @@
   "license": "Apache2",
   "dependencies": {
     "ember": "1.7.0",
-    "moment": "2.8.4",
+    "moment": "2.10.6",
+    "moment-timezone": "0.4.0",
     "ember-data": "1.0.0-beta.11",
     "ember-i18n": "2.9.0",
     "bootstrap": "3.3.1",