{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/46151294","id":46151294,"diff_hunk":"@@ -60,6 +33,97 @@ var TaskListItemComponent = React.createClass({\n     taskHealthMessage: React.PropTypes.string\n   },\n \n+  getHostAndPorts: function () {\n+    var task = this.props.task;\n+    var ports = task.ports;\n+\n+    if (ports == null || ports.length === 0 ) {\n+      return (<span className=\"text-muted\">{task.host}</span>);\n+    }\n+\n+    if (ports != null && ports.length === 1) {\n+      return (\n+        <a className=\"text-muted\" href={`//${task.host}:${ports[0]}`}>\n+          {`${task.host}:${ports[0]}`}\n+        </a>\n+      );\n+    }\n+\n+    if (ports != null && ports.length > 1) {\n+      let portNodes = ports.map(function (port, index) {","path":"src/js/components/TaskListItemComponent.jsx","position":85,"original_position":85,"commit_id":"b8b0e0718c231a37b3c769f16041d54fb051ab6c","original_commit_id":"b8b0e0718c231a37b3c769f16041d54fb051ab6c","user":{"login":"aldipower","id":859154,"avatar_url":"https://avatars.githubusercontent.com/u/859154?v=3","gravatar_id":"","url":"https://api.github.com/users/aldipower","html_url":"https://github.com/aldipower","followers_url":"https://api.github.com/users/aldipower/followers","following_url":"https://api.github.com/users/aldipower/following{/other_user}","gists_url":"https://api.github.com/users/aldipower/gists{/gist_id}","starred_url":"https://api.github.com/users/aldipower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldipower/subscriptions","organizations_url":"https://api.github.com/users/aldipower/orgs","repos_url":"https://api.github.com/users/aldipower/repos","events_url":"https://api.github.com/users/aldipower/events{/privacy}","received_events_url":"https://api.github.com/users/aldipower/received_events","type":"User","site_admin":false},"body":"Oops, a leftover. ´´´index´´´ isn't used.","created_at":"2015-11-30T14:50:59Z","updated_at":"2015-11-30T14:50:59Z","html_url":"https://github.com/mesosphere/marathon-ui/pull/450#discussion_r46151294","pull_request_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/comments/46151294"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/450#discussion_r46151294"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450","id":52015400,"html_url":"https://github.com/mesosphere/marathon-ui/pull/450","diff_url":"https://github.com/mesosphere/marathon-ui/pull/450.diff","patch_url":"https://github.com/mesosphere/marathon-ui/pull/450.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon-ui/issues/450","number":450,"state":"open","locked":false,"title":"Update task endpoints for IP-per-container ","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":"This fixes https://github.com/mesosphere/marathon/issues/2727\r\n\r\n**Preamble**\r\n\r\nThe user can specify IP-per-container settings via the REST API, which will be accepted only if the `host` and `ports` fields are left blank. Providing any of these together with the newly introduced `ipAddress` property (since Marathon 0.14) will result in a serverside validation error.\r\n\r\n**UI Changes**\r\nThis PR updates the Task detail view and the Task list item components to be able to handle the `ipAddresses` property found in a task when the user has previously specified the `ipAddress` in the app definition. Please refer to https://github.com/mesosphere/marathon/issues/2727 for a more specific description.\r\n\r\nThe \"Host\" field is notably replaced by a more generic \"IP Address\" which is populated in all cases. The \"Ports\" field can now be empty. A new field \"Service Discovery\" holds the IP per container service discovery info, if present.\r\n\r\ncc @aquamatthias @leemunroe \r\n\r\nThe resulting UI changes will look like this:\r\n\r\n**Case 1**\r\n========\r\n \r\nTask Detail view with the following app definition:\r\n\r\n```\r\n \"ipAddress\": {\r\n    \"labels\": {\r\n      \"pool\": \"10.1.2.0/24\"\r\n    },\r\n    \"discovery\": {\r\n      \"ports\": [\r\n        { \"number\": 80, \"name\": \"http\", \"protocol\": \"tcp\" },\r\n        { \"number\": 81, \"name\": \"http\", \"protocol\": \"tcp\" }\r\n      ]\r\n    }\r\n  }\r\n```\r\n\r\nand an imaginary Task response with the following:\r\n```\r\n{\r\n  \"host\": \"slave1.local\",\r\n  \"id\": \"marathon\",\r\n  \"ipAddresses\": [\r\n    {\r\n      \"protocol\": \"IPv4\",\r\n      \"ipAddress\": \"192.168.0.2\"\r\n    }\r\n  ]\r\n  ...\r\n}\r\n```\r\nScreenshot:\r\n\r\n![screen shot 2015-11-27 at 17 43 03](https://cloud.githubusercontent.com/assets/1078545/11446284/d63112a8-9534-11e5-92fb-c50e0d24ba03.png)\r\n\r\n**Case 2**\r\n========\r\n \r\nTask List Item with the following app definition:\r\n\r\n```\r\n \"ipAddress\": {\r\n    \"labels\": {\r\n      \"pool\": \"10.1.2.0/24\"\r\n    },\r\n    \"discovery\": {\r\n      \"ports\": [\r\n        { \"number\": 8080, \"name\": \"http\", \"protocol\": \"tcp\" },\r\n        { \"number\": 1080, \"name\": \"http\", \"protocol\": \"tcp\" }\r\n      ]\r\n    }\r\n  }\r\n```\r\n\r\nand an imaginary Task response with the following:\r\n```\r\n{\r\n  \"host\": \"slave1.local\",\r\n  \"id\": \"marathon\",\r\n  \"ipAddresses\": [\r\n    {\r\n      \"protocol\": \"IPv4\",\r\n      \"ipAddress\": \"192.168.0.2\"\r\n    },\r\n   {\r\n      \"protocol\": \"IPv4\",\r\n      \"ipAddress\": \"192.168.0.21\"\r\n    }\r\n  ]\r\n  ...\r\n}\r\n```\r\nScreenshot:\r\n\r\n![screen shot 2015-11-27 at 17 41 55](https://cloud.githubusercontent.com/assets/1078545/11446346/b45a98ce-9535-11e5-80ef-3c3926b79e77.png)\r\n\r\nThe endpoint anchors behave exactly like with normal host:[port] endpoints (ie click on the port to open the link).","created_at":"2015-11-27T17:36:18Z","updated_at":"2015-11-30T14:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5d34789f61511c3ddd6dfe8f3c6e30630d53226","assignee":{"login":"aldipower","id":859154,"avatar_url":"https://avatars.githubusercontent.com/u/859154?v=3","gravatar_id":"","url":"https://api.github.com/users/aldipower","html_url":"https://github.com/aldipower","followers_url":"https://api.github.com/users/aldipower/followers","following_url":"https://api.github.com/users/aldipower/following{/other_user}","gists_url":"https://api.github.com/users/aldipower/gists{/gist_id}","starred_url":"https://api.github.com/users/aldipower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldipower/subscriptions","organizations_url":"https://api.github.com/users/aldipower/orgs","repos_url":"https://api.github.com/users/aldipower/repos","events_url":"https://api.github.com/users/aldipower/events{/privacy}","received_events_url":"https://api.github.com/users/aldipower/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450/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/450/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/b8b0e0718c231a37b3c769f16041d54fb051ab6c","head":{"label":"mesosphere:fix/2727-update-task-endpoints","ref":"fix/2727-update-task-endpoints","sha":"b8b0e0718c231a37b3c769f16041d54fb051ab6c","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-11-30T14:41:10Z","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":8589,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":9,"forks":18,"open_issues":9,"watchers":35,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"d0c1cc2681f5a4cd5898f336659b566bc834cbdd","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-11-30T14:41:10Z","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":8589,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":9,"forks":18,"open_issues":9,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450"},"html":{"href":"https://github.com/mesosphere/marathon-ui/pull/450"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/450"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/issues/450/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/pulls/450/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/450/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon-ui/statuses/b8b0e0718c231a37b3c769f16041d54fb051ab6c"}}}}