Commit 2ed39cce by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2171: Atlas UI fix when accessed via Knox proxy without / at the end

parent e406603a
...@@ -71,11 +71,17 @@ ...@@ -71,11 +71,17 @@
} }
.initialLoading { .initialLoading {
display: block; position: fixed;
position: absolute; top: 0;
margin-top: 30%; right: 0;
right: 50%; left: 0;
height: 60px; bottom: 0;
background: url("../img/ring.gif") no-repeat;
background-position: 50% 50%;
background-size: 60px;
@media (min-width: 768px) {
left: 350px;
}
} }
.tableOverlay { .tableOverlay {
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<header id="new-header" class="clearfix"></header> <header id="new-header" class="clearfix"></header>
<div id="new-page-wrapper"> <div id="new-page-wrapper">
<div> <div>
<img class="initialLoading" src="img/ring.gif"> <div class="initialLoading"></div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
--> -->
<ul class="sidebar-nav"> <ul class="sidebar-nav">
<li class="sidebar-brand"> <li class="sidebar-brand">
<a href="index.html"><i class="fa fa-globe"></i> Apache Atlas</a> <a href="{{apiBaseUrl}}/index.html"><i class="fa fa-globe"></i> Apache Atlas</a>
</li> </li>
<ul class="tabs" style="width: 100%;" role="tablist"> <ul class="tabs" style="width: 100%;" role="tablist">
<li role="presentation" class="{{tabClass}}"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li> <li role="presentation" class="{{tabClass}}"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li>
......
...@@ -16,12 +16,15 @@ ...@@ -16,12 +16,15 @@
* limitations under the License. * limitations under the License.
*/ */
define(['require', 'utils/Enums'], function(require, Enums) { define(['require', 'utils/Enums', 'utils/Utils'], function(require, Enums, Utils) {
'use strict'; 'use strict';
var UrlLinks = { var UrlLinks = {
baseUrl: 'api/atlas', apiBaseUrl: Utils.getBaseUrl(window.location.pathname)
baseUrlV2: 'api/atlas/v2', };
_.extend(UrlLinks, {
baseUrl: UrlLinks.apiBaseUrl + '/api/atlas',
baseUrlV2: UrlLinks.apiBaseUrl + '/api/atlas/v2',
typedefsUrl: function() { typedefsUrl: function() {
return { return {
defs: this.baseUrlV2 + '/types/typedefs', defs: this.baseUrlV2 + '/types/typedefs',
...@@ -122,7 +125,7 @@ define(['require', 'utils/Enums'], function(require, Enums) { ...@@ -122,7 +125,7 @@ define(['require', 'utils/Enums'], function(require, Enums) {
return this.baseUrl + '/admin/session'; return this.baseUrl + '/admin/session';
} }
}; });
return UrlLinks; return UrlLinks;
}); });
\ No newline at end of file
...@@ -69,6 +69,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -69,6 +69,9 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}); });
return uuid; return uuid;
}; };
Utils.getBaseUrl = function(url) {
return url.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, '');
};
pnotify.prototype.options.styling = "bootstrap3"; pnotify.prototype.options.styling = "bootstrap3";
var notify = function(options) { var notify = function(options) {
return new pnotify(_.extend({ return new pnotify(_.extend({
......
...@@ -20,7 +20,8 @@ define(['require', ...@@ -20,7 +20,8 @@ define(['require',
'hbs!tmpl/business_catalog/SideNavLayoutView_tmpl', 'hbs!tmpl/business_catalog/SideNavLayoutView_tmpl',
'utils/Utils', 'utils/Utils',
'utils/Globals', 'utils/Globals',
], function(require, tmpl, Utils, Globals) { 'utils/UrlLinks'
], function(require, tmpl, Utils, Globals, UrlLinks) {
'use strict'; 'use strict';
var SideNavLayoutView = Marionette.LayoutView.extend({ var SideNavLayoutView = Marionette.LayoutView.extend({
...@@ -37,7 +38,8 @@ define(['require', ...@@ -37,7 +38,8 @@ define(['require',
templateHelpers: function() { templateHelpers: function() {
return { return {
taxonomy: Globals.taxonomy, taxonomy: Globals.taxonomy,
tabClass: this.tabClass tabClass: this.tabClass,
apiBaseUrl: UrlLinks.apiBaseUrl
}; };
}, },
events: function() { events: function() {
......
...@@ -254,19 +254,19 @@ define(['require', ...@@ -254,19 +254,19 @@ define(['require',
if (node) { if (node) {
if (node.isProcess) { if (node.isProcess) {
if (Enums.entityStateReadOnly[node.status]) { if (Enums.entityStateReadOnly[node.status]) {
return 'img/icon-gear-delete.png'; return UrlLinks.apiBaseUrl + '/img/icon-gear-delete.png';
} else if (node.id == that.guid) { } else if (node.id == that.guid) {
return 'img/icon-gear-active.png'; return UrlLinks.apiBaseUrl + '/img/icon-gear-active.png';
} else { } else {
return 'img/icon-gear.png'; return UrlLinks.apiBaseUrl + '/img/icon-gear.png';
} }
} else { } else {
if (Enums.entityStateReadOnly[node.status]) { if (Enums.entityStateReadOnly[node.status]) {
return 'img/icon-table-delete.png'; return UrlLinks.apiBaseUrl + '/img/icon-table-delete.png';
} else if (node.id == that.guid) { } else if (node.id == that.guid) {
return 'img/icon-table-active.png'; return UrlLinks.apiBaseUrl + '/img/icon-table-active.png';
} else { } else {
return 'img/icon-table.png'; return UrlLinks.apiBaseUrl + '/img/icon-table.png';
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment