diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js index eaddfcbf6ee..6d69828069e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js @@ -25,22 +25,14 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForQuery(query) { - var extension = this.get("host").split('/').pop(); - if (extension != query.nodeAddr) { - this.host = this.get("host") + query.nodeAddr; - } var url = this._buildURL(); - url = url + "/apps"; + url = url.replace("{nodeAddress}", query.nodeAddr) + "/apps"; return url; }, 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(); - url = url + "/apps/" + query.appId; + url = url.replace("{nodeAddress}", query.nodeAddr) + "/apps/" + query.appId; return url; }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js index 56c4bcd7414..0fff047165d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js @@ -25,22 +25,14 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForQuery(query) { - var extension = this.get("host").split('/').pop(); - if (extension != query.nodeHttpAddr) { - this.host = this.get("host") + query.nodeHttpAddr; - } var url = this._buildURL(); - url = url + "/containers"; + url = url.replace("{nodeAddress}", query.nodeHttpAddr) + "/containers"; return url; }, urlForQueryRecord(query) { - var extension = this.get("host").split('/').pop(); - if (extension != query.nodeHttpAddr) { - this.host = this.get("host") + query.nodeHttpAddr; - } var url = this._buildURL(); - url = url + "/containers/" + query.containerId; + url = url.replace("{nodeAddress}", query.nodeHttpAddr) + "/containers/" + query.containerId; return url; }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js index 7a0fc4ac00a..5bcfc9a6726 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js @@ -25,11 +25,8 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForFindRecord(id, modelName, snapshot) { - var extension = this.get("host").split('/').pop(); - if (extension != id) { - this.host = this.get("host") + id; - } var url = this._buildURL(); + url = url.replace("{nodeAddress}", id); return url; }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js index 59458133de7..3dfd776ef1c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js @@ -68,7 +68,7 @@ export default DS.JSONAPISerializer.extend({ // expected return response is of the form { data: [ {}, {} ] } var normalizedArrayResponse = {}; // payload is of the form { "apps" : { "app": [ {},{},{} ] } } - if (payload.apps) { + if (payload.apps && payload.apps.app) { normalizedArrayResponse.data = payload.apps.app.map(singleApp => { return this.internalNormalizeSingleResponse(store, primaryModelClass, singleApp); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js index a104f1ecf6d..bf19ad7eded 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js @@ -54,7 +54,7 @@ export default DS.JSONAPISerializer.extend({ requestType) { // expected return response is of the form { data: [ {}, {} ] } var normalizedArrayResponse = {}; - if (payload.containers) { + if (payload.containers && payload.containers.container) { // payload is of the form { "containers" : { "container": [ {},{},{} ] } } normalizedArrayResponse.data = payload.containers.container.map(singleContainer => { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js index c5dbbea0c72..70d4ebc8247 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js @@ -27,6 +27,6 @@ module.exports = { // Yarn UI App configurations timeline: 'ws/v1/applicationhistory', cluster: 'ws/v1/cluster', metrics: 'ws/v1/cluster/metrics', - node: 'ws/v1/node' + node: '{nodeAddress}/ws/v1/node' }, };