YARN-5785. [YARN-3368] Accessing applications and containers list from Node page is throwing few exceptions in console. (Akhil P B and Sreenath Somarajapuram via Sunil G)
This commit is contained in:
parent
fad392a22f
commit
013ff07bc6
|
@ -25,22 +25,14 @@ export default AbstractAdapter.extend({
|
||||||
serverName: "NM",
|
serverName: "NM",
|
||||||
|
|
||||||
urlForQuery(query) {
|
urlForQuery(query) {
|
||||||
var extension = this.get("host").split('/').pop();
|
|
||||||
if (extension != query.nodeAddr) {
|
|
||||||
this.host = this.get("host") + query.nodeAddr;
|
|
||||||
}
|
|
||||||
var url = this._buildURL();
|
var url = this._buildURL();
|
||||||
url = url + "/apps";
|
url = url.replace("{nodeAddress}", query.nodeAddr) + "/apps";
|
||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
|
|
||||||
urlForQueryRecord: function (query) {
|
urlForQueryRecord: function (query) {
|
||||||
var extension = this.get("host").split('/').pop();
|
|
||||||
if (extension != query.nodeAddr) {
|
|
||||||
this.host = this.get("host") + query.nodeAddr;
|
|
||||||
}
|
|
||||||
var url = this._buildURL();
|
var url = this._buildURL();
|
||||||
url = url + "/apps/" + query.appId;
|
url = url.replace("{nodeAddress}", query.nodeAddr) + "/apps/" + query.appId;
|
||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -25,22 +25,14 @@ export default AbstractAdapter.extend({
|
||||||
serverName: "NM",
|
serverName: "NM",
|
||||||
|
|
||||||
urlForQuery(query) {
|
urlForQuery(query) {
|
||||||
var extension = this.get("host").split('/').pop();
|
|
||||||
if (extension != query.nodeHttpAddr) {
|
|
||||||
this.host = this.get("host") + query.nodeHttpAddr;
|
|
||||||
}
|
|
||||||
var url = this._buildURL();
|
var url = this._buildURL();
|
||||||
url = url + "/containers";
|
url = url.replace("{nodeAddress}", query.nodeHttpAddr) + "/containers";
|
||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
|
|
||||||
urlForQueryRecord(query) {
|
urlForQueryRecord(query) {
|
||||||
var extension = this.get("host").split('/').pop();
|
|
||||||
if (extension != query.nodeHttpAddr) {
|
|
||||||
this.host = this.get("host") + query.nodeHttpAddr;
|
|
||||||
}
|
|
||||||
var url = this._buildURL();
|
var url = this._buildURL();
|
||||||
url = url + "/containers/" + query.containerId;
|
url = url.replace("{nodeAddress}", query.nodeHttpAddr) + "/containers/" + query.containerId;
|
||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,8 @@ export default AbstractAdapter.extend({
|
||||||
serverName: "NM",
|
serverName: "NM",
|
||||||
|
|
||||||
urlForFindRecord(id, modelName, snapshot) {
|
urlForFindRecord(id, modelName, snapshot) {
|
||||||
var extension = this.get("host").split('/').pop();
|
|
||||||
if (extension != id) {
|
|
||||||
this.host = this.get("host") + id;
|
|
||||||
}
|
|
||||||
var url = this._buildURL();
|
var url = this._buildURL();
|
||||||
|
url = url.replace("{nodeAddress}", id);
|
||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default DS.JSONAPISerializer.extend({
|
||||||
// expected return response is of the form { data: [ {}, {} ] }
|
// expected return response is of the form { data: [ {}, {} ] }
|
||||||
var normalizedArrayResponse = {};
|
var normalizedArrayResponse = {};
|
||||||
// payload is of the form { "apps" : { "app": [ {},{},{} ] } }
|
// payload is of the form { "apps" : { "app": [ {},{},{} ] } }
|
||||||
if (payload.apps) {
|
if (payload.apps && payload.apps.app) {
|
||||||
normalizedArrayResponse.data = payload.apps.app.map(singleApp => {
|
normalizedArrayResponse.data = payload.apps.app.map(singleApp => {
|
||||||
return this.internalNormalizeSingleResponse(store, primaryModelClass,
|
return this.internalNormalizeSingleResponse(store, primaryModelClass,
|
||||||
singleApp);
|
singleApp);
|
||||||
|
|
|
@ -54,7 +54,7 @@ export default DS.JSONAPISerializer.extend({
|
||||||
requestType) {
|
requestType) {
|
||||||
// expected return response is of the form { data: [ {}, {} ] }
|
// expected return response is of the form { data: [ {}, {} ] }
|
||||||
var normalizedArrayResponse = {};
|
var normalizedArrayResponse = {};
|
||||||
if (payload.containers) {
|
if (payload.containers && payload.containers.container) {
|
||||||
// payload is of the form { "containers" : { "container": [ {},{},{} ] } }
|
// payload is of the form { "containers" : { "container": [ {},{},{} ] } }
|
||||||
normalizedArrayResponse.data =
|
normalizedArrayResponse.data =
|
||||||
payload.containers.container.map(singleContainer => {
|
payload.containers.container.map(singleContainer => {
|
||||||
|
|
|
@ -27,6 +27,6 @@ module.exports = { // Yarn UI App configurations
|
||||||
timeline: 'ws/v1/applicationhistory',
|
timeline: 'ws/v1/applicationhistory',
|
||||||
cluster: 'ws/v1/cluster',
|
cluster: 'ws/v1/cluster',
|
||||||
metrics: 'ws/v1/cluster/metrics',
|
metrics: 'ws/v1/cluster/metrics',
|
||||||
node: 'ws/v1/node'
|
node: '{nodeAddress}/ws/v1/node'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue