YARN-7824. [UI2] Yarn Component Instance page should include link to container logs...
authorSunil G <sunilg@apache.org>
Thu, 14 Feb 2019 10:12:19 +0000 (15:42 +0530)
committerSunil G <sunilg@apache.org>
Thu, 14 Feb 2019 10:12:19 +0000 (15:42 +0530)
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-component-instance.js
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs

index be4b4f3..16e0e03 100644 (file)
@@ -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 `<a href="${containerLogUrl}&service=${serviceName}">Link</a>`;
+        } else {
+          return 'N/A';
+        }
+      }
     });
 
     return ColumnDef.make(cols);
index 710a26d..1bce607 100644 (file)
@@ -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}`;
   })
 });
index f915642..b83a743 100644 (file)
             <td>{{check-availability model.container.exitStatusCode}}</td>
           </tr>
           <tr>
+            <td>Logs</td>
+            <td><a href="{{model.container.containerLogURL}}&service={{service}}">Link</a></td>
+          </tr>
+          <tr>
             <td>Terminal</td>
             <td><a href="{{model.container.termLink}}&user.name={{model.userInfo.requestedUser}}" target="_blank">Link</a></td>
           </tr>