From dfe0f42835b1d33baebbc011cfce25ddc96d82e5 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Thu, 14 Feb 2019 15:42:19 +0530 Subject: [PATCH] YARN-7824. [UI2] Yarn Component Instance page should include link to container logs. Contributed by Akhil PB. --- .../controllers/yarn-component-instances/info.js | 13 +++++++++++++ .../webapp/app/models/yarn-component-instance.js | 7 +++++++ .../app/templates/yarn-component-instance/info.hbs | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js index be4b4f3738..16e0e03c3e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js @@ -61,6 +61,19 @@ export default Ember.Controller.extend({ id: 'startedDate', headerTitle: 'Started Time', contentPath: 'startedDate' + }, { + id: 'logsLink', + headerTitle: 'Logs', + contentPath: 'logsLink', + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var containerLogUrl = row.get('containerLogURL'); + if (containerLogUrl) { + return `Link`; + } else { + return 'N/A'; + } + } }); return ColumnDef.make(cols); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js index 710a26de9c..1bce60761b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js @@ -58,5 +58,12 @@ export default DS.Model.extend({ var url = protocol + "//" + node + ":" + port + "/terminal/terminal.template?container=" + containerId; return url; + }), + + containerLogURL: Ember.computed('containerId', function() { + const containerId = this.get('containerId'); + const attemptId = Converter.containerIdToAttemptId(containerId); + const appId = Converter.attemptIdToAppId(attemptId); + return `#/yarn-app/${appId}/logs?attempt=${attemptId}&containerid=${containerId}`; }) }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs index f91564277a..b83a743505 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs @@ -65,6 +65,10 @@ Exit Status Code {{check-availability model.container.exitStatusCode}} + + Logs + Link + Terminal Link