ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsai...@apache.org
Subject ambari git commit: AMBARI-22103.HiveView 1.5 is not showing the Visualization page when accessed over Knox(Venkata Sairam)
Date Sat, 30 Sep 2017 12:00:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d4378aacb -> 7e6910f74


AMBARI-22103.HiveView 1.5 is not showing the Visualization page when accessed over Knox(Venkata
Sairam)


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

Branch: refs/heads/trunk
Commit: 7e6910f74b58795fc10de908eaf1103541342ac6
Parents: d4378aa
Author: Venkata Sairam <venkatasairam.lanka@gmail.com>
Authored: Sat Sep 30 17:30:20 2017 +0530
Committer: Venkata Sairam <venkatasairam.lanka@gmail.com>
Committed: Sat Sep 30 17:30:20 2017 +0530

----------------------------------------------------------------------
 .../ui/hive-web/app/adapters/application.js       | 18 ++++++++++++++++++
 .../hive-web/app/controllers/visualization-ui.js  | 10 ++++++----
 .../resources/ui/hive-web/app/utils/constants.js  |  1 +
 3 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6910f7/contrib/views/hive-next/src/main/resources/ui/hive-web/app/adapters/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/adapters/application.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/adapters/application.js
index 2c68b89..cd93407 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/adapters/application.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/adapters/application.js
@@ -50,5 +50,23 @@ export default DS.RESTAdapter.extend({
     var prefix = constants.adapter.apiPrefix + version + constants.adapter.instancePrefix
+ instanceName;
     var url = this._super.apply(this, arguments);
     return prefix + url;
+  },
+
+  buildAssetURL: function () {
+    var version = constants.adapter.version,
+        instanceName = constants.adapter.instance;
+
+    var params = window.location.pathname.split('/').filter(function (param) {
+      return !!param;
+    });
+
+    if (params[params.length - 3] === 'HIVE') {
+      version = params[params.length - 2];
+      instanceName = params[params.length - 1];
+    }
+    var assetPrefix = constants.adapter.apiPrefix.replace("/" + "api" + "/" + "v1", "").replace("versions/","");
+
+    var url = assetPrefix + version + "/" + instanceName;
+    return url;
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6910f7/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
index c908afd..3f5b878 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/visualization-ui.js
@@ -32,8 +32,8 @@ export default Ember.Controller.extend({
 
   polestarUrl: '',
   voyagerUrl: '',
-  polestarPath: 'polestar/#/',
-  voyagerPath: 'voyager/#/',
+  polestarPath: 'polestar/index.html#/',
+  voyagerPath: 'voyager/index.html#/',
 
   showDataExplorer: true,
   showAdvVisulization: false,
@@ -79,8 +79,10 @@ export default Ember.Controller.extend({
           }
           this.set("error", null);
           var id = model.get('id');
-          this.set("polestarUrl", this.get('polestarPath') + "?url=" + url);
-          this.set("voyagerUrl", this.get('voyagerPath') + "?url=" + url);
+          var pstarUrl = this.container.lookup('adapter:application').buildAssetURL("") +
"/" + this.get('polestarPath') + "?url=" + url;
+          this.set("polestarUrl", pstarUrl);
+          var vUrl = this.container.lookup('adapter:application').buildAssetURL("") + "/"
+ this.get('voyagerPath') + "?url=" + url;
+          this.set("voyagerUrl", vUrl);
           Ember.run.scheduleOnce('afterRender', this, function(){
             self.alterIframe();
           });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6910f7/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
index 348454b..fafffc5 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
@@ -200,6 +200,7 @@ export default Ember.Object.create({
     version: '2.0.0',
     instance: 'Hive',
     apiPrefix: '/api/v1/views/HIVE/versions/',
+    assetPrefix: '/views/HIVE/',
     instancePrefix: '/instances/',
     resourcePrefix: 'resources/'
   },


Mime
View raw message