{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/46429747","id":46429747,"diff_hunk":"@@ -0,0 +1,179 @@\n+var React = require(\"react/addons\");\n+var classNames = require(\"classnames\");\n+var lazy = require(\"lazy.js\");\n+\n+var Util = require(\"../helpers/Util\");\n+var MesosActions = require(\"../actions/MesosActions\");\n+var MesosEvents = require(\"../events/MesosEvents\");\n+var MesosStore = require(\"../stores/MesosStore\");\n+\n+var TaskFileListComponent = React.createClass({\n+  displayName: \"TaskFileListComponent\",\n+  propTypes: {\n+    task: React.PropTypes.object.isRequired\n+  },\n+\n+  getInitialState: function () {\n+    var task = this.props.task;\n+    var taskId = task.id || task.taskId;\n+    return {\n+      files: MesosStore.getTaskFiles(taskId)\n+    };\n+  },\n+\n+  componentWillMount: function () {\n+    MesosStore.on(MesosEvents.CHANGE, this.onMesosChange);\n+  },\n+\n+  componentDidMount: function () {\n+    var task = this.props.task;\n+    var agentId = task.slaveId;\n+    var taskId = task.id || task.taskId;\n+    if (this.state.files == null) {\n+      MesosActions.requestTaskFiles(agentId, taskId);\n+    }\n+  },\n+\n+  componentWillUnmount: function () {\n+    MesosStore.removeListener(MesosEvents.CHANGE, this.onMesosChange);\n+  },\n+\n+  onMesosChange() {\n+    var task = this.props.task;\n+    var taskId = task.id || task.taskId;\n+    this.setState({\n+      files: MesosStore.getTaskFiles(taskId)\n+    });\n+  },\n+\n+  sortBy: function (sortKey) {\n+    var state = this.state;\n+\n+    this.setState({\n+      sortKey: sortKey,\n+      sortDescending: state.sortKey === sortKey && !state.sortDescending\n+    });\n+  },\n+\n+  getCaret: function (sortKey) {\n+    if (sortKey === this.state.sortKey) {\n+      return (\n+        <span className=\"caret\"></span>\n+      );\n+    }\n+    return null;\n+  },\n+\n+  getFileNodes: function () {\n+    var state = this.state;\n+    var files = state.files;\n+    var sortKey = state.sortKey;\n+    if (files != null) {\n+      return lazy(files)\n+        .sortBy((app) => {\n+          return app[sortKey];\n+        }, state.sortDescending)\n+        .map((file) => {\n+          let lastModifiedDate = new Date(file.mtime);\n+          let lastModifiedIsoString = lastModifiedDate.toISOString();\n+          let lastModifiedLocaleString = lastModifiedDate.toLocaleString();\n+          return (\n+            <tr key={file.path}>\n+              <td>\n+                <span>{file.name}</span>\n+                <a className=\"btn btn-default\"\n+                  href={file.download}\n+                  download={`${lastModifiedIsoString}-${file.name}`}>\n+                  <i className=\"icon icon-mini file\"/> Download\n+                </a>\n+              </td>\n+              <td>\n+                <span>{file.mode}</span>\n+              </td>\n+              <td>\n+                <span>{file.nlink}</span>\n+              </td>\n+              <td>\n+                <span>{file.uid}</span>\n+              </td>\n+              <td>\n+                <span>{file.gid}</span>\n+              </td>\n+              <td className=\"text-right\">\n+                <span>\n+                  {`${Util.filesize(file.size * Math.pow(1024, 2), 0)}`}","path":"src/js/components/TaskFileListComponent.jsx","position":104,"original_position":104,"commit_id":"f7418cb234eb594e6837511075f4bcf0d137d22a","original_commit_id":"f7418cb234eb594e6837511075f4bcf0d137d22a","user":{"login":"pierlo-upitup","id":1078545,"avatar_url":"https://avatars.githubusercontent.com/u/1078545?v=3","gravatar_id":"","url":"https://api.github.com/users/pierlo-upitup","html_url":"https://github.com/pierlo-upitup","followers_url":"https://api.github.com/users/pierlo-upitup/followers","following_url":"https://api.github.com/users/pierlo-upitup/following{/other_user}","gists_url":"https://api.github.com/users/pierlo-upitup/gists{/gist_id}","starred_url":"https://api.github.com/users/pierlo-upitup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierlo-upitup/subscriptions","organizations_url":"https://api.github.com/users/pierlo-upitup/orgs","repos_url":"https://api.github.com/users/pierlo-upitup/repos","events_url":"https://api.github.com/users/pierlo-upitup/events{/privacy}","received_events_url":"https://api.github.com/users/pierlo-upitup/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-12-02T15:42:24Z","updated_at":"2015-12-02T15:42:24Z","html_url":"https://github.com/mesosphere/marathon-ui/pull/449#discussion_r46429747","pull_request_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/46429747"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/449#discussion_r46429747"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449","id":52002973,"html_url":"https://github.com/mesosphere/marathon-ui/pull/449","diff_url":"https://github.com/mesosphere/marathon-ui/pull/449.diff","patch_url":"https://github.com/mesosphere/marathon-ui/pull/449.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/449","number":449,"state":"open","locked":false,"title":"DO NOT MERGE: Feature/2721 show error and output logs","user":{"login":"orlandohohmeier","id":647035,"avatar_url":"https://avatars.githubusercontent.com/u/647035?v=3","gravatar_id":"","url":"https://api.github.com/users/orlandohohmeier","html_url":"https://github.com/orlandohohmeier","followers_url":"https://api.github.com/users/orlandohohmeier/followers","following_url":"https://api.github.com/users/orlandohohmeier/following{/other_user}","gists_url":"https://api.github.com/users/orlandohohmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/orlandohohmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orlandohohmeier/subscriptions","organizations_url":"https://api.github.com/users/orlandohohmeier/orgs","repos_url":"https://api.github.com/users/orlandohohmeier/repos","events_url":"https://api.github.com/users/orlandohohmeier/events{/privacy}","received_events_url":"https://api.github.com/users/orlandohohmeier/received_events","type":"User","site_admin":false},"body":"![ouput-error-log-download](https://cloud.githubusercontent.com/assets/647035/11532077/96ac660c-9901-11e5-9919-e69b1e6d8aae.gif)\r\nProvide links to download logs within the marathon ui, to streamline the task debugging.\r\n\r\n**AC**\r\n* [ ] Task/Instance Detail / Get and display list of task files\r\n* [ ] App Detail / Provide error/output links\r\n* [ ] \"Cache\" mesos calls to improve performance\r\n* [ ]  Indicate (file/state) loading progress (**WIP**)\r\n* [ ]  Test components, store and helpers (**WIP**)\r\n* [ ]  Changelog entry (**WIP**)\r\n\r\nCloses mesosphere/marathon#2721","created_at":"2015-11-27T15:01:10Z","updated_at":"2015-12-02T15:42:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"267905d94add19ac786016e66ac682d5e52aaa3e","assignee":{"login":"pierlo-upitup","id":1078545,"avatar_url":"https://avatars.githubusercontent.com/u/1078545?v=3","gravatar_id":"","url":"https://api.github.com/users/pierlo-upitup","html_url":"https://github.com/pierlo-upitup","followers_url":"https://api.github.com/users/pierlo-upitup/followers","following_url":"https://api.github.com/users/pierlo-upitup/following{/other_user}","gists_url":"https://api.github.com/users/pierlo-upitup/gists{/gist_id}","starred_url":"https://api.github.com/users/pierlo-upitup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierlo-upitup/subscriptions","organizations_url":"https://api.github.com/users/pierlo-upitup/orgs","repos_url":"https://api.github.com/users/pierlo-upitup/repos","events_url":"https://api.github.com/users/pierlo-upitup/events{/privacy}","received_events_url":"https://api.github.com/users/pierlo-upitup/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/449/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/f7418cb234eb594e6837511075f4bcf0d137d22a","head":{"label":"mesosphere:feature/2721-show-error-and-output-logs","ref":"feature/2721-show-error-and-output-logs","sha":"f7418cb234eb594e6837511075f4bcf0d137d22a","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":36859608,"name":"marathon-ui","full_name":"mesosphere/marathon-ui","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon-ui","description":"The web-ui for Marathon (https://github.com/mesosphere/marathon)","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon-ui","forks_url":"https://api.github.com/repos/mesosphere/marathon-ui/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon-ui/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon-ui/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon-ui/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon-ui/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon-ui/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon-ui/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon-ui/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon-ui/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon-ui/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon-ui/releases{/id}","created_at":"2015-06-04T09:00:20Z","updated_at":"2015-11-25T22:39:46Z","pushed_at":"2015-12-02T14:51:17Z","git_url":"git://github.com/mesosphere/marathon-ui.git","ssh_url":"git@github.com:mesosphere/marathon-ui.git","clone_url":"https://github.com/mesosphere/marathon-ui.git","svn_url":"https://github.com/mesosphere/marathon-ui","homepage":"","size":8638,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":7,"forks":19,"open_issues":7,"watchers":35,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"f92871ad8c8050172bc0645c2c284eefaf2c9bb2","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":36859608,"name":"marathon-ui","full_name":"mesosphere/marathon-ui","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/marathon-ui","description":"The web-ui for Marathon (https://github.com/mesosphere/marathon)","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon-ui","forks_url":"https://api.github.com/repos/mesosphere/marathon-ui/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon-ui/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon-ui/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon-ui/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon-ui/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon-ui/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon-ui/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon-ui/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon-ui/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon-ui/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon-ui/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon-ui/releases{/id}","created_at":"2015-06-04T09:00:20Z","updated_at":"2015-11-25T22:39:46Z","pushed_at":"2015-12-02T14:51:17Z","git_url":"git://github.com/mesosphere/marathon-ui.git","ssh_url":"git@github.com:mesosphere/marathon-ui.git","clone_url":"https://github.com/mesosphere/marathon-ui.git","svn_url":"https://github.com/mesosphere/marathon-ui","homepage":"","size":8638,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":7,"forks":19,"open_issues":7,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/449"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/449"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/449/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/449/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/f7418cb234eb594e6837511075f4bcf0d137d22a"}}}}