{"action":"created","comment":{"url":"https://api.github.com/repos/filipay/monitroom/pulls/comments/81401622","pull_request_review_id":2386508,"id":81401622,"diff_hunk":"@@ -0,0 +1,82 @@\n+var DeviceRow = React.createClass({\n+  lastSeen : function(timestamp) {\n+    var second = 1000;\n+    var minute = 60 * second;\n+    var hour = 60 * minute;\n+    var day = 24 * hour;\n+\n+    var diff = Date.now() - timestamp;\n+\n+    if (diff <= 59 * second) return Math.floor(diff/second) + \" seconds ago\";\n+    if (diff <= 59 * minute) return Math.floor(diff/minute) + \" minutes ago\";\n+    if (diff <= 23 * hour) return Math.floor(diff/hour) + \" hours ago\";\n+\n+    return Math.floor(diff/day) + \" days ago\";\n+  },\n+\n+  render: function () {\n+    return (\n+    <tr>\n+      <td>{this.props.num}</td>\n+      <td>{this.props.device.name}</td>\n+      <td>{this.props.device.ip}</td>\n+      <td>{this.props.device.mac_addr}</td>\n+      <td>{this.props.device.vendor}</td>\n+      <td>{this.lastSeen(this.props.device.times.end)}</td>\n+    </tr>)\n+  },\n+});\n+\n+var DeviceTable = React.createClass({\n+  getInitialState: function () {\n+    return {\n+      data : [],\n+      isLoading: true\n+    };\n+  },\n+  componentWillMount: function () {\n+    $.get(this.props.url, function(data) {\n+      this.setState({ data : data });\n+      this.setState({ isLoading : false })\n+    }.bind(this));\n+  },\n+\n+  render: function () {\n+    if (this.state.isLoading) return <Loading />\n+    var rows = [];\n+    var index = 0;\n+    this.state.data.forEach(function(device) {\n+      rows.push(<DeviceRow key={device.mac_addr} device={device} num={index}/>);\n+      index++;\n+    });\n+    return (\n+      <table className=\"table table-striped\">","path":"public/javascripts/table.jsx","position":53,"original_position":53,"commit_id":"72c98a7c37b9a9d8ebe728defb3cf59f67bf95c3","original_commit_id":"72c98a7c37b9a9d8ebe728defb3cf59f67bf95c3","user":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"body":"I'm not sure what you mean.. Why should this code be moved?","created_at":"2016-09-30T19:18:52Z","updated_at":"2016-09-30T19:18:52Z","html_url":"https://github.com/filipay/monitroom/pull/5#discussion_r81401622","pull_request_url":"https://api.github.com/repos/filipay/monitroom/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/comments/81401622"},"html":{"href":"https://github.com/filipay/monitroom/pull/5#discussion_r81401622"},"pull_request":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/filipay/monitroom/pulls/5","id":85494567,"html_url":"https://github.com/filipay/monitroom/pull/5","diff_url":"https://github.com/filipay/monitroom/pull/5.diff","patch_url":"https://github.com/filipay/monitroom/pull/5.patch","issue_url":"https://api.github.com/repos/filipay/monitroom/issues/5","number":5,"state":"open","locked":false,"title":"Cache creation & integration.","user":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"body":"Added some inital tests.\r\nBuilds now in Travis CI.\r\nRefactoring and focus on Dependancy Injection for testing.","created_at":"2016-09-15T22:53:29Z","updated_at":"2016-09-30T19:18:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aee45047a48382e8cd71ada9c35792ac2940029","assignee":{"login":"kujosHeist","id":5103738,"avatar_url":"https://avatars.githubusercontent.com/u/5103738?v=3","gravatar_id":"","url":"https://api.github.com/users/kujosHeist","html_url":"https://github.com/kujosHeist","followers_url":"https://api.github.com/users/kujosHeist/followers","following_url":"https://api.github.com/users/kujosHeist/following{/other_user}","gists_url":"https://api.github.com/users/kujosHeist/gists{/gist_id}","starred_url":"https://api.github.com/users/kujosHeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kujosHeist/subscriptions","organizations_url":"https://api.github.com/users/kujosHeist/orgs","repos_url":"https://api.github.com/users/kujosHeist/repos","events_url":"https://api.github.com/users/kujosHeist/events{/privacy}","received_events_url":"https://api.github.com/users/kujosHeist/received_events","type":"User","site_admin":false},"assignees":[{"login":"kujosHeist","id":5103738,"avatar_url":"https://avatars.githubusercontent.com/u/5103738?v=3","gravatar_id":"","url":"https://api.github.com/users/kujosHeist","html_url":"https://github.com/kujosHeist","followers_url":"https://api.github.com/users/kujosHeist/followers","following_url":"https://api.github.com/users/kujosHeist/following{/other_user}","gists_url":"https://api.github.com/users/kujosHeist/gists{/gist_id}","starred_url":"https://api.github.com/users/kujosHeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kujosHeist/subscriptions","organizations_url":"https://api.github.com/users/kujosHeist/orgs","repos_url":"https://api.github.com/users/kujosHeist/repos","events_url":"https://api.github.com/users/kujosHeist/events{/privacy}","received_events_url":"https://api.github.com/users/kujosHeist/received_events","type":"User","site_admin":false},{"login":"MichaelDalton7","id":6575966,"avatar_url":"https://avatars.githubusercontent.com/u/6575966?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelDalton7","html_url":"https://github.com/MichaelDalton7","followers_url":"https://api.github.com/users/MichaelDalton7/followers","following_url":"https://api.github.com/users/MichaelDalton7/following{/other_user}","gists_url":"https://api.github.com/users/MichaelDalton7/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelDalton7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelDalton7/subscriptions","organizations_url":"https://api.github.com/users/MichaelDalton7/orgs","repos_url":"https://api.github.com/users/MichaelDalton7/repos","events_url":"https://api.github.com/users/MichaelDalton7/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelDalton7/received_events","type":"User","site_admin":false},{"login":"doogyb","id":6651012,"avatar_url":"https://avatars.githubusercontent.com/u/6651012?v=3","gravatar_id":"","url":"https://api.github.com/users/doogyb","html_url":"https://github.com/doogyb","followers_url":"https://api.github.com/users/doogyb/followers","following_url":"https://api.github.com/users/doogyb/following{/other_user}","gists_url":"https://api.github.com/users/doogyb/gists{/gist_id}","starred_url":"https://api.github.com/users/doogyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doogyb/subscriptions","organizations_url":"https://api.github.com/users/doogyb/orgs","repos_url":"https://api.github.com/users/doogyb/repos","events_url":"https://api.github.com/users/doogyb/events{/privacy}","received_events_url":"https://api.github.com/users/doogyb/received_events","type":"User","site_admin":false},{"login":"HughMcDonnell","id":6764077,"avatar_url":"https://avatars.githubusercontent.com/u/6764077?v=3","gravatar_id":"","url":"https://api.github.com/users/HughMcDonnell","html_url":"https://github.com/HughMcDonnell","followers_url":"https://api.github.com/users/HughMcDonnell/followers","following_url":"https://api.github.com/users/HughMcDonnell/following{/other_user}","gists_url":"https://api.github.com/users/HughMcDonnell/gists{/gist_id}","starred_url":"https://api.github.com/users/HughMcDonnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HughMcDonnell/subscriptions","organizations_url":"https://api.github.com/users/HughMcDonnell/orgs","repos_url":"https://api.github.com/users/HughMcDonnell/repos","events_url":"https://api.github.com/users/HughMcDonnell/events{/privacy}","received_events_url":"https://api.github.com/users/HughMcDonnell/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/filipay/monitroom/pulls/5/commits","review_comments_url":"https://api.github.com/repos/filipay/monitroom/pulls/5/comments","review_comment_url":"https://api.github.com/repos/filipay/monitroom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/filipay/monitroom/issues/5/comments","statuses_url":"https://api.github.com/repos/filipay/monitroom/statuses/72c98a7c37b9a9d8ebe728defb3cf59f67bf95c3","head":{"label":"filipay:dev-filip","ref":"dev-filip","sha":"72c98a7c37b9a9d8ebe728defb3cf59f67bf95c3","user":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"repo":{"id":65933062,"name":"monitroom","full_name":"filipay/monitroom","owner":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filipay/monitroom","description":null,"fork":false,"url":"https://api.github.com/repos/filipay/monitroom","forks_url":"https://api.github.com/repos/filipay/monitroom/forks","keys_url":"https://api.github.com/repos/filipay/monitroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filipay/monitroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filipay/monitroom/teams","hooks_url":"https://api.github.com/repos/filipay/monitroom/hooks","issue_events_url":"https://api.github.com/repos/filipay/monitroom/issues/events{/number}","events_url":"https://api.github.com/repos/filipay/monitroom/events","assignees_url":"https://api.github.com/repos/filipay/monitroom/assignees{/user}","branches_url":"https://api.github.com/repos/filipay/monitroom/branches{/branch}","tags_url":"https://api.github.com/repos/filipay/monitroom/tags","blobs_url":"https://api.github.com/repos/filipay/monitroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filipay/monitroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filipay/monitroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/filipay/monitroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filipay/monitroom/statuses/{sha}","languages_url":"https://api.github.com/repos/filipay/monitroom/languages","stargazers_url":"https://api.github.com/repos/filipay/monitroom/stargazers","contributors_url":"https://api.github.com/repos/filipay/monitroom/contributors","subscribers_url":"https://api.github.com/repos/filipay/monitroom/subscribers","subscription_url":"https://api.github.com/repos/filipay/monitroom/subscription","commits_url":"https://api.github.com/repos/filipay/monitroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/filipay/monitroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/filipay/monitroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/filipay/monitroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/filipay/monitroom/contents/{+path}","compare_url":"https://api.github.com/repos/filipay/monitroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filipay/monitroom/merges","archive_url":"https://api.github.com/repos/filipay/monitroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filipay/monitroom/downloads","issues_url":"https://api.github.com/repos/filipay/monitroom/issues{/number}","pulls_url":"https://api.github.com/repos/filipay/monitroom/pulls{/number}","milestones_url":"https://api.github.com/repos/filipay/monitroom/milestones{/number}","notifications_url":"https://api.github.com/repos/filipay/monitroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filipay/monitroom/labels{/name}","releases_url":"https://api.github.com/repos/filipay/monitroom/releases{/id}","deployments_url":"https://api.github.com/repos/filipay/monitroom/deployments","created_at":"2016-08-17T18:42:06Z","updated_at":"2016-08-28T15:52:53Z","pushed_at":"2016-09-28T22:48:39Z","git_url":"git://github.com/filipay/monitroom.git","ssh_url":"git@github.com:filipay/monitroom.git","clone_url":"https://github.com/filipay/monitroom.git","svn_url":"https://github.com/filipay/monitroom","homepage":null,"size":41,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"filipay:testing","ref":"testing","sha":"2dbd915f512c28f9278c2333c434832a3b41b49d","user":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"repo":{"id":65933062,"name":"monitroom","full_name":"filipay/monitroom","owner":{"login":"filipay","id":6482807,"avatar_url":"https://avatars.githubusercontent.com/u/6482807?v=3","gravatar_id":"","url":"https://api.github.com/users/filipay","html_url":"https://github.com/filipay","followers_url":"https://api.github.com/users/filipay/followers","following_url":"https://api.github.com/users/filipay/following{/other_user}","gists_url":"https://api.github.com/users/filipay/gists{/gist_id}","starred_url":"https://api.github.com/users/filipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipay/subscriptions","organizations_url":"https://api.github.com/users/filipay/orgs","repos_url":"https://api.github.com/users/filipay/repos","events_url":"https://api.github.com/users/filipay/events{/privacy}","received_events_url":"https://api.github.com/users/filipay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filipay/monitroom","description":null,"fork":false,"url":"https://api.github.com/repos/filipay/monitroom","forks_url":"https://api.github.com/repos/filipay/monitroom/forks","keys_url":"https://api.github.com/repos/filipay/monitroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filipay/monitroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filipay/monitroom/teams","hooks_url":"https://api.github.com/repos/filipay/monitroom/hooks","issue_events_url":"https://api.github.com/repos/filipay/monitroom/issues/events{/number}","events_url":"https://api.github.com/repos/filipay/monitroom/events","assignees_url":"https://api.github.com/repos/filipay/monitroom/assignees{/user}","branches_url":"https://api.github.com/repos/filipay/monitroom/branches{/branch}","tags_url":"https://api.github.com/repos/filipay/monitroom/tags","blobs_url":"https://api.github.com/repos/filipay/monitroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filipay/monitroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filipay/monitroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/filipay/monitroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filipay/monitroom/statuses/{sha}","languages_url":"https://api.github.com/repos/filipay/monitroom/languages","stargazers_url":"https://api.github.com/repos/filipay/monitroom/stargazers","contributors_url":"https://api.github.com/repos/filipay/monitroom/contributors","subscribers_url":"https://api.github.com/repos/filipay/monitroom/subscribers","subscription_url":"https://api.github.com/repos/filipay/monitroom/subscription","commits_url":"https://api.github.com/repos/filipay/monitroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/filipay/monitroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/filipay/monitroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/filipay/monitroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/filipay/monitroom/contents/{+path}","compare_url":"https://api.github.com/repos/filipay/monitroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filipay/monitroom/merges","archive_url":"https://api.github.com/repos/filipay/monitroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filipay/monitroom/downloads","issues_url":"https://api.github.com/repos/filipay/monitroom/issues{/number}","pulls_url":"https://api.github.com/repos/filipay/monitroom/pulls{/number}","milestones_url":"https://api.github.com/repos/filipay/monitroom/milestones{/number}","notifications_url":"https://api.github.com/repos/filipay/monitroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filipay/monitroom/labels{/name}","releases_url":"https://api.github.com/repos/filipay/monitroom/releases{/id}","deployments_url":"https://api.github.com/repos/filipay/monitroom/deployments","created_at":"2016-08-17T18:42:06Z","updated_at":"2016-08-28T15:52:53Z","pushed_at":"2016-09-28T22:48:39Z","git_url":"git://github.com/filipay/monitroom.git","ssh_url":"git@github.com:filipay/monitroom.git","clone_url":"https://github.com/filipay/monitroom.git","svn_url":"https://github.com/filipay/monitroom","homepage":null,"size":41,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/5"},"html":{"href":"https://github.com/filipay/monitroom/pull/5"},"issue":{"href":"https://api.github.com/repos/filipay/monitroom/issues/5"},"comments":{"href":"https://api.github.com/repos/filipay/monitroom/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/filipay/monitroom/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/filipay/monitroom/statuses/72c98a7c37b9a9d8ebe728defb3cf59f67bf95c3"}}}}
{"actor":{"display_login":"filipay"}}