Repository: tez
Updated Branches:
  refs/heads/branch-0.6 a25a9272b -> c85563ef5


TEZ-1988. Tez UI: does not work when using file:// in a browser (pramachandran)

(cherry picked from commit 96efae01f5e7e2847e78a0b7a7a2dc458e3ff9bc)

Conflicts:
        CHANGES.txt


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

Branch: refs/heads/branch-0.6
Commit: c85563ef54f9ffdbfac849157d4ff34f66148366
Parents: a25a927
Author: Prakash Ramachandran <[email protected]>
Authored: Fri May 1 13:26:46 2015 +0530
Committer: Prakash Ramachandran <[email protected]>
Committed: Fri May 1 13:34:31 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../main/webapp/app/scripts/default-configs.js  | 23 +++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/c85563ef/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 31146c9..33e0d34 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ Release 0.6.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-1988. Tez UI: does not work when using file:// in a browser
   TEZ-2256. Avoid use of BufferTooSmallException to signal end of buffer in 
UnorderedPartitionedKVWriter.
   TEZ-2385. branch-0.6 compile failure caused by TEZ-2226.
   TEZ-2390. tez-tools swimlane tool fails to parse large jobs >8K containers

http://git-wip-us.apache.org/repos/asf/tez/blob/c85563ef/tez-ui/src/main/webapp/app/scripts/default-configs.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/default-configs.js 
b/tez-ui/src/main/webapp/app/scripts/default-configs.js
index e438bad..d0ffa97 100644
--- a/tez-ui/src/main/webapp/app/scripts/default-configs.js
+++ b/tez-ui/src/main/webapp/app/scripts/default-configs.js
@@ -16,18 +16,25 @@
  * limitations under the License.
  */
 
+function constructDefaultUrl(location, port) {
+  var protocol,
+      hostname;
+  if (App.env.isStandalone && location.protocol != 'file:') {
+    protocol = location.protocol;
+    hostname = location.hostname;
+  } else {
+    protocol = 'http:';
+    hostname = 'localhost';
+  }
+  return '%@//%@:%@'.fmt(protocol, hostname, port);
+}
+
 var getDefaultTimelineUrl = function() {
-  var location = window.location;
-  var protocol = App.env.isStandalone ? location.protocol : 'http:';
-  var hostname = App.env.isStandalone ? location.hostname : 'localhost';
-  return '%@//%@:8188'.fmt(protocol, hostname);
+  return constructDefaultUrl(window.location, 8188);
 };
 
 var getDefaultRMWebUrl = function() {
-  var location = window.location;
-  var protocol = App.env.isStandalone ? location.protocol : 'http:';
-  var hostname = App.env.isStandalone ? location.hostname : 'localhost';
-  return '%@//%@:8088'.fmt(protocol, hostname);
+  return constructDefaultUrl(window.location, 8088);
 };
 
 $.extend(true, App.Configs, {

Reply via email to