{"action":"created","comment":{"url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/comments/77970724","id":77970724,"diff_hunk":"@@ -0,0 +1,437 @@\n+$(document).ready(function() {\n+    //toastr config\n+    toastr.options.closeButton = true;\n+    toastr.options.closeDuration = 2000;\n+    var urlproviderId,\n+        managedTotal = 0,\n+        unmanagedTotal = 0,\n+        unassigned = 0,\n+        managedunmanagedTotal = 0,\n+        managedData = 0,\n+        unManagedData = 0,\n+        unAssignedData = 0;\n+        $('#instanceActionListLoader').show();\n+\n+    function clearInstance() {\n+        unmanagedTotal = managedTotal = unassigned = managedunmanagedTotal = 0;\n+        $('#totalManagedInstances').html(managedTotal);\n+        $('#totalUnmanagedInstances').html(unmanagedTotal);\n+        $('#totalUnAssignedInstances').html(unassigned);\n+        $('#totalInstances').html(managedunmanagedTotal);\n+        $('#instanceTableContainer').hide();\n+        $('#instanceAssignedContainer').hide();\n+        $('#instanceUnAssignedContainer').hide();\n+        $('.footer').addClass('hidden');\n+    }\n+\n+    $(\"#refreshBtn\").click(function() {\n+        clearInstance();\n+        getManagedInstances();\n+        getAssignedInstances();\n+        getUnassignedInstances();\n+    });\n+\n+    var orgId, orgProviderId;\n+    $.get(\"/d4dMasters/readmasterjsonnew/1\", function(data) {\n+        for (var i = 0; i < data.length; i++) {\n+            $(\"#orgDropdown\").append($(\"<option></option>\").val(data[i].rowid).html(data[i].orgname));\n+        }\n+        orgId = data[0].rowid;\n+        $(\"#orgDropdown\").change(function(e) {\n+            clearInstance();\n+            orgId = $(\"#orgDropdown\").val();\n+            $(\"#providerDropdown\").find(\"option:gt(0)\").remove();\n+            getManagedInstances();\n+            getAssignedInstances();\n+            getUnassignedInstances();\n+            awsProviders(orgId);\n+            $('#instanceActionListLoader').show();\n+        });\n+        $(\"#orgDropdown\").trigger(\"change\");\n+    });\n+\n+    //ajax call to get the list of aws providiers.\n+    function awsProviders(orgId) {\n+        $.ajax({\n+            type: 'GET',\n+            url: '../aws/providers/organizations/' + orgId,\n+            success: function(data, success) {\n+                if (data.length === 0) {\n+                    $('.providerValues').addClass('hidden');\n+                    $('.noProviderView').show();\n+                } else {\n+                    for (var i = 0; i < data.length; i++) {\n+                        $('.noProviderView').hide();\n+                        $('.providerValues').removeClass('hidden');\n+                        $(\"#providerDropdown\").append($(\"<option></option>\").val(data[i]._id).html(data[i].providerName).attr('rowId', data[i]._id));\n+                    }\n+                    $(\"#providerDropdown\").change(function(e) {\n+                        var element = $(\"option:selected\", this);\n+                        orgProviderId = element.attr(\"rowId\");\n+                        clearInstance();\n+                        if (orgProviderId) {\n+                            getManagedInstances();\n+                            getAssignedInstances();\n+                            getUnassignedInstances();\n+                        } else {\n+                            getManagedInstances();\n+                            getAssignedInstances();\n+                            getUnassignedInstances();\n+                        }\n+                    });\n+                    $(\"#providerDropdown\").trigger(\"change\");\n+                }\n+            },\n+            error :function() {\n+                $('.providerValues').addClass('hidden');\n+                $('.noProviderView').show();\n+                $('#instanceActionListLoader').hide();\n+          }\n+        });\n+    }\n+\n+    function updateTotalCount(type, count) {\n+        if (type === \"managed\") {\n+            managedTotal += count;\n+            $('#totalManagedInstances').html(managedTotal);\n+        }\n+        if (type === \"assigned\") {\n+            unmanagedTotal += count;\n+            $('#totalUnmanagedInstances').html(unmanagedTotal);\n+        }\n+        if (type === \"unassigned\") {\n+            unassigned += count;\n+            $('#totalUnAssignedInstances').html(unassigned);\n+        }\n+        if (type === \"managedunmanaged\") {\n+            managedunmanagedTotal += count;\n+            $('#totalInstances').html(managedunmanagedTotal);\n+        }\n+    }\n+\n+    function getManagedInstances() {\n+        $('#instanceActionListLoader').show();\n+        var urlManagedNoProvider, urlManagedProvider;\n+        if (orgProviderId) {\n+            urlManagedNoProvider = \"../tracked-instances?category=managed&filterBy=orgId:\" + orgId + ' ' + \"providerId:\" + orgProviderId;\n+        } else {\n+            urlManagedProvider = \"../tracked-instances?category=managed&filterBy=orgId:\" + orgId;\n+        }\n+        $.ajax({\n+            type: \"get\",\n+            dataType: \"json\",\n+            async: false,\n+            url: (urlManagedNoProvider) ? urlManagedNoProvider : urlManagedProvider,\n+            success: function(data) {","path":"client/htmls/public/js/awsCapacity.js","position":125,"original_position":125,"commit_id":"504c0024a77e4ee036fdafbcc40260efd1f1dfd4","original_commit_id":"504c0024a77e4ee036fdafbcc40260efd1f1dfd4","user":{"login":"hrushikesh07","id":17826037,"avatar_url":"https://avatars.githubusercontent.com/u/17826037?v=3","gravatar_id":"","url":"https://api.github.com/users/hrushikesh07","html_url":"https://github.com/hrushikesh07","followers_url":"https://api.github.com/users/hrushikesh07/followers","following_url":"https://api.github.com/users/hrushikesh07/following{/other_user}","gists_url":"https://api.github.com/users/hrushikesh07/gists{/gist_id}","starred_url":"https://api.github.com/users/hrushikesh07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrushikesh07/subscriptions","organizations_url":"https://api.github.com/users/hrushikesh07/orgs","repos_url":"https://api.github.com/users/hrushikesh07/repos","events_url":"https://api.github.com/users/hrushikesh07/events{/privacy}","received_events_url":"https://api.github.com/users/hrushikesh07/received_events","type":"User","site_admin":false},"body":"error part is missing for error handling. ","created_at":"2016-09-08T09:09:15Z","updated_at":"2016-09-08T09:09:15Z","html_url":"https://github.com/RLOpenCatalyst/core/pull/704#discussion_r77970724","pull_request_url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704","_links":{"self":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/comments/77970724"},"html":{"href":"https://github.com/RLOpenCatalyst/core/pull/704#discussion_r77970724"},"pull_request":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704"}}},"pull_request":{"url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704","id":84438260,"html_url":"https://github.com/RLOpenCatalyst/core/pull/704","diff_url":"https://github.com/RLOpenCatalyst/core/pull/704.diff","patch_url":"https://github.com/RLOpenCatalyst/core/pull/704.patch","issue_url":"https://api.github.com/repos/RLOpenCatalyst/core/issues/704","number":704,"state":"open","locked":false,"title":"Implemented Capacity Dashboard in Track","user":{"login":"srikanthv02","id":7678543,"avatar_url":"https://avatars.githubusercontent.com/u/7678543?v=3","gravatar_id":"","url":"https://api.github.com/users/srikanthv02","html_url":"https://github.com/srikanthv02","followers_url":"https://api.github.com/users/srikanthv02/followers","following_url":"https://api.github.com/users/srikanthv02/following{/other_user}","gists_url":"https://api.github.com/users/srikanthv02/gists{/gist_id}","starred_url":"https://api.github.com/users/srikanthv02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srikanthv02/subscriptions","organizations_url":"https://api.github.com/users/srikanthv02/orgs","repos_url":"https://api.github.com/users/srikanthv02/repos","events_url":"https://api.github.com/users/srikanthv02/events{/privacy}","received_events_url":"https://api.github.com/users/srikanthv02/received_events","type":"User","site_admin":false},"body":"@hrushikesh07 : Please verify and merge.","created_at":"2016-09-08T08:55:22Z","updated_at":"2016-09-08T09:09:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8be47402eb4d0605d5b8503edc694a11173faff6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704/commits","review_comments_url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704/comments","review_comment_url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RLOpenCatalyst/core/issues/704/comments","statuses_url":"https://api.github.com/repos/RLOpenCatalyst/core/statuses/504c0024a77e4ee036fdafbcc40260efd1f1dfd4","head":{"label":"srikanthv02:devSrikanth","ref":"devSrikanth","sha":"504c0024a77e4ee036fdafbcc40260efd1f1dfd4","user":{"login":"srikanthv02","id":7678543,"avatar_url":"https://avatars.githubusercontent.com/u/7678543?v=3","gravatar_id":"","url":"https://api.github.com/users/srikanthv02","html_url":"https://github.com/srikanthv02","followers_url":"https://api.github.com/users/srikanthv02/followers","following_url":"https://api.github.com/users/srikanthv02/following{/other_user}","gists_url":"https://api.github.com/users/srikanthv02/gists{/gist_id}","starred_url":"https://api.github.com/users/srikanthv02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srikanthv02/subscriptions","organizations_url":"https://api.github.com/users/srikanthv02/orgs","repos_url":"https://api.github.com/users/srikanthv02/repos","events_url":"https://api.github.com/users/srikanthv02/events{/privacy}","received_events_url":"https://api.github.com/users/srikanthv02/received_events","type":"User","site_admin":false},"repo":{"id":52350244,"name":"core","full_name":"srikanthv02/core","owner":{"login":"srikanthv02","id":7678543,"avatar_url":"https://avatars.githubusercontent.com/u/7678543?v=3","gravatar_id":"","url":"https://api.github.com/users/srikanthv02","html_url":"https://github.com/srikanthv02","followers_url":"https://api.github.com/users/srikanthv02/followers","following_url":"https://api.github.com/users/srikanthv02/following{/other_user}","gists_url":"https://api.github.com/users/srikanthv02/gists{/gist_id}","starred_url":"https://api.github.com/users/srikanthv02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srikanthv02/subscriptions","organizations_url":"https://api.github.com/users/srikanthv02/orgs","repos_url":"https://api.github.com/users/srikanthv02/repos","events_url":"https://api.github.com/users/srikanthv02/events{/privacy}","received_events_url":"https://api.github.com/users/srikanthv02/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srikanthv02/core","description":"Repository for RLCatalyst core","fork":true,"url":"https://api.github.com/repos/srikanthv02/core","forks_url":"https://api.github.com/repos/srikanthv02/core/forks","keys_url":"https://api.github.com/repos/srikanthv02/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srikanthv02/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srikanthv02/core/teams","hooks_url":"https://api.github.com/repos/srikanthv02/core/hooks","issue_events_url":"https://api.github.com/repos/srikanthv02/core/issues/events{/number}","events_url":"https://api.github.com/repos/srikanthv02/core/events","assignees_url":"https://api.github.com/repos/srikanthv02/core/assignees{/user}","branches_url":"https://api.github.com/repos/srikanthv02/core/branches{/branch}","tags_url":"https://api.github.com/repos/srikanthv02/core/tags","blobs_url":"https://api.github.com/repos/srikanthv02/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srikanthv02/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srikanthv02/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/srikanthv02/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srikanthv02/core/statuses/{sha}","languages_url":"https://api.github.com/repos/srikanthv02/core/languages","stargazers_url":"https://api.github.com/repos/srikanthv02/core/stargazers","contributors_url":"https://api.github.com/repos/srikanthv02/core/contributors","subscribers_url":"https://api.github.com/repos/srikanthv02/core/subscribers","subscription_url":"https://api.github.com/repos/srikanthv02/core/subscription","commits_url":"https://api.github.com/repos/srikanthv02/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/srikanthv02/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/srikanthv02/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/srikanthv02/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/srikanthv02/core/contents/{+path}","compare_url":"https://api.github.com/repos/srikanthv02/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srikanthv02/core/merges","archive_url":"https://api.github.com/repos/srikanthv02/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srikanthv02/core/downloads","issues_url":"https://api.github.com/repos/srikanthv02/core/issues{/number}","pulls_url":"https://api.github.com/repos/srikanthv02/core/pulls{/number}","milestones_url":"https://api.github.com/repos/srikanthv02/core/milestones{/number}","notifications_url":"https://api.github.com/repos/srikanthv02/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srikanthv02/core/labels{/name}","releases_url":"https://api.github.com/repos/srikanthv02/core/releases{/id}","deployments_url":"https://api.github.com/repos/srikanthv02/core/deployments","created_at":"2016-02-23T10:17:20Z","updated_at":"2016-02-23T10:17:23Z","pushed_at":"2016-09-08T08:52:10Z","git_url":"git://github.com/srikanthv02/core.git","ssh_url":"git@github.com:srikanthv02/core.git","clone_url":"https://github.com/srikanthv02/core.git","svn_url":"https://github.com/srikanthv02/core","homepage":null,"size":17458,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RLOpenCatalyst:dev","ref":"dev","sha":"0e0eb85427ad1f3a655e8458ec2916916b3583be","user":{"login":"RLOpenCatalyst","id":16498934,"avatar_url":"https://avatars.githubusercontent.com/u/16498934?v=3","gravatar_id":"","url":"https://api.github.com/users/RLOpenCatalyst","html_url":"https://github.com/RLOpenCatalyst","followers_url":"https://api.github.com/users/RLOpenCatalyst/followers","following_url":"https://api.github.com/users/RLOpenCatalyst/following{/other_user}","gists_url":"https://api.github.com/users/RLOpenCatalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/RLOpenCatalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLOpenCatalyst/subscriptions","organizations_url":"https://api.github.com/users/RLOpenCatalyst/orgs","repos_url":"https://api.github.com/users/RLOpenCatalyst/repos","events_url":"https://api.github.com/users/RLOpenCatalyst/events{/privacy}","received_events_url":"https://api.github.com/users/RLOpenCatalyst/received_events","type":"Organization","site_admin":false},"repo":{"id":51497611,"name":"core","full_name":"RLOpenCatalyst/core","owner":{"login":"RLOpenCatalyst","id":16498934,"avatar_url":"https://avatars.githubusercontent.com/u/16498934?v=3","gravatar_id":"","url":"https://api.github.com/users/RLOpenCatalyst","html_url":"https://github.com/RLOpenCatalyst","followers_url":"https://api.github.com/users/RLOpenCatalyst/followers","following_url":"https://api.github.com/users/RLOpenCatalyst/following{/other_user}","gists_url":"https://api.github.com/users/RLOpenCatalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/RLOpenCatalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLOpenCatalyst/subscriptions","organizations_url":"https://api.github.com/users/RLOpenCatalyst/orgs","repos_url":"https://api.github.com/users/RLOpenCatalyst/repos","events_url":"https://api.github.com/users/RLOpenCatalyst/events{/privacy}","received_events_url":"https://api.github.com/users/RLOpenCatalyst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RLOpenCatalyst/core","description":"Repository for RLCatalyst core","fork":false,"url":"https://api.github.com/repos/RLOpenCatalyst/core","forks_url":"https://api.github.com/repos/RLOpenCatalyst/core/forks","keys_url":"https://api.github.com/repos/RLOpenCatalyst/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RLOpenCatalyst/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RLOpenCatalyst/core/teams","hooks_url":"https://api.github.com/repos/RLOpenCatalyst/core/hooks","issue_events_url":"https://api.github.com/repos/RLOpenCatalyst/core/issues/events{/number}","events_url":"https://api.github.com/repos/RLOpenCatalyst/core/events","assignees_url":"https://api.github.com/repos/RLOpenCatalyst/core/assignees{/user}","branches_url":"https://api.github.com/repos/RLOpenCatalyst/core/branches{/branch}","tags_url":"https://api.github.com/repos/RLOpenCatalyst/core/tags","blobs_url":"https://api.github.com/repos/RLOpenCatalyst/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RLOpenCatalyst/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RLOpenCatalyst/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/RLOpenCatalyst/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RLOpenCatalyst/core/statuses/{sha}","languages_url":"https://api.github.com/repos/RLOpenCatalyst/core/languages","stargazers_url":"https://api.github.com/repos/RLOpenCatalyst/core/stargazers","contributors_url":"https://api.github.com/repos/RLOpenCatalyst/core/contributors","subscribers_url":"https://api.github.com/repos/RLOpenCatalyst/core/subscribers","subscription_url":"https://api.github.com/repos/RLOpenCatalyst/core/subscription","commits_url":"https://api.github.com/repos/RLOpenCatalyst/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/RLOpenCatalyst/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/RLOpenCatalyst/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/RLOpenCatalyst/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/RLOpenCatalyst/core/contents/{+path}","compare_url":"https://api.github.com/repos/RLOpenCatalyst/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RLOpenCatalyst/core/merges","archive_url":"https://api.github.com/repos/RLOpenCatalyst/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RLOpenCatalyst/core/downloads","issues_url":"https://api.github.com/repos/RLOpenCatalyst/core/issues{/number}","pulls_url":"https://api.github.com/repos/RLOpenCatalyst/core/pulls{/number}","milestones_url":"https://api.github.com/repos/RLOpenCatalyst/core/milestones{/number}","notifications_url":"https://api.github.com/repos/RLOpenCatalyst/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RLOpenCatalyst/core/labels{/name}","releases_url":"https://api.github.com/repos/RLOpenCatalyst/core/releases{/id}","deployments_url":"https://api.github.com/repos/RLOpenCatalyst/core/deployments","created_at":"2016-02-11T06:13:27Z","updated_at":"2016-08-22T19:03:38Z","pushed_at":"2016-09-08T08:55:23Z","git_url":"git://github.com/RLOpenCatalyst/core.git","ssh_url":"git@github.com:RLOpenCatalyst/core.git","clone_url":"https://github.com/RLOpenCatalyst/core.git","svn_url":"https://github.com/RLOpenCatalyst/core","homepage":null,"size":17872,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":5,"forks":24,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704"},"html":{"href":"https://github.com/RLOpenCatalyst/core/pull/704"},"issue":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/issues/704"},"comments":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/issues/704/comments"},"review_comments":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704/comments"},"review_comment":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/pulls/704/commits"},"statuses":{"href":"https://api.github.com/repos/RLOpenCatalyst/core/statuses/504c0024a77e4ee036fdafbcc40260efd1f1dfd4"}}}}
{"actor":{"display_login":"hrushikesh07"}}