{"action":"created","comment":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/93298000","pull_request_review_id":13822653,"id":93298000,"diff_hunk":"@@ -0,0 +1,132 @@\n+import React from 'react';\n+import { Modal } from 'react-modal-bootstrap'; \n+import axios from 'axios';\n+import CreateTarget from './CreateTarget';\n+import VictimIP from './VictimIP';\n+\n+export default class ConfigForm extends React.Component {\n+\n+    constructor() {\n+        super();\n+        this.openModal = this.openModal.bind(this);\n+        this.closeModal = this.closeModal.bind(this);\n+        this.handleSubmit = this.handleSubmit.bind(this);\n+        this.handleTarget = this.handleTarget.bind(this);\n+        this.handleIp = this.handleIp.bind(this);\n+        this.createForm = this.createForm.bind(this);\n+        this.enumerateTargets = this.enumerateTargets.bind(this);\n+\n+        this.state = { \n+            showModal: false,\n+            sourceip: '',\n+            victim_id: '',\n+            targetName:'',\n+            targets: []\n+        };\n+    }\n+    openModal() {\n+        let optionValue = document.getElementById('sel1').value;\n+        if (optionValue === 'new') {\n+            this.setState({ open: true });\n+        }\n+    }\n+    closeModal() {\n+        this.setState({ open: false });\n+    }\n+    \n+    componentDidMount() {\n+        this.setState({\n+            sourceip: this.props.sourceip,\n+            victim_id: this.props.victim_id\n+        });\n+        axios.get('/target')\n+        .then(res => {\n+            this.setState({ targets: JSON.parse(res.data) });\n+        })\n+        .catch(function (error) {\n+            console.log(error);\n+        });\n+    }\n+\n+    handleSubmit(event) {\n+        event.preventDefault();\n+        if (this.state.victim_id === '') {\n+            axios.post('/attack', {\n+                sourceip:this.state.sourceip,\n+                target:this.state.targetName\n+            })\n+            .then(function (res) {\n+                console.log(res);\n+                this.context.router.push('/');\n+            })\n+            .catch(function (error) {\n+              console.log(error);\n+            });\n+        }\n+        else {\n+            axios.post('/attack', {\n+                sourceip:this.state.sourceip,\n+                id:this.state.victim_id,\n+                target:this.state.targetName\n+            })\n+            .then(function (res) {\n+                console.log(res);\n+                this.context.router.push('/');\n+            })\n+            .catch(function (error) {\n+              console.log(error);","path":"frontend/src/containers/ConfigForm.js","position":63,"original_position":77,"commit_id":"5f9c479734a19877818c4828a724dc776bf10445","original_commit_id":"5f9c479734a19877818c4828a724dc776bf10445","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"body":"nit","created_at":"2016-12-20T18:38:56Z","updated_at":"2016-12-20T18:38:56Z","html_url":"https://github.com/dionyziz/rupture/pull/201#discussion_r93298000","pull_request_url":"https://api.github.com/repos/dionyziz/rupture/pulls/201","_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/93298000"},"html":{"href":"https://github.com/dionyziz/rupture/pull/201#discussion_r93298000"},"pull_request":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/201"}}},"pull_request":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/201","id":82952180,"html_url":"https://github.com/dionyziz/rupture/pull/201","diff_url":"https://github.com/dionyziz/rupture/pull/201.diff","patch_url":"https://github.com/dionyziz/rupture/pull/201.patch","issue_url":"https://api.github.com/repos/dionyziz/rupture/issues/201","number":201,"state":"open","locked":false,"title":"WebUI in Reactjs","user":{"login":"esarafianou","id":17114347,"avatar_url":"https://avatars.githubusercontent.com/u/17114347?v=3","gravatar_id":"","url":"https://api.github.com/users/esarafianou","html_url":"https://github.com/esarafianou","followers_url":"https://api.github.com/users/esarafianou/followers","following_url":"https://api.github.com/users/esarafianou/following{/other_user}","gists_url":"https://api.github.com/users/esarafianou/gists{/gist_id}","starred_url":"https://api.github.com/users/esarafianou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esarafianou/subscriptions","organizations_url":"https://api.github.com/users/esarafianou/orgs","repos_url":"https://api.github.com/users/esarafianou/repos","events_url":"https://api.github.com/users/esarafianou/events{/privacy}","received_events_url":"https://api.github.com/users/esarafianou/received_events","type":"User","site_admin":false},"body":"A few notes:\r\n1)Files for react components usually start with an uppercase letter.\r\n2) the frontend communicates via backend with a proxy. This is configured in package.json. For more details [here](https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/)\r\n3) We set up the application via create-react-app, the new officially supported way to create single-page React application. More details [here](https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html)\r\n4) create-react-app comes with pre-configured dependencies. If one wants to change the .babelrc or the webpack.config can run npm eject and edit the files. I would like to use a [babel plugin for binding](https://babeljs.io/docs/plugins/transform-function-bind/) but I preferred not to, so as to avoid the eject because of the multiple additional files it creates. More details about eject [here](https://medium.freecodecamp.com/create-react-app-and-the-future-of-creating-react-applications-3c336f29bf1c#.63o4elean)\r\n","created_at":"2016-08-26T20:50:09Z","updated_at":"2016-12-20T18:38:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40ccc5322124e026055300f3669e6763e6680cd1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dionyziz/rupture/pulls/201/commits","review_comments_url":"https://api.github.com/repos/dionyziz/rupture/pulls/201/comments","review_comment_url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dionyziz/rupture/issues/201/comments","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/5f9c479734a19877818c4828a724dc776bf10445","head":{"label":"esarafianou:reactjs","ref":"reactjs","sha":"5f9c479734a19877818c4828a724dc776bf10445","user":{"login":"esarafianou","id":17114347,"avatar_url":"https://avatars.githubusercontent.com/u/17114347?v=3","gravatar_id":"","url":"https://api.github.com/users/esarafianou","html_url":"https://github.com/esarafianou","followers_url":"https://api.github.com/users/esarafianou/followers","following_url":"https://api.github.com/users/esarafianou/following{/other_user}","gists_url":"https://api.github.com/users/esarafianou/gists{/gist_id}","starred_url":"https://api.github.com/users/esarafianou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esarafianou/subscriptions","organizations_url":"https://api.github.com/users/esarafianou/orgs","repos_url":"https://api.github.com/users/esarafianou/repos","events_url":"https://api.github.com/users/esarafianou/events{/privacy}","received_events_url":"https://api.github.com/users/esarafianou/received_events","type":"User","site_admin":false},"repo":{"id":55224742,"name":"rupture","full_name":"esarafianou/rupture","owner":{"login":"esarafianou","id":17114347,"avatar_url":"https://avatars.githubusercontent.com/u/17114347?v=3","gravatar_id":"","url":"https://api.github.com/users/esarafianou","html_url":"https://github.com/esarafianou","followers_url":"https://api.github.com/users/esarafianou/followers","following_url":"https://api.github.com/users/esarafianou/following{/other_user}","gists_url":"https://api.github.com/users/esarafianou/gists{/gist_id}","starred_url":"https://api.github.com/users/esarafianou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esarafianou/subscriptions","organizations_url":"https://api.github.com/users/esarafianou/orgs","repos_url":"https://api.github.com/users/esarafianou/repos","events_url":"https://api.github.com/users/esarafianou/events{/privacy}","received_events_url":"https://api.github.com/users/esarafianou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/esarafianou/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":true,"url":"https://api.github.com/repos/esarafianou/rupture","forks_url":"https://api.github.com/repos/esarafianou/rupture/forks","keys_url":"https://api.github.com/repos/esarafianou/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esarafianou/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esarafianou/rupture/teams","hooks_url":"https://api.github.com/repos/esarafianou/rupture/hooks","issue_events_url":"https://api.github.com/repos/esarafianou/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/esarafianou/rupture/events","assignees_url":"https://api.github.com/repos/esarafianou/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/esarafianou/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/esarafianou/rupture/tags","blobs_url":"https://api.github.com/repos/esarafianou/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esarafianou/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esarafianou/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/esarafianou/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esarafianou/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/esarafianou/rupture/languages","stargazers_url":"https://api.github.com/repos/esarafianou/rupture/stargazers","contributors_url":"https://api.github.com/repos/esarafianou/rupture/contributors","subscribers_url":"https://api.github.com/repos/esarafianou/rupture/subscribers","subscription_url":"https://api.github.com/repos/esarafianou/rupture/subscription","commits_url":"https://api.github.com/repos/esarafianou/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/esarafianou/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/esarafianou/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/esarafianou/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/esarafianou/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/esarafianou/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esarafianou/rupture/merges","archive_url":"https://api.github.com/repos/esarafianou/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esarafianou/rupture/downloads","issues_url":"https://api.github.com/repos/esarafianou/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/esarafianou/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/esarafianou/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/esarafianou/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esarafianou/rupture/labels{/name}","releases_url":"https://api.github.com/repos/esarafianou/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/esarafianou/rupture/deployments","created_at":"2016-04-01T10:38:21Z","updated_at":"2016-05-24T11:09:54Z","pushed_at":"2016-12-20T18:17:20Z","git_url":"git://github.com/esarafianou/rupture.git","ssh_url":"git@github.com:esarafianou/rupture.git","clone_url":"https://github.com/esarafianou/rupture.git","svn_url":"https://github.com/esarafianou/rupture","homepage":null,"size":9734,"stargazers_count":0,"watchers_count":0,"language":"TeX","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":"develop"}},"base":{"label":"dionyziz:develop","ref":"develop","sha":"a9cb2239f617322da9aad0ebd31e4293632a57c3","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"repo":{"id":51319299,"name":"rupture","full_name":"dionyziz/rupture","owner":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dionyziz/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":false,"url":"https://api.github.com/repos/dionyziz/rupture","forks_url":"https://api.github.com/repos/dionyziz/rupture/forks","keys_url":"https://api.github.com/repos/dionyziz/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dionyziz/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dionyziz/rupture/teams","hooks_url":"https://api.github.com/repos/dionyziz/rupture/hooks","issue_events_url":"https://api.github.com/repos/dionyziz/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/dionyziz/rupture/events","assignees_url":"https://api.github.com/repos/dionyziz/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/dionyziz/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/dionyziz/rupture/tags","blobs_url":"https://api.github.com/repos/dionyziz/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dionyziz/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dionyziz/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/dionyziz/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/dionyziz/rupture/languages","stargazers_url":"https://api.github.com/repos/dionyziz/rupture/stargazers","contributors_url":"https://api.github.com/repos/dionyziz/rupture/contributors","subscribers_url":"https://api.github.com/repos/dionyziz/rupture/subscribers","subscription_url":"https://api.github.com/repos/dionyziz/rupture/subscription","commits_url":"https://api.github.com/repos/dionyziz/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/dionyziz/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/dionyziz/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/dionyziz/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/dionyziz/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/dionyziz/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dionyziz/rupture/merges","archive_url":"https://api.github.com/repos/dionyziz/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dionyziz/rupture/downloads","issues_url":"https://api.github.com/repos/dionyziz/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/dionyziz/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/dionyziz/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/dionyziz/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dionyziz/rupture/labels{/name}","releases_url":"https://api.github.com/repos/dionyziz/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/dionyziz/rupture/deployments","created_at":"2016-02-08T19:01:04Z","updated_at":"2016-12-05T21:18:50Z","pushed_at":"2016-12-20T18:17:21Z","git_url":"git://github.com/dionyziz/rupture.git","ssh_url":"git@github.com:dionyziz/rupture.git","clone_url":"https://github.com/dionyziz/rupture.git","svn_url":"https://github.com/dionyziz/rupture","homepage":null,"size":10569,"stargazers_count":132,"watchers_count":132,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":55,"forks":24,"open_issues":55,"watchers":132,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/201"},"html":{"href":"https://github.com/dionyziz/rupture/pull/201"},"issue":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/201"},"comments":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/dionyziz/rupture/statuses/5f9c479734a19877818c4828a724dc776bf10445"}}}}
{"actor":{"display_login":"dionyziz"}}