aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/Header/FlowMenu.jsx
diff options
context:
space:
mode:
authorJason <jason.daurus@gmail.com>2016-06-25 02:18:52 +0800
committerJason <jason.daurus@gmail.com>2016-06-25 02:18:52 +0800
commit2b7923b4f41ec6f8d08c17b2c4a4930e95387e1c (patch)
treed576bb9705f7c3eeaa98ecfa6b829101b180fbf9 /web/src/js/components/Header/FlowMenu.jsx
parent8da623c60389bffc76dd3c1b6d8055dd19f97607 (diff)
downloadmitmproxy-2b7923b4f41ec6f8d08c17b2c4a4930e95387e1c.tar.gz
mitmproxy-2b7923b4f41ec6f8d08c17b2c4a4930e95387e1c.tar.bz2
mitmproxy-2b7923b4f41ec6f8d08c17b2c4a4930e95387e1c.zip
[web] fix actions
Diffstat (limited to 'web/src/js/components/Header/FlowMenu.jsx')
-rw-r--r--web/src/js/components/Header/FlowMenu.jsx25
1 files changed, 16 insertions, 9 deletions
diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
index 1fa7037f..ba1dcbcb 100644
--- a/web/src/js/components/Header/FlowMenu.jsx
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -1,8 +1,8 @@
import React, { PropTypes } from 'react'
+import { connect } from 'react-redux'
import Button from '../common/Button'
-import { FlowActions } from '../../actions.js'
import { MessageUtils } from '../../flow/utils.js'
-import { connect } from 'react-redux'
+import * as flowsActions from '../../ducks/flows'
FlowMenu.title = 'Flow'
@@ -10,16 +10,16 @@ FlowMenu.propTypes = {
flow: PropTypes.object.isRequired,
}
-function FlowMenu({ flow }) {
+function FlowMenu({ flow, onAccept, onReplay, onDuplicate, onRemove, onRevert }) {
return (
<div>
<div className="menu-row">
- <Button disabled={!flow.intercepted} title="[a]ccept intercepted flow" text="Accept" icon="fa-play" onClick={() => FlowActions.accept(flow)} />
- <Button title="[r]eplay flow" text="Replay" icon="fa-repeat" onClick={FlowActions.replay.bind(null, flow)} />
- <Button title="[D]uplicate flow" text="Duplicate" icon="fa-copy" onClick={FlowActions.duplicate.bind(null, flow)} />
- <Button title="[d]elete flow" text="Delete" icon="fa-trash" onClick={FlowActions.delete.bind(null, flow)}/>
- <Button disabled={!flow.modified} title="revert changes to flow [V]" text="Revert" icon="fa-history" onClick={() => FlowActions.revert(flow)} />
+ <Button disabled={!flow.intercepted} title="[a]ccept intercepted flow" text="Accept" icon="fa-play" onClick={() => onAccept(flow)} />
+ <Button title="[r]eplay flow" text="Replay" icon="fa-repeat" onClick={() => onReplay(flow)} />
+ <Button title="[D]uplicate flow" text="Duplicate" icon="fa-copy" onClick={() => onDuplicate(flow)} />
+ <Button title="[d]elete flow" text="Delete" icon="fa-trash" onClick={() => onRemove(flow)}/>
+ <Button disabled={!flow.modified} title="revert changes to flow [V]" text="Revert" icon="fa-history" onClick={() => onRevert(flow)} />
<Button title="download" text="Download" icon="fa-download" onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}/>
</div>
<div className="clearfix"/>
@@ -30,5 +30,12 @@ function FlowMenu({ flow }) {
export default connect(
state => ({
flow: state.flows.list.byId[state.flows.views.main.selected[0]],
- })
+ }),
+ {
+ onAccept: flowsActions.accept,
+ onReplay: flowsActions.replay,
+ onDuplicate: flowsActions.duplicate,
+ onRemove: flowsActions.remove,
+ onRevert: flowsActions.revert,
+ }
)(FlowMenu)