diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore
index 338997fcf7..082fb271f6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore
@@ -2,3 +2,4 @@ tmp/
node_modules/
bower_components/
dist/
+node/
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-log.js
index 2b6febf350..17adc9f0f6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-log.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-log.js
@@ -19,5 +19,6 @@
import DS from 'ember-data';
export default DS.Model.extend({
- logfileName: DS.attr()
+ logFileName: DS.attr(),
+ logFileUrl: DS.attr()
});
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-log.js
index da834f1ca9..900e0ff2f3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-log.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-log.js
@@ -19,8 +19,8 @@
import DS from 'ember-data';
export default DS.JSONAPISerializer.extend({
- normalizeResponse(store, primaryModelClass, payload, id, requestType) {
- const pattern = new RegExp('', 'g');
+ normalizeResponse(store, primaryModelClass, payload) {
+ const pattern = new RegExp('|', 'g');
let fileNames = payload.match(pattern);
if (fileNames == null) {
@@ -29,16 +29,20 @@ export default DS.JSONAPISerializer.extend({
let logfileNames = [];
for (var i = 0; i < fileNames.length; i++) {
- var fileName = fileNames[i].match(//);
- if (fileName.length != null) {
- logfileNames.push({
- id: i,
- type: primaryModelClass.modelName,
- attributes: {
- logfileName: fileName[1]
- }
- });
- }
+ var fileNameMatch = fileNames[i].match(/.+<\/A>|.+<\/a>/);
+ var logFileUrl = fileNameMatch[1] || fileNameMatch[2];
+ var logFileName = logFileUrl.replace('logs', '').replace(/\//g, '');
+
+ if (fileNameMatch.length != null) {
+ logfileNames.push({
+ id: i,
+ type: primaryModelClass.modelName,
+ attributes: {
+ logFileUrl: logFileUrl,
+ logFileName: logFileName
+ }
+ });
+ }
}
return { data : logfileNames };
},
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools.hbs
index 3efcf57974..2306e4b107 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools.hbs
@@ -52,7 +52,7 @@
{{/link-to}}
{{/link-to}}
{{#link-to 'yarn-tools.yarn-rm-log' tagName="li"}}
- {{#link-to 'yarn-tools.yarn-rm-log'}}YARN Daemon logs
+ {{#link-to 'yarn-tools.yarn-rm-log'}}YARN Daemon Logs
{{/link-to}}
{{/link-to}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools/yarn-rm-log.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools/yarn-rm-log.hbs
index 3cf536d29e..6d80246e73 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools/yarn-rm-log.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-tools/yarn-rm-log.hbs
@@ -17,15 +17,15 @@
}}
YARN Daemon Logs
-
-
+
+
{{#if model.logs}}
{{#each model.logs as |log|}}
- -
- {{#link-to 'yarn-tools.yarn-rm-log' (query-params filename=log.logfileName)}}
- {{log.logfileName}}
+
-
+ {{#link-to 'yarn-tools.yarn-rm-log' (query-params filename=log.logFileUrl)}}
+ {{log.logFileName}}
{{/link-to}}
{{/each}}