aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components
diff options
context:
space:
mode:
authorClemens <cle1000.cb@gmail.com>2016-06-20 10:20:41 +0200
committerClemens <cle1000.cb@gmail.com>2016-06-20 10:20:41 +0200
commit79834676cbb51941b9876fe799452036cf12853f (patch)
tree42eda48fa55185e1aeefd5ea4d4d1a05d42bd1f0 /web/src/js/components
parent165deb08fdb8225c8e2fea6c6025aa6534a4c771 (diff)
downloadmitmproxy-79834676cbb51941b9876fe799452036cf12853f.tar.gz
mitmproxy-79834676cbb51941b9876fe799452036cf12853f.tar.bz2
mitmproxy-79834676cbb51941b9876fe799452036cf12853f.zip
added accept and revert to flowmenu
Diffstat (limited to 'web/src/js/components')
-rw-r--r--web/src/js/components/Header/FlowMenu.jsx10
-rw-r--r--web/src/js/components/common/Button.jsx6
2 files changed, 10 insertions, 6 deletions
diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
index 96f42652..abecf0dc 100644
--- a/web/src/js/components/Header/FlowMenu.jsx
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -15,10 +15,12 @@ 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)}/>
+ <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 title="download" text="Download" icon="fa-download" onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}/>
</div>
<div className="clearfix"/>
</div>
diff --git a/web/src/js/components/common/Button.jsx b/web/src/js/components/common/Button.jsx
index cc2fe9dd..574288df 100644
--- a/web/src/js/components/common/Button.jsx
+++ b/web/src/js/components/common/Button.jsx
@@ -5,9 +5,11 @@ Button.propTypes = {
text: PropTypes.string.isRequired
}
-export default function Button({ onClick, text, icon }) {
+export default function Button({ onClick, text, icon, disabled }) {
return (
- <div className={"btn btn-default"} onClick={onClick}>
+ <div className={"btn btn-default"}
+ onClick={onClick}
+ disabled={disabled}>
<i className={"fa fa-fw " + icon}/>
&nbsp;
{text}