{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/77599717","id":77599717,"diff_hunk":"@@ -39,11 +40,29 @@ define(['mithril', 'lodash', 'string-plus',\n       return m.request({\n         method: 'DELETE',\n         url:    Routes.apiv2AgentsPath(),\n-        config: mrequest.xhrConfig.v2,\n+        config: mrequest.xhrConfig.v3,\n         data:   json\n       });\n     };\n \n+    var agentsWithState = _.memoize(function (state) {\n+      return self.filterAgent(function (agent) {\n+        return agent.agentConfigState() == state;\n+      }).length;\n+    });\n+\n+    this.countDisabledAgents = function () {\n+      return agentsWithState('Disabled');\n+    };\n+\n+    this.countEnabledAgents = function () {\n+      return agentsWithState('Enabled');\n+    };\n+\n+    this.countPendingAgents = function () {\n+      return agentsWithState('Pending');\n+    };","path":"server/webapp/WEB-INF/rails.new/app/assets/new_javascripts/models/agents/agents.js","position":43,"original_position":43,"commit_id":"3284b8a9ddeee4a8942a901a2e237612fe5b901e","original_commit_id":"3284b8a9ddeee4a8942a901a2e237612fe5b901e","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"All these were moved in from the controller.","created_at":"2016-09-06T09:19:54Z","updated_at":"2016-09-06T09:19:54Z","html_url":"https://github.com/gocd/gocd/pull/2649#discussion_r77599717","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/2649","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/77599717"},"html":{"href":"https://github.com/gocd/gocd/pull/2649#discussion_r77599717"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/2649"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/2649","id":84087263,"html_url":"https://github.com/gocd/gocd/pull/2649","diff_url":"https://github.com/gocd/gocd/pull/2649.diff","patch_url":"https://github.com/gocd/gocd/pull/2649.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/2649","number":2649,"state":"open","locked":false,"title":"Misceallaneous agent SPA tweaks","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"* Extract anonymous functions from views to improve performance\n* push some behavior from controllers into models","created_at":"2016-09-06T09:19:07Z","updated_at":"2016-09-06T09:19:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae4b37413d8add5e66736a7ec576862278da51fb","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/gocd/gocd/milestones/20","html_url":"https://github.com/gocd/gocd/milestones/Release%2016.10","labels_url":"https://api.github.com/repos/gocd/gocd/milestones/20/labels","id":1969370,"number":20,"title":"Release 16.10","description":"","creator":{"login":"rajiesh","id":6533924,"avatar_url":"https://avatars.githubusercontent.com/u/6533924?v=3","gravatar_id":"","url":"https://api.github.com/users/rajiesh","html_url":"https://github.com/rajiesh","followers_url":"https://api.github.com/users/rajiesh/followers","following_url":"https://api.github.com/users/rajiesh/following{/other_user}","gists_url":"https://api.github.com/users/rajiesh/gists{/gist_id}","starred_url":"https://api.github.com/users/rajiesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajiesh/subscriptions","organizations_url":"https://api.github.com/users/rajiesh/orgs","repos_url":"https://api.github.com/users/rajiesh/repos","events_url":"https://api.github.com/users/rajiesh/events{/privacy}","received_events_url":"https://api.github.com/users/rajiesh/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":5,"state":"open","created_at":"2016-08-29T11:25:53Z","updated_at":"2016-09-06T09:19:21Z","due_on":"2016-09-15T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/2649/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/2649/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/2649/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/3284b8a9ddeee4a8942a901a2e237612fe5b901e","head":{"label":"ketan:agents-spa","ref":"agents-spa","sha":"3284b8a9ddeee4a8942a901a2e237612fe5b901e","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"repo":{"id":30253357,"name":"gocd","full_name":"ketan/gocd","owner":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ketan/gocd","description":"Main repository for Go Continuous Delivery","fork":true,"url":"https://api.github.com/repos/ketan/gocd","forks_url":"https://api.github.com/repos/ketan/gocd/forks","keys_url":"https://api.github.com/repos/ketan/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ketan/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ketan/gocd/teams","hooks_url":"https://api.github.com/repos/ketan/gocd/hooks","issue_events_url":"https://api.github.com/repos/ketan/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/ketan/gocd/events","assignees_url":"https://api.github.com/repos/ketan/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/ketan/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/ketan/gocd/tags","blobs_url":"https://api.github.com/repos/ketan/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ketan/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ketan/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/ketan/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ketan/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/ketan/gocd/languages","stargazers_url":"https://api.github.com/repos/ketan/gocd/stargazers","contributors_url":"https://api.github.com/repos/ketan/gocd/contributors","subscribers_url":"https://api.github.com/repos/ketan/gocd/subscribers","subscription_url":"https://api.github.com/repos/ketan/gocd/subscription","commits_url":"https://api.github.com/repos/ketan/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/ketan/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/ketan/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/ketan/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/ketan/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/ketan/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ketan/gocd/merges","archive_url":"https://api.github.com/repos/ketan/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ketan/gocd/downloads","issues_url":"https://api.github.com/repos/ketan/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/ketan/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/ketan/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/ketan/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ketan/gocd/labels{/name}","releases_url":"https://api.github.com/repos/ketan/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/ketan/gocd/deployments","created_at":"2015-02-03T16:49:48Z","updated_at":"2016-08-19T10:36:49Z","pushed_at":"2016-09-06T09:19:01Z","git_url":"git://github.com/ketan/gocd.git","ssh_url":"git@github.com:ketan/gocd.git","clone_url":"https://github.com/ketan/gocd.git","svn_url":"https://github.com/ketan/gocd","homepage":null,"size":243309,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"d269692572ea0992bf38f0649fb5a28139f190ee","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"name":"gocd","full_name":"gocd/gocd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/gocd","description":"Main repository for GoCD - Continuous Delivery server","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/gocd/gocd/deployments","created_at":"2013-12-13T05:26:16Z","updated_at":"2016-09-05T11:46:29Z","pushed_at":"2016-09-06T09:19:08Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":"https://go.cd","size":311755,"stargazers_count":2562,"watchers_count":2562,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":474,"mirror_url":null,"open_issues_count":639,"forks":474,"open_issues":639,"watchers":2562,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/2649"},"html":{"href":"https://github.com/gocd/gocd/pull/2649"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/2649"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/2649/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/2649/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/2649/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/3284b8a9ddeee4a8942a901a2e237612fe5b901e"}}}}
{"actor":{"display_login":"ketan"}}