aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/Header
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-15 13:40:03 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-15 13:40:03 -0700
commitc7a891b652f4f85877c4dc8ee04fcd45d9e20a74 (patch)
treef80bdafc25555b459bd618ff20273b6b8eddc627 /web/src/js/components/Header
parent7de5d7b2984db3c835d3ef2ec3f81ba26a4e458a (diff)
parent94e2929b3fd6dc335d1c787167956df18f05494e (diff)
downloadmitmproxy-c7a891b652f4f85877c4dc8ee04fcd45d9e20a74.tar.gz
mitmproxy-c7a891b652f4f85877c4dc8ee04fcd45d9e20a74.tar.bz2
mitmproxy-c7a891b652f4f85877c4dc8ee04fcd45d9e20a74.zip
Merge branch 'add_flow_to_options'
Diffstat (limited to 'web/src/js/components/Header')
-rw-r--r--web/src/js/components/Header/FlowMenu.jsx32
1 files changed, 32 insertions, 0 deletions
diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
new file mode 100644
index 00000000..4a43f40f
--- /dev/null
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -0,0 +1,32 @@
+import React, { PropTypes } from 'react'
+import { Button } from '../common.js'
+import {FlowActions} from "../../actions.js";
+import {MessageUtils} from "../../flow/utils.js";
+import { connect } from 'react-redux'
+
+FlowMenu.title = "Flow"
+
+FlowMenu.propTypes = {
+ flow: PropTypes.object.isRequired,
+}
+
+function FlowMenu({ flow }) {
+
+ return (
+ <div>
+ <div className="menu-row">
+ <Button disabled 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 title="download" text="Download" icon="fa-download" onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}/>
+ </div>
+ <div className="clearfix"/>
+ </div>
+ )
+}
+
+export default connect(
+ state => ({
+ flow: state.flows.all.byId[state.flows.selected[0]]
+ })
+)(FlowMenu)