aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/Header/FlowMenu.jsx
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-12-11 19:59:54 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-12-11 19:59:54 +0100
commitd1c7b203f08d4b1e1ee3c7a50762a4f08843feef (patch)
tree0e1edad4249c0a88e623abf3479a4697c2114276 /web/src/js/components/Header/FlowMenu.jsx
parent6540aedaab107a7eecf57d2275e578d97fc77335 (diff)
downloadmitmproxy-d1c7b203f08d4b1e1ee3c7a50762a4f08843feef.tar.gz
mitmproxy-d1c7b203f08d4b1e1ee3c7a50762a4f08843feef.tar.bz2
mitmproxy-d1c7b203f08d4b1e1ee3c7a50762a4f08843feef.zip
[web] style flow menu
Diffstat (limited to 'web/src/js/components/Header/FlowMenu.jsx')
-rw-r--r--web/src/js/components/Header/FlowMenu.jsx62
1 files changed, 50 insertions, 12 deletions
diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
index e0c59afe..420cb054 100644
--- a/web/src/js/components/Header/FlowMenu.jsx
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -1,13 +1,13 @@
-import React, { PropTypes } from 'react'
-import { connect } from 'react-redux'
-import Button from '../common/Button'
-import { MessageUtils } from '../../flow/utils.js'
-import * as flowsActions from '../../ducks/flows'
+import React, { PropTypes } from "react"
+import { connect } from "react-redux"
+import Button from "../common/Button"
+import { MessageUtils } from "../../flow/utils.js"
+import * as flowsActions from "../../ducks/flows"
FlowMenu.title = 'Flow'
FlowMenu.propTypes = {
- flow: PropTypes.object.isRequired,
+ flow: PropTypes.object,
acceptFlow: PropTypes.func.isRequired,
replayFlow: PropTypes.func.isRequired,
duplicateFlow: PropTypes.func.isRequired,
@@ -16,14 +16,52 @@ FlowMenu.propTypes = {
}
function FlowMenu({ flow, acceptFlow, replayFlow, duplicateFlow, removeFlow, revertFlow }) {
+ if (!flow)
+ return <div/>
return (
<div>
- <Button disabled={!flow || !flow.intercepted} title="[a]ccept intercepted flow" text="Accept" icon="fa-play" onClick={() => acceptFlow(flow)} />
- <Button title="[r]eplay flow" text="Replay" icon="fa-repeat" onClick={() => replayFlow(flow)} />
- <Button title="[D]uplicate flow" text="Duplicate" icon="fa-copy" onClick={() => duplicateFlow(flow)} />
- <Button title="[d]elete flow" text="Delete" icon="fa-trash" onClick={() => removeFlow(flow)}/>
- <Button disabled={!flow || !flow.modified} title="revert changes to flow [V]" text="Revert" icon="fa-history" onClick={() => revertFlow(flow)} />
- <Button title="download" text="Download" icon="fa-download" onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}/>
+ <div className="menu-group">
+ <div className="menu-content">
+ <Button title="[r]eplay flow" icon="fa-repeat text-primary" onClick={() => replayFlow(flow)}>
+ Replay
+ </Button>
+ <Button title="[D]uplicate flow" icon="fa-copy text-info"
+ onClick={() => duplicateFlow(flow)}>
+ Duplicate
+ </Button>
+ <Button disabled={!flow || !flow.modified} title="revert changes to flow [V]"
+ icon="fa-history text-warning" onClick={() => revertFlow(flow)}>
+ Revert
+ </Button>
+ <Button title="[d]elete flow" icon="fa-trash text-danger" onClick={() => removeFlow(flow)}>
+ Delete
+ </Button>
+ </div>
+ <div className="menu-legend">Flow Modification</div>
+ </div>
+ <div className="menu-group">
+ <div className="menu-content">
+ <Button title="download" icon="fa-download"
+ onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}>
+ Download
+ </Button>
+ </div>
+ <div className="menu-legend">Export</div>
+ </div>
+ <div className="menu-group">
+ <div className="menu-content">
+ <Button disabled={!flow || !flow.intercepted} title="[a]ccept intercepted flow"
+ icon="fa-play text-success" onClick={() => acceptFlow(flow)}
+ >
+ Resume
+ </Button>
+
+ </div>
+ <div className="menu-legend">Interception</div>
+ </div>
+
+
+
</div>
)
}