]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6799 Ability to access the logs of the computation of a project
authorStas Vilchik <vilchiks@gmail.com>
Mon, 28 Sep 2015 10:27:58 +0000 (12:27 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 28 Sep 2015 10:28:07 +0000 (12:28 +0200)
server/sonar-web/src/main/js/apps/background-tasks/tasks.js

index add7ff596123ddb1c3cc40f80756599445f1b624..2b347e2b24eba0fb0f5434ed4c4b1855bc8b5be6 100644 (file)
@@ -84,13 +84,20 @@ export default React.createClass({
   renderCancelButton(task) {
     if (task.status === STATUSES.PENDING) {
       return (
-          <td className="thin">
-            <a onClick={this.onTaskCanceled.bind(this, task)} className="icon-delete" title="Cancel Task"
-               data-toggle="tooltip" href="#"></a>
-          </td>
+          <a onClick={this.onTaskCanceled.bind(this, task)} className="icon-delete" title="Cancel Task"
+             data-toggle="tooltip" href="#"></a>
       );
     } else {
-      return <td className="thin"></td>;
+      return null;
+    }
+  },
+
+  renderLogsLink(task) {
+    if (task.logs) {
+      let url = `${window.baseUrl}/api/ce/logs?taskId=${task.id}`;
+      return <a target="_blank" href={url}>Logs</a>;
+    } else {
+      return null;
     }
   },
 
@@ -105,7 +112,10 @@ export default React.createClass({
           {this.renderTaskDate(task, 'startedAt', 'LTS')}
           {this.renderTaskDate(task, 'finishedAt', 'LTS')}
           {this.renderTaskExecutionTime(task)}
-          {this.renderCancelButton(task)}
+          <td className="thin nowrap text-right">
+            {this.renderLogsLink(task)}
+            {this.renderCancelButton(task)}
+          </td>
         </tr>
     );
   },